Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
but which can be implemented using both css and javascript ...
I wanted to hear your opinion
We need control over the animation process and further expansion of the functionality - js
We need to make a primitive animation with minimal CPU costs - css
Chaotic switching on and flashing of lights - better through keyframes on css.
But breaking them on click / tap with sound, flashes and glasses is better through js.
If you can implement animation using only the transform, opacity and filter properties, then CSS is better.
CSS animations will be more GPU efficient as long as they don't call repaint.
The principle is well described here:
https://developers.google.com/web/fundamentals/per...
Better css as long as you don't need something complicated that css can't do.
Sometimes CSS is enough (and that's great), sometimes CSS gives in to JS even in those cases when it would seem that it shouldn't ( here , for example, in order to achieve adequate work in older browsers, everything had to be rewritten in JavaScript).
In addition, there are many nuances (it is better to animate movement through translate than top and left, et cetera), which must be taken into account regardless of the selected tool.
Probably, it is not very reasonable to cut ALL animations on one thing, it is worth choosing based on the wishes for the result and time constraints.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question