Closed ghost closed 8 years ago
Hey,
In your example I didn't see the part that specifies animation. Could you explain to me how it would be animated? Thanks!
Hey Keyan,
I had adapted the svg from http://tympanus.net/Tutorials/SVGLoaderGSAP/index6.html
Looks like I was missing the CSS animations. Good spot. Thanks.
Actually @keyanzhang ,
Do keyframe animations work in React?
I have added the following to my sass file:
#outline {
stroke-dasharray: $len*0.01, $len;
stroke-dashoffset: 0;
animation: anim $time linear infinite;
}
@keyframes anim {
12.5% {
stroke-dasharray: $len*0.14, $len;
stroke-dashoffset: -$len*0.11;
}
43.75% {
stroke-dasharray: $len*0.35, $len;
stroke-dashoffset: -$len*0.35;
}
100% {
stroke-dasharray: $len*0.01, $len;
stroke-dashoffset: -$len*0.99;
}
}
But it still doesn't seem to be animating.
It should work. Could you provide a jsfiddle (https://jsfiddle.net/reactjs/69z2wepo/ is a good one to start) to demonstrate the issue?
Hey @keyanzhang
I got it working!
It was actually just a total user error on my part. I had changed the opacity
attribute to fillOpacity
for some bizarre reason lol.
Thanks for you help!
I'm seeing an issue with a SVG I have inside a react class. The class is as follows:
It renders the SVG fine, but the path elements aren't animating as they should.
I'm on React and React Dom 15.2.1
Thanks