Animations - alexanderteplov/computer-science GitHub Wiki
Animations and performance
-
JavaScript
- Use
requestAnimationFrame() to control animations
- Use
requestIdleCallback() to serve background work without impacting latency-critical events as animation and input response
-
CSS
- Animate only CSS properties that don't trigger layout:
transform: translate()
transform: rotate()
transform: scale()
opacity
- For reasonable optimization use
will-change
-
Web Animations API
- It is one of the most performant ways to animate on the Web
⚠️ **GitHub.com Fallback** ⚠️