When this site first loads there’s this animation where there’s a triangle that traces over another triangle.
Image
http://nueuphoria.com/
How would I replicate the same thing?
Where the triangle traces over the other triangle.
Can someone provide a jsfiddle of how it's done.
I found this from the site, but I don't know how to put it together.
https://jsfiddle.net/s2z3xyd8/6/
<div>
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 47.96 51.66">
<defs>
<style>
.cls-1{fill:none;stroke:#fff;stroke-miterlimit:10;stroke-width:4px;}</style>
</defs>
<g id="Слой_2" data-name="Слой 2">
<g id="play">
<path class="cls-1" d="M2,25.83V4.11A2.11,2.11,0,0,1,5.13,2.27L44.88,24.45a2.11,2.11,0,0,1,0,3.7L5.1,49.41A2.11,2.11,0,0,1,2,47.55V25.83"></path>
</g>
</g>
</svg>
</div>
It is just using the common line drawing technique of animating the stroke-dashoffset. The bit you were missing was the #keyframes` definition(s).
.logo-load_w svg path {
stroke: #08f9ff;
stroke-dasharray: 150;
stroke-dashoffset: 1500;
-webkit-animation: draw 20s infinite linear;
animation: draw 20s infinite linear;
}
#-webkit-keyframes draw {
to {
stroke-dashoffset: 0;
}
}
#keyframes draw {
to {
stroke-dashoffset: 0;
}
}
<div class="logo-load_w">
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 47.96 51.66"><defs><style>.cls-1{fill:none;stroke:#fff;stroke-miterlimit:10;stroke-width:4px;}</style></defs><g id="Слой_2" data-name="Слой 2"><g id="play"><path class="cls-1" d="M2,25.83V4.11A2.11,2.11,0,0,1,5.13,2.27L44.88,24.45a2.11,2.11,0,0,1,0,3.7L5.1,49.41A2.11,2.11,0,0,1,2,47.55V25.83"></path></g></g></svg>
</div>
The dark triangle in the background is just a second copy of the SVG, with the stroke colour set to a different colour.
Update
The simplest way to have a darker triangle behind the blue one, is not the way the original site does it. It is easier just to add a second copy of the triangle into the SVG. You put it earlier in the SVG, so that it is drawn first. And make its stroke colour black.
.logo-load_w svg .play {
stroke: #08f9ff;
stroke-dasharray: 150;
stroke-dashoffset: 1500;
-webkit-animation: draw 20s infinite linear;
animation: draw 20s infinite linear;
}
#-webkit-keyframes draw {
to {
stroke-dashoffset: 0;
}
}
#keyframes draw {
to {
stroke-dashoffset: 0;
}
}
<div class="logo-load_w">
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 47.96 51.66">
<defs>
<style>.cls-1{fill:none;stroke:#fff;stroke-miterlimit:10;stroke-width:4px;}</style>
</defs>
<g class="cls-1">
<path stroke="black"
d="M2,25.83V4.11A2.11,2.11,0,0,1,5.13,2.27L44.88,24.45a2.11,2.11,0,0,1,0,3.7L5.1,49.41A2.11,2.11,0,0,1,2,47.55V25.83"/>
<path class="play"
d="M2,25.83V4.11A2.11,2.11,0,0,1,5.13,2.27L44.88,24.45a2.11,2.11,0,0,1,0,3.7L5.1,49.41A2.11,2.11,0,0,1,2,47.55V25.83"/>
</g>
</g>
</svg>
</div>
I want the orange gear to spin as a gear spin but not move round around the page. Please help me, What am I doing wrong? Below is my code and I've also given link to codepen.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
.spin
{
-webkit-animation: spin 5s infinite linear;
-moz-animation: spin 5s infinite linear;
-o-animation: spin 5s infinite linear;
animation: spin 5s infinite linear;
}
#-webkit-keyframes spin {
from {-webkit-transform: rotate(0deg);}
to {-webkit-transform: rotate(360deg);}
}
#-moz-keyframes spin {
from {-moz-transform: rotate(0deg);}
to {-moz-transform: rotate(360deg);}
}
#-o-keyframes spin {
from {-o-transform: rotate(0deg);}
to {-o-transform: rotate(360deg);}
}
#keyframes spin{
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
</style>
</head>
<body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.2, 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="300px" height="300px" viewBox="0 0 143 143" style="enable-background:new 0 0 143 143;" xml:space="preserve">
<g>
<circle style="fill:#0A76A6;" cx="71.154" cy="72.193" r="71.193"/>
<path style="fill:rgba(0,0,0,0.5);" d="M142.299,74.125l-33.557-33.551c-0.325-0.336-0.793-0.549-1.301-0.549H34.875
c-1.027,0-1.861,0.844-1.861,1.861V88.73c0,0.449,0.163,0.865,0.448,1.191l0.192,0.193l51.834,51.826
C117.326,135.434,141.402,107.67,142.299,74.125z"/>
<g>
<g>
<polygon style="fill:#E1EFFA;" points="81.089,102.875 61.213,102.875 63.738,90.586 78.563,90.586 "/>
<polygon style="fill:#CEE2F1;" points="81.089,102.875 78.563,90.586 63.738,90.586 76.023,102.875 "/>
<rect x="55.892" y="102.875" style="fill:#FFFFFF;" width="30.519" height="1.484"/>
</g>
<path style="fill:#364A5E;" d="M34.871,40.027c-1.023,0-1.855,0.838-1.855,1.857v46.844c0,1.025,0.833,1.857,1.855,1.857h72.568
c1.019,0,1.854-0.832,1.854-1.857V41.885c0-1.02-0.836-1.857-1.854-1.857H34.871z"/>
<g>
<rect x="36.872" y="43.881" style="fill:#CEE2F1;" width="68.567" height="42.855"/>
<rect x="39.364" y="51.869" style="fill:#FFFFFF;" width="63.577" height="32.373"/>
<rect x="36.872" y="43.881" style="fill:#F78E36;" width="68.567" height="5.496"/>
<path style="fill:#FFFFFF;" d="M101.924,46.67c0,0.447-0.365,0.814-0.812,0.814H61.116c-0.447,0-0.814-0.367-0.814-0.814v-0.08
c0-0.447,0.368-0.814,0.814-0.814h39.997c0.446,0,0.812,0.367,0.812,0.814V46.67z"/>
<g>
<circle style="fill:#FFFFFF;" cx="44.72" cy="46.63" r="0.854"/>
<path style="fill:#FFFFFF;" d="M50.546,47.484c-0.471,0-0.854-0.385-0.854-0.855s0.383-0.854,0.854-0.854
c0.469,0,0.85,0.383,0.85,0.854S51.015,47.484,50.546,47.484z"/>
<circle style="fill:#FFFFFF;" cx="56.368" cy="46.63" r="0.854"/>
</g>
<g>
<path style="fill:#364A5E;" d="M85.862,61.174v-1.307L84.9,59.541c-0.051-0.293-0.127-0.578-0.227-0.852l0.668-0.766
l-0.653-1.133l-0.995,0.197c-0.098-0.111-0.197-0.219-0.3-0.324c-0.105-0.102-0.213-0.201-0.324-0.299l0.198-0.996l-1.134-0.652
l-0.765,0.666c-0.273-0.096-0.559-0.174-0.85-0.229l-0.328-0.959h-1.309l-0.328,0.959c-0.293,0.055-0.576,0.133-0.851,0.229
l-0.763-0.666l-1.133,0.652l0.197,0.996c-0.111,0.098-0.221,0.197-0.324,0.299c-0.104,0.105-0.204,0.213-0.302,0.324
l-0.995-0.195l-0.653,1.131l0.667,0.766c-0.098,0.273-0.174,0.559-0.227,0.852l-0.959,0.326v1.307l0.959,0.328
c0.053,0.295,0.129,0.578,0.227,0.852l-0.667,0.764l0.655,1.133l0.993-0.195l-0.002-0.006c0.098,0.113,0.198,0.223,0.304,0.328
s0.215,0.207,0.328,0.303l-0.201,0.992l1.133,0.654l0.763-0.668c0.274,0.098,0.558,0.174,0.851,0.229l0.328,0.959h1.309
l0.328-0.959c0.291-0.055,0.576-0.131,0.85-0.229l0.765,0.668l1.134-0.654l-0.198-0.994l-0.004,0.002
c0.113-0.096,0.223-0.197,0.328-0.303c0.103-0.104,0.202-0.213,0.3-0.324l0.995,0.197l0.653-1.133l-0.668-0.764
c0.1-0.273,0.176-0.557,0.227-0.852L85.862,61.174z M79.537,63.135c-1.443,0-2.613-1.172-2.613-2.615
c0-1.441,1.17-2.611,2.613-2.611c1.445,0,2.613,1.17,2.613,2.611C82.15,61.963,80.982,63.135,79.537,63.135z"/>
<g>
<path class="spin" style="fill:#F78E36;" d="M76.736,72.818v-2.098l-1.541-0.523c-0.084-0.469-0.207-0.926-0.363-1.367l1.07-1.225
l-1.049-1.818l-1.597,0.316c-0.157-0.18-0.313-0.352-0.481-0.52c-0.168-0.166-0.34-0.324-0.518-0.479l0.315-1.598l-1.819-1.049
l-1.226,1.07c-0.439-0.156-0.896-0.281-1.365-0.367l-0.524-1.539h-2.1l-0.524,1.539c-0.469,0.086-0.926,0.211-1.365,0.367
l-1.224-1.07l-1.82,1.049l0.318,1.598c-0.181,0.154-0.354,0.313-0.521,0.479c-0.165,0.168-0.326,0.34-0.482,0.52l-1.595-0.313
l-1.049,1.814l1.069,1.225c-0.155,0.441-0.28,0.898-0.364,1.367l-1.54,0.523v2.098l1.54,0.527
c0.083,0.473,0.208,0.924,0.364,1.365l-1.069,1.223l1.051,1.818l1.593-0.313l-0.004-0.012c0.155,0.182,0.318,0.359,0.486,0.527
c0.169,0.17,0.344,0.332,0.529,0.484l-0.326,1.592l1.82,1.053l1.224-1.072c0.439,0.158,0.896,0.279,1.365,0.365l0.524,1.539
h2.1l0.524-1.539c0.469-0.086,0.925-0.207,1.365-0.365l1.226,1.072l1.819-1.053l-0.315-1.594l-0.008,0.002
c0.18-0.152,0.357-0.314,0.525-0.484c0.168-0.166,0.324-0.34,0.481-0.52l1.597,0.316l1.049-1.818l-1.07-1.223
c0.156-0.441,0.279-0.893,0.363-1.365L76.736,72.818z M66.59,74.061c-1.266,0-2.291-1.025-2.291-2.291
c0-1.262,1.025-2.287,2.291-2.287c1.265,0,2.288,1.025,2.288,2.287C68.878,73.035,67.855,74.061,66.59,74.061z"/>
<path style="fill:#364A5E;" d="M66.59,66.846c-2.719,0-4.926,2.207-4.926,4.924c0,2.721,2.207,4.928,4.926,4.928
c2.721,0,4.924-2.207,4.924-4.928C71.515,69.053,69.312,66.846,66.59,66.846z M66.59,73.982c-1.222,0-2.211-0.99-2.211-2.213
c0-1.219,0.989-2.209,2.211-2.209s2.209,0.99,2.209,2.209C68.799,72.992,67.812,73.982,66.59,73.982z"/>
</g>
</g>
</g>
</g>
</g>
</svg>
</body>
</html>
http://codepen.io/nareshramini/pen/LbEKEJ
Something like this perhaps which works on Chrome.
.spin
{
-webkit-animation: spin 5s infinite linear;
-o-animation: spin 5s infinite linear;
animation: spin 5s infinite linear;
transform-origin: center center;
transform-box: fill-box;
}
This works in Firefox but not Chrome. Basically the animation works correctly in Firefox with the lightbulb glowing and the leaf growing but for some reason cannot get it to work in Chrome. Thanks for the help here.
jsfiddle here, http://jsfiddle.net/EfLtD/1/
<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"
viewBox="0 0 250 250" enable-background="new 0 0 250 250" xml:space="preserve">
<g id="light-bulb-6-icon_1_">
<path fill="#FFFFFF" d="M-314.3,152.1c-2.1,0-2.8-0.6-7.4-5c-0.6-0.6-1.4-1.3-2.2-2h25.6c-0.9,0.8-1.7,1.6-2.4,2.2
c-4.6,4.3-5.3,4.8-7.4,4.8H-314.3z M-326.6,137.7c-1.7,0-3.1-1.4-3.1-3.1s1.4-3.1,3.1-3.1h31.2c1.7,0,3.1,1.4,3.1,3.1
c0,1.7-1.4,3.1-3.1,3.1H-326.6z M-327.4,123.9c-1.7,0-3.1-1.4-3.1-3.1c0-1.7,1.4-3.1,3.1-3.1h32.7c0.9,0,1.7,0.4,2.3,1
c0.5,0.6,0.8,1.3,0.8,2.1c0,1.8-1.4,3.1-3.1,3.1L-327.4,123.9L-327.4,123.9z M-298,109.7c0.3-13.3,6.4-23.6,12.4-33.5
c6-10,11.6-19.4,11.6-31.5c0-16.9-11.6-35.1-37.1-35.1c-25.5,0-37,18.2-37,35.1c0,12.1,5.6,21.4,11.5,31.3
c5.9,9.9,12,20.1,12.6,33.7h-9.1c-0.3-10.3-5.6-19.1-11.2-28.5c-6.4-10.8-13-21.9-13-36.5c0-13.7,5-25.2,14.4-33.2
c8.4-7.2,19.7-11.1,31.9-11.1c12.1,0,23.4,3.9,31.8,11.1c9.4,8,14.4,19.5,14.4,33.2c0,14.6-6.6,25.7-13,36.5
c-5.6,9.4-10.8,18.2-11.2,28.5L-298,109.7L-298,109.7z M-312.8,109.6c-3.3-14.5-1.4-40.1,6.7-54.6l2.4-4.3l-3.9,3.1
c-5.2,4-9.9,14.2-11.6,21.9c-5.4-3.9-7.4-10.6-5.3-18.3c2.9-10.6,14-22,31.7-23.2c-2,1.8-3.6,4.2-4.5,7c-1.9,5.3-1.3,10.1-0.7,14.7
c0.6,4.6,1.1,9-0.8,13.6c-2,4.8-6.1,7.9-11.3,8.4l-0.8,0.1l-0.1,0.8c-1,9.8,0.3,22.7,3.1,30.8L-312.8,109.6L-312.8,109.6z"/>
<path fill="#225650" d="M-311,1.4c11.9,0,23,3.9,31.2,10.9c9.2,7.8,14.1,19.1,14.1,32.5c0,14.3-6.6,25.3-12.9,36
c-5.5,9.2-10.6,17.9-11.3,28h-7c0.6-12.5,6.5-22.4,12.2-32c5.8-9.7,11.8-19.7,11.8-32c0-11.2-4.1-20.5-12-27.1
c-6.9-5.8-16.2-9-26.1-9c-9.9,0-19.2,3.2-26.1,9c-7.8,6.6-12,16-12,27.1c0,12.4,5.7,21.8,11.6,31.9c5.7,9.5,11.5,19.3,12.4,32.1
h-7.1c-0.6-10.1-5.8-18.8-11.3-28c-6.3-10.6-12.9-21.7-12.9-36c0-13.4,4.9-24.6,14.1-32.5C-334,5.2-322.9,1.4-311,1.4L-311,1.4
M-295.4,35.5c-1.2,1.6-2.2,3.4-2.9,5.4c-1.9,5.5-1.3,10.4-0.8,15.2c0.5,4.5,1.1,8.7-0.7,13.1c-1.8,4.5-5.6,7.3-10.4,7.8l-1.6,0.2
l-0.2,1.6c-1,9.4,0.2,21.7,2.7,29.9h-2.7c-3-14.4-1.1-39.1,6.8-53.1l4.9-8.7l-7.8,6.1c-5.1,4-9.6,13.2-11.6,21
c-4.1-3.7-5.5-9.6-3.7-16.2c1.6-5.9,5.5-11.4,11-15.4C-307.7,38.6-301.8,36.3-295.4,35.5 M-294.7,118.7c0.6,0,1.2,0.2,1.6,0.7
c0.2,0.3,0.5,0.7,0.5,1.4l0,0v0c0,1.1-1,2.1-2.1,2.1h-32.7c-1.1,0-2.1-1-2.1-2.1c0-1.1,1-2.1,2.1-2.1L-294.7,118.7 M-295.4,132.5
c1.2,0,2.1,0.9,2.1,2.1c0,1.1-1,2.1-2.1,2.1h-31.2c-1.1,0-2.1-1-2.1-2.1s1-2.1,2.1-2.1H-295.4 M-300.9,146.1
c-0.2,0.2-0.3,0.3-0.5,0.5c-4.6,4.2-5.1,4.5-6.7,4.5h-6.2c-1.6,0-2.1-0.4-6.7-4.7c-0.1-0.1-0.2-0.2-0.3-0.3H-300.9 M-311-0.6
c-23.6,0-47.3,15.1-47.3,45.3c0,28.1,24.2,43.8,24.2,66h11.1c-0.6-28-24.1-41.7-24.1-66c0-22.8,18-34.1,36-34.1S-275,22-275,44.7
c0,24.3-24,38.7-24,66h11c0-22.2,24.2-37.9,24.2-66C-263.8,14.5-287.4-0.6-311-0.6L-311-0.6z M-289.6,33.1
c-33.2,0-46.5,33.8-28.9,44.2c1.5-8.4,6.5-18.9,11.5-22.8c-8.3,14.8-10.3,41.2-6.6,56.1h7.1c-3.1-8-4.5-21.8-3.5-31.7
c5-0.5,9.8-3.4,12.1-9c3.9-9.7-2.1-18.1,1.5-28.4C-295.1,37.7-292.7,34.9-289.6,33.1L-289.6,33.1z M-294.7,116.7h-32.7
c-2.3,0-4.1,1.9-4.1,4.1c0,2.3,1.9,4.1,4.1,4.1h32.7c2.3,0,4.1-1.9,4.1-4.1C-290.5,118.5-292.4,116.7-294.7,116.7L-294.7,116.7z
M-295.4,130.5h-31.2c-2.3,0-4.1,1.9-4.1,4.1c0,2.3,1.9,4.1,4.1,4.1h31.2c2.3,0,4.1-1.9,4.1-4.1
C-291.3,132.3-293.1,130.5-295.4,130.5L-295.4,130.5z M-295.7,144.1h-30.7c8.1,7.5,8.9,9,12.1,9h6.2
C-304.9,153.1-304.2,151.7-295.7,144.1L-295.7,144.1z"/>
</g>
<g>
<path fill="#F9E46E" class="yellow" d="M89.5,93.2c0,24.3,23.5,38,24.1,66h24c0-27.3,24-41.7,24-66C161.6,47.7,89.5,47.7,89.5,93.2z"/>
</g>
<g id="light-bulb-6-icon_37_">
<path fill="#FFFFFF" d="M122.2,200.9c-2.1,0-2.8-0.6-7.4-5c-0.6-0.6-1.4-1.3-2.2-2h25.6c-0.9,0.8-1.7,1.6-2.4,2.2
c-4.6,4.3-5.3,4.8-7.4,4.8H122.2z M109.9,186.5c-1.7,0-3.1-1.4-3.1-3.1s1.4-3.1,3.1-3.1h31.2c1.7,0,3.1,1.4,3.1,3.1
c0,1.7-1.4,3.1-3.1,3.1H109.9z M109.1,172.7c-1.7,0-3.1-1.4-3.1-3.1c0-1.7,1.4-3.1,3.1-3.1h32.7c0.9,0,1.7,0.4,2.3,1
c0.5,0.6,0.8,1.3,0.8,2.1c0,1.8-1.4,3.1-3.1,3.1L109.1,172.7L109.1,172.7z M138.6,158.5c0.3-13.3,6.4-23.6,12.4-33.5
c6-10,11.6-19.4,11.6-31.5c0-16.9-11.6-35.1-37.1-35.1S88.4,76.6,88.4,93.5c0,12.1,5.6,21.4,11.5,31.3c5.9,9.9,12,20.1,12.6,33.7
h-9.1c-0.3-10.3-5.6-19.1-11.2-28.5c-6.4-10.8-13-21.9-13-36.5c0-13.7,5-25.2,14.4-33.2c8.4-7.2,19.7-11.1,31.9-11.1
c12.1,0,23.4,3.9,31.8,11.1c9.4,8,14.4,19.5,14.4,33.2c0,14.6-6.6,25.7-13,36.5c-5.6,9.4-10.8,18.2-11.2,28.5L138.6,158.5
L138.6,158.5z"/>
<path fill="#225650" d="M122.3,201.9h6.2c3.2,0,3.9-1.4,12.4-9h-30.7C118.3,200.4,119,201.9,122.3,201.9z M135.2,195.3
c-4.6,4.2-5.1,4.5-6.7,4.5h-6.2c-1.6,0-2.1-0.4-6.7-4.7c-0.1-0.1-0.2-0.2-0.3-0.3h20.5C135.5,195,135.3,195.2,135.2,195.3z"/>
<path fill="#225650"d="M141.1,179.3h-31.2c-2.3,0-4.1,1.9-4.1,4.1c0,2.3,1.9,4.1,4.1,4.1h31.2c2.3,0,4.1-1.9,4.1-4.1
C145.2,181.1,143.4,179.3,141.1,179.3z M141.1,185.5h-31.2c-1.1,0-2.1-1-2.1-2.1s1-2.1,2.1-2.1h31.2c1.2,0,2.1,0.9,2.1,2.1
C143.2,184.5,142.3,185.5,141.1,185.5z"/>
<path fill="#225650" d="M125.5,48.1c-23.6,0-47.3,15.1-47.3,45.3c0,28.1,24.2,43.8,24.2,66h11.1c-0.6-28-24.1-41.7-24.1-66
c0-22.8,18-34.1,36.1-34.1s36,11.4,36,34.1c0,24.3-24,38.7-24,66h11c0-22.2,24.2-37.9,24.2-66C172.8,63.2,149.1,48.1,125.5,48.1z
M146.6,157.5h-7c0.6-12.5,6.5-22.4,12.2-32c5.8-9.7,11.8-19.7,11.8-32c0-11.2-4.1-20.5-12-27.1c-6.9-5.8-16.2-9-26.1-9
s-19.2,3.2-26.1,9c-7.8,6.6-12,16-12,27.1c0,12.4,5.7,21.8,11.6,31.9c5.7,9.5,11.5,19.3,12.4,32.1h-7.1c-0.6-10.1-5.8-18.8-11.3-28
c-6.3-10.6-12.9-21.7-12.9-36c0-13.4,4.9-24.6,14.1-32.5c8.2-7,19.3-10.9,31.2-10.9c11.9,0,23,3.9,31.2,10.9
c9.2,7.8,14.1,19.1,14.1,32.5c0,14.3-6.6,25.3-12.9,36C152.4,138.6,147.2,147.3,146.6,157.5z"/>
<path fill="#225650" d="M141.8,165.5h-32.7c-2.3,0-4.1,1.9-4.1,4.1c0,2.3,1.9,4.1,4.1,4.1h32.7c2.3,0,4.1-1.9,4.1-4.1
C146,167.3,144.1,165.5,141.8,165.5z M143.9,169.5L143.9,169.5c0,1.2-1,2.1-2.1,2.1h-32.7c-1.1,0-2.1-1-2.1-2.1
c0-1.1,1-2.1,2.1-2.1h32.7v0c0.6,0,1.2,0.2,1.6,0.7C143.7,168.4,144,168.8,143.9,169.5L143.9,169.5z"/>
</g>
<path fill="#FFFFFF" class="leaf" stroke="#225650" stroke-width="2" stroke-miterlimit="10" d="M121.8,158.6c-3.3-14.5-1.4-40.1,6.7-54.6
l2.4-4.3l-3.9,3.1c-5.2,4-9.9,14.2-11.6,21.9c-5.4-3.9-7.4-10.6-5.3-18.3c2.9-10.6,14-22,31.7-23.2c-2,1.8-3.6,4.2-4.5,7
c-1.9,5.3-1.3,10.1-0.7,14.7c0.6,4.6,1.1,9-0.8,13.6c-2,4.8-6.1,7.9-11.3,8.4l-0.8,0.1l-0.1,0.8c-1,9.8,0.3,22.7,3.1,30.8
L121.8,158.6L121.8,158.6z"/>
</svg>
/* CSS */
/* Globe */
#yellow-globe {width: 300px; height: 300px; margin: 0 auto; text-align: center;}
#keyframes yellow {
0% {
fill: #FFFFFF;
}
25% {
fill: #FFFFFF;
}
50% {
fill: #F9E46E;
}
75% {
fill: #F9E46E;
}
100% {
fill: #F9E46E;
}
}
.yellow {
fill: yellow;
animation-name: yellow;
animation-duration: 1s;
animation-iteration-count: infinite;
}
.leaf {
stroke-dasharray: 242;
stroke-dashoffset: 242;
animation: dash 4s linear alternate;
animation-iteration-count: 1;
}
#keyframes dash {
from {
stroke-dashoffset: 242;
}
to {
stroke-dashoffset: 0;
}
}
#keyframes fillme {
0% {
fill: #FFFFFF;
}
25% {
fill: #FFFFFF;
}
50% {
fill: #225650;
}
75% {
fill: #225650;
}
100% {
fill: #225650;
}
}
You need to include the -webkit- prefix on animations (and transitions) for webkit browsers (like Chrome). Working demo
You may also want to include the -ms- and -moz- prefixes so that you can reach older versions of FireFox and IE as well