Small optimisations of crocodile demo

master
Dmitry Baranovskiy 2013-10-16 11:10:39 +11:00
parent a803cb783e
commit f8d7d64735
2 changed files with 52 additions and 93 deletions

View File

@ -2,117 +2,76 @@
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="260px" height="250px" viewBox="-5 0 260 250" enable-background="new -5 0 260 250" xml:space="preserve">
width="260px" height="250px" viewBox="0 0 260 250" enable-background="new 0 0 260 250" xml:space="preserve">
<g>
<g id="symbol" opacity="0.2">
<rect x="186.241" y="139.98" transform="matrix(0.4196 0.9077 -0.9077 0.4196 242.6889 -90.6368)" fill="#848383" width="11.964" height="8.973"/>
<polygon fill="#848383" points="246.828,109.341 199.215,134.647 204.235,145.507 254.358,125.631 "/>
</g>
<path id="symbol" opacity="0.2" fill="#848383" d="M185.631,140.915l5.02,10.86l8.145-3.765l-5.02-10.86L185.631,140.915z
M246.828,109.341l-47.613,25.306l5.02,10.86l50.123-19.876L246.828,109.341z"/>
<g id="head">
<polygon fill="#09B39C" points="44.613,146.703 26.665,140.721 8.718,146.703 -0.252,146.703 -0.252,206.523 44.613,206.523
119.387,206.523 119.387,167.64 "/>
<polygon opacity="0.2" fill="#FFFFFF" enable-background="new " points="-0.252,146.703 11.712,170.631 26.667,140.721
8.721,146.703 "/>
<polyline opacity="0.2" fill="#FFFFFF" enable-background="new " points="8.718,146.703 20.685,152.685 26.665,140.721 "/>
<polygon opacity="0.2" fill="#FFFFFF" enable-background="new " points="44.613,146.703 53.613,163.667 17.694,143.712
26.667,140.721 "/>
119.387,206.523 119.387,167.64"/>
<polygon opacity="0.2" fill="#FFFFFF" points="-0.252,146.703 11.712,170.631 26.667,140.721
8.721,146.703"/>
<polyline opacity="0.2" fill="#FFFFFF" points="8.718,146.703 20.685,152.685 26.665,140.721"/>
<polygon opacity="0.2" fill="#FFFFFF" points="44.613,146.703 53.613,163.667 17.694,143.712
26.667,140.721"/>
</g>
<g id="upper-head">
<g id="upper-jaw">
<g>
<g>
<polygon fill="#E0CAB1" points="151.174,129.382 166.087,135.468 159.485,120.777 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="159.485,120.777 166.087,135.468 155.329,125.08
"/>
</g>
<g>
<polygon fill="#E0CAB1" points="138.707,142.292 153.621,148.378 147.018,133.686 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="147.018,133.686 153.621,148.378 142.863,137.989
"/>
</g>
<g>
<polygon fill="#E0CAB1" points="126.241,155.201 141.154,161.287 134.552,146.595 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="134.552,146.595 141.154,161.287 130.396,150.898
"/>
</g>
<g>
<polygon fill="#E0CAB1" points="163.64,116.474 178.553,122.559 171.95,107.867 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="171.95,107.867 178.553,122.559 167.796,112.171
"/>
</g>
<g>
<polygon fill="#E0CAB1" points="176.106,103.564 191.019,109.65 184.417,94.958 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="184.417,94.958 191.019,109.65 180.261,99.261
"/>
</g>
<g>
<polygon fill="#E0CAB1" points="188.572,90.655 203.486,96.74 196.884,82.049 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="196.884,82.049 203.486,96.74 192.728,86.352
"/>
</g>
<g>
<polygon fill="#E0CAB1" points="201.039,77.746 215.952,83.831 209.35,69.14 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="209.35,69.14 215.952,83.831 205.195,73.443
"/>
</g>
<g>
<polygon fill="#E0CAB1" points="213.505,64.837 228.418,70.922 221.816,56.23 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="221.816,56.23 228.418,70.922 217.66,60.533
"/>
</g>
<path id="upper-teeth" fill="#E0CAB1" d="M151.174,129.382l14.913,6.086l-6.602-14.691L151.174,129.382z M138.707,142.292
l14.914,6.086l-6.603-14.692L138.707,142.292z M126.241,155.201l14.913,6.086l-6.602-14.692L126.241,155.201z M163.64,116.474
l14.913,6.085l-6.603-14.692L163.64,116.474z M176.106,103.564l14.913,6.086l-6.602-14.692L176.106,103.564z M188.572,90.655
l14.914,6.085l-6.602-14.691L188.572,90.655z M201.039,77.746l14.913,6.085L209.35,69.14L201.039,77.746z M221.816,56.23
l-8.311,8.607l14.913,6.085L221.816,56.23z"/>
<path opacity="0.4" fill="#FFFFFF" d="M155.329,125.08l10.758,10.388l-6.602-14.691L155.329,125.08
z M142.863,137.989l10.758,10.389l-6.603-14.692L142.863,137.989z M130.396,150.898l10.758,10.389l-6.602-14.692
L130.396,150.898z M167.796,112.171l10.757,10.388l-6.603-14.692L167.796,112.171z M180.261,99.261l10.758,10.389l-6.602-14.692
L180.261,99.261z M192.728,86.352l10.758,10.388l-6.602-14.691L192.728,86.352z M205.195,73.443l10.757,10.388L209.35,69.14
L205.195,73.443z M221.816,56.23l-4.156,4.303l10.758,10.389L221.816,56.23z"/>
</g>
<polygon fill="#09B39C" points="215.135,33 200.18,33 197.189,46.955 92,125 88.355,171.706 106.387,180.64 236.072,47.955
"/>
<polygon opacity="0.2" fill="#FFFFFF" enable-background="new " points="92,125 97.423,150.703 197.189,46.955 "/>
<polyline opacity="0.2" fill="#FFFFFF" enable-background="new " points="197.189,46.955 185.207,76.892 92,125 "/>
<polygon opacity="0.2" fill="#FFFFFF" enable-background="new " points="200.18,33 236.072,47.955 215.135,33 "/>
<polygon opacity="0.2" fill="#FFFFFF" enable-background="new " points="197.189,46.955 215.135,33 200.18,33 "/>
<polygon fill="#09B39C" points="215.135,33 200.18,33 197.189,46.955 92,125 88.355,171.706 106.387,180.64 236.072,47.955"/>
<polygon opacity="0.2" fill="#FFFFFF" points="92,125 97.423,150.703 197.189,46.955"/>
<polyline opacity="0.2" fill="#FFFFFF" points="197.189,46.955 185.207,76.892 92,125"/>
<polygon opacity="0.2" fill="#FFFFFF" points="200.18,33 236.072,47.955 215.135,33"/>
<polygon opacity="0.2" fill="#FFFFFF" points="197.189,46.955 215.135,33 200.18,33"/>
</g>
<polygon fill="#09B39C" points="92,125 65.55,126.757 44.613,146.703 44.613,176.523 119.387,176.523 119.387,167.64
107.897,156.377 "/>
<polygon opacity="0.2" fill="#FFFFFF" enable-background="new " points="92,125 102.423,145.703 65.55,126.757 "/>
<polygon opacity="0.2" fill="#FFFFFF" enable-background="new " points="44.613,146.703 102.423,145.703 92,125 65.55,126.757
"/>
<polygon id="eye_1_" fill="#FFFFFF" points="71.532,145.703 83.495,139.721 95.459,145.703 80.505,154.676 "/>
<polygon opacity="0.2" fill="#FFFFFF" enable-background="new " points="44.613,146.703 44.613,158.667 92,125 65.55,126.757
"/>
107.897,156.377"/>
<polygon opacity="0.2" fill="#FFFFFF" points="92,125 102.423,145.703 65.55,126.757"/>
<polygon opacity="0.2" fill="#FFFFFF" points="44.613,146.703 102.423,145.703 92,125 65.55,126.757"/>
<polygon id="eye_1_" fill="#FFFFFF" points="71.532,145.703 83.495,139.721 95.459,145.703 80.505,154.676"/>
<polygon opacity="0.2" fill="#FFFFFF" points="44.613,146.703 44.613,158.667 92,125 65.55,126.757"/>
</g>
<g id="bottom-jaw">
<g>
<polygon fill="#E0CAB1" points="152.531,185.586 158.513,170.631 164.495,185.586 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="164.495,185.586 158.513,170.631 158.513,185.586
"/>
<polygon fill="#E0CAB1" points="152.531,185.586 158.513,170.631 164.495,185.586"/>
<polygon opacity="0.4" fill="#FFFFFF" points="164.495,185.586 158.513,170.631 158.513,185.586"/>
</g>
<g>
<polygon fill="#E0CAB1" points="170.477,185.586 176.459,170.631 182.441,185.586 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="182.441,185.586 176.459,170.631 176.459,185.586
"/>
<polygon fill="#E0CAB1" points="170.477,185.586 176.459,170.631 182.441,185.586"/>
<polygon opacity="0.4" fill="#FFFFFF" points="182.441,185.586 176.459,170.631 176.459,185.586"/>
</g>
<g>
<polygon fill="#E0CAB1" points="188.423,185.586 194.405,170.631 200.387,185.586 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="200.387,185.586 194.405,170.631 194.405,185.586
"/>
<polygon fill="#E0CAB1" points="188.423,185.586 194.405,170.631 200.387,185.586"/>
<polygon opacity="0.4" fill="#FFFFFF" points="200.387,185.586 194.405,170.631 194.405,185.586"/>
</g>
<g>
<polygon fill="#E0CAB1" points="206.369,185.586 212.351,170.631 218.333,185.586 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="218.333,185.586 212.351,170.631 212.351,185.586
"/>
<polygon fill="#E0CAB1" points="206.369,185.586 212.351,170.631 218.333,185.586"/>
<polygon opacity="0.4" fill="#FFFFFF" points="218.333,185.586 212.351,170.631 212.351,185.586"/>
</g>
<g>
<polygon fill="#E0CAB1" points="224.315,185.586 230.297,170.631 236.279,185.586 "/>
<polygon opacity="0.4" fill="#FFFFFF" enable-background="new " points="236.279,185.586 230.297,170.631 230.297,185.586
"/>
<polygon fill="#E0CAB1" points="224.315,185.586 230.297,170.631 236.279,185.586"/>
<polygon opacity="0.4" fill="#FFFFFF" points="236.279,185.586 230.297,170.631 230.297,185.586"/>
</g>
<polygon fill="#E0CAB1" points="148.54,179.604 119.596,167.64 109.657,167.64 103.675,167.64 91.711,167.64 79.747,179.604
-4,200.541 -4,206.523 79.747,206.523 156.522,206.523 187.432,198.55 235.288,189.577 244.252,179.604 "/>
<polygon opacity="0.3" fill="#FFFFFF" enable-background="new " points="119.594,167.64 91.711,167.64 79.747,179.604 "/>
<polygon opacity="0.3" fill="#FFFFFF" enable-background="new " points="91.711,167.64 79.747,206.523 79.747,179.604 "/>
<polygon opacity="0.1" fill="#534741" enable-background="new " points="235.288,189.577 160.513,195.559 115.639,206.523
156.522,206.523 187.432,198.55 "/>
<polygon opacity="0.1" fill="#534741" enable-background="new " points="187.432,198.55 160.513,195.559 156.522,206.523
156.522,206.523 "/>
<polygon opacity="0.3" fill="#FFFFFF" enable-background="new " points="-4,200.541 46.847,194.559 79.747,179.604 "/>
-4,200.541 -4,206.523 79.747,206.523 156.522,206.523 187.432,198.55 235.288,189.577 244.252,179.604"/>
<polygon opacity="0.3" fill="#FFFFFF" points="119.594,167.64 91.711,167.64 79.747,179.604"/>
<polygon opacity="0.3" fill="#FFFFFF" points="91.711,167.64 79.747,206.523 79.747,179.604"/>
<polygon opacity="0.1" fill="#534741" points="235.288,189.577 160.513,195.559 115.639,206.523
156.522,206.523 187.432,198.55"/>
<polygon opacity="0.1" fill="#534741" points="187.432,198.55 160.513,195.559 156.522,206.523
156.522,206.523"/>
<polygon opacity="0.3" fill="#FFFFFF" points="-4,200.541 46.847,194.559 79.747,179.604"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -20,8 +20,8 @@
<script>
window.onload = function () {
var g = Snap("100%", "100%");
var g = Snap();
Snap.load("crocodile.svg", function (f) {
var gr = f.select("g"),
head = f.select("#upper-head"),
@ -30,8 +30,8 @@
top = g.g();
var pivots = [
[44,147],
[92,126]
[44, 147],
[92, 126]
];
@ -72,7 +72,7 @@
}
top.add(gr.attr());
top.add(gr);
close();
});