My question is which way is better in terms of performance ?
Nevermind I found the answer.
However, Css3 animations run in a separate thread which is an advantage because the browser is single threaded.
Say we do something heavy with JS that could freeze the entire page thus stop animations.
By using Css3, animations will not freeze.
Indeed, I don't need any logic.
I did the performance test and GSAP (JS) outperformed Zepto (CSS) with a gap of 10 fps.
--- sometimes must be considered performance such as page speed!
In JS, two-part for executing.
but in CSS, Just needed parse for executing.
-- CSS Animation
it's simple and comfortable
-- JS Animation
The implement may harder than CSS.
Debugging is harder than CSS.
JS animation power more than CSS.
Remind: 100ms faster -> increase 1% revenue.