jsguy / mithril.animate

A compact library that allows you to bind CSS3 animations to properties on your Mithril elements.
MIT License
87 stars 4 forks source link

SVG animation #6

Open tehChromic opened 8 years ago

tehChromic commented 8 years ago

What a great addition to mithril! Is it possible to animate SVG using mithril.animate? If so would it be possible to put up a few examples?

jsguy commented 8 years ago

Hey, I don't have a lot of experience animating SVG, but there is no reason why we can't - it seems that mithril supports SVG just fine. Would you have a simple example of some SVG, and and a simple example of an animation - perhaps just opacity fading or something to start? I can investigate how feasible it would be - please use either codepen, jsbin or jsfiddle for your example.

tehChromic commented 8 years ago

Here's a link that gives an overview and there's a codepen in it:

https://davidwalsh.name/svg-animation

Actually the example uses velocity which I notice is your other open issue ... velocity might be a silver bullet that kills both birds if you'll pardon the mixed metaphors!

Here's the codepen:

http://codepen.io/julianshapiro/pen/wmtEH