I'm trying to animate an SVG I created in Inkscape using CSS/JS, and it seems like it should be fairly simple: I'm just adding the
.rotating
#gear-small
.logo {
overflow: visible;
transform: scale(0.5);
}
.rotating {
animation-name: rotate;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
@keyframes rotate {
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
You forgot to add the initial transformation to your keyframes, so it's being overriden:
@keyframes rotate {
from {transform: translate(40.785px, 47.68px) rotate(0deg);}
to {transform: translate(40.785px, 47.68px) rotate(360deg);}
}
Please see the updated jsfiddle: https://jsfiddle.net/mj2ozjvd/2/
You may update animation-duration
with the correct timings (it's easy to count) for the precize animation.