-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for SVG animations #5
Conversation
Hey Lukas, thank you so much for this extension! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works like a charm!
I've noticed that svg-anim
currently has no real use for the key
value after the colon.
Do you have an idea for this?
Alternatively, we could use this value to differentiate between CSS animations and SVG animations. An empty key or a value that is not a legal keyframes identifier could mark the SVG case, such as anim:
, or anim:/svg
But I'm unsure about the DX. Will it be too unintuitive?
I liked the idea of merging CSS-anim and SVG-anim if it doesn't get too confusing, but I'm okay with svg-anim
too. Your call!
Hey Martin, thanks so much for taking a look! I've basically had the same concerns and ideas as you brought up here, which is good. I personally feel like this belongs to the Maybe there's a more general improvement to the
I have no data to back this up, but I feel like the first case would be sufficient for most developers, which could simplify the dx (no need to specify the name, which also makes it more robust against animation name changes). Happy to go with whatever approach you feel is most appropriate |
I completely agree with everything you say, Lukas! I think the first point with the meaning “all” is great. But I would take that out of the current PR for now because |
That sounds great, and I love the idea with the wildcard key! Makes everything much more consistent. Also agree we should leave this out for now. I'll get right on changing the implementation so that the last 3 points work as explained. Oh and I had a quick look at persisting |
Thanks for the link! what a lot of information in one article ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Thank you very much!
Awesome. I'll update the docs PR as soon as I have a free minute |
Thank you so much, no rush! |
@martrapp I've added a changeset with level |
Description
Adds support for transferring SVG animation state, which is achieved by getting the animation time via
SVGSVGElement.getCurrentTime()
and setting the time viaSVGSVGElement.setCurrentTime()
.Todo:
svg-anim
nameTests
Added an animated SVG element to the vt-bag website and tested that the animation state is transferred
Recording
Docs & Examples
vtbag/website#39