Grouping all animations into one single RAF
See original GitHub issueRight now every anime
instance will create a new RAF.
I started doing some performance test with a single RAF, and the results are really good (up to 20/30% faster when a lot of animation are running simultaneously).
You can test it here https://github.com/juliangarnier/anime/tree/single-RAF.
My only concern is the use of performance.now(), not sure if it’s still too early to use http://caniuse.com/#feat=high-resolution-time.
Some tests: Old: http://codepen.io/juliangarnier/full/545d66779d81ee68062bc8db018f6ee1/
New with a single RAF: http://codepen.io/juliangarnier/full/f56c939864ea6b1b6efa8726e7ea8119/
Feedbacks are welcome.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Group and animate a set of objects - Microsoft Support
Hold down the Ctrl key and click all the objects that you want to animate together. · Right-click the selected objects, and then...
Read more >JavaScript rAF in a nutshell (requestAnimationFrame) - Medium
A very small intro to requestAnimationFrame function in JavaScript to achieve smooth animations. (source: unsplash.com). requestAnimationFrame was one of ...
Read more >Make groups of objects appear and disappear in sequence ...
First: if you need to assign multiple animations to a single shape, don't use the Animation tab for the second and later animations....
Read more >A Guide to SVG Animations (SMIL) - CSS-Tricks
All animation elements also share another attribute: attributeName . The attributeName attribute is used to specify the name of the attribute ...
Read more >Towards an animation smoothness metric - web.dev
We've probably all interacted with an interface which just added too ... or "rAF", tells the browser that you wish to perform an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think it’s actually possible to do what you described. Anime expose the .tick() function of an animation, and you can do things like this :
If you use single RAF, I have an idea For example
We can create slow-motion animation and invert animation, as applied to all animation on browser.
This is my cpp animation manager. https://github.com/devmario/CppTweener/blob/master/tween.h https://github.com/devmario/CppTweener/blob/master/tween.cpp