FAC-11 / JAAM

One page team portfolio
https://fac-11.github.io/JAAM/
1 stars 0 forks source link

Nav animation is choppy #42

Open oliverjam opened 7 years ago

oliverjam commented 7 years ago

First of all I love the animation on the navbar. It's just a bit laggy and slow, which is because you're animating width.

Generally it's best to avoid animating anything but transform (e.g. translate, scale, rotate etc) and opacity. These are GPU-accelerated and don't cause the browser to have to re-layout the page (animating things like top or width do), which means the animations can easily hit 60 frames per second.

In this case you could animate transform: scaleX(1.2) (ish) instead of width.

There's more info here:

https://medium.com/outsystems-experts/how-to-achieve-60-fps-animations-with-css3-db7b98610108

https://aerotwist.com/blog/flip-your-animations/