Create performant web animations with proper accessibility and timing.
Only these properties animate on the compositor thread (60fps):
| Property | Use |
|---|---|
| INLINECODE0 | Move, rotate, scale (translateX, rotate, scale) |
| INLINECODE1 |
Everything else triggers layout or paint. Avoid animating:
width, height, margin, padding (layout thrashing)left, right, bottom (use transform instead)font-size (expensive reflows)CODEBLOCK0
~5% of users experience vestibular disorders (dizziness, nausea from motion).
CODEBLOCK1
Keep subtle fades and color changes even with reduced motion. Remove parallax, bouncing, infinite loops.
| Easing | Use case |
|---|---|
| INLINECODE12 | Elements entering view (appears responsive) |
| INLINECODE13 |
ease-in-out | Elements moving within view |
| linear | Only for spinners, progress bars, color cycling |
CODEBLOCK2
| Type | Duration |
|---|---|
| Micro-interactions (hover, focus) | 100-200ms |
| Transitions (modals, dropdowns) |
Anything over 500ms feels sluggish. Shorter is usually better.
Transitions: A to B state changes
CODEBLOCK3
Animations: Multi-step, auto-play, looping
CODEBLOCK4
Use transitions for hover/focus states. Use animations for on-load effects and sequences.
Only use as optimization when you have specific performance problems:
CODEBLOCK5
CODEBLOCK6
INLINECODE16 can cause unexpected animations on color, background, border changes.
Exit animations require AnimatePresence:
CODEBLOCK7
Stable keys for list animations:
CODEBLOCK8
AutoAnimate parent must be unconditional:
CODEBLOCK9
| Library | Size | Best for |
|---|---|---|
| CSS only | 0kb | Hover states, simple transitions |
| AutoAnimate |
Start with CSS. Add AutoAnimate for list animations. Only add Motion/GSAP for complex needs.
width/height instead of scale—causes layout thrashing该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 animations-1776419941 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 animations-1776419941 技能
skillhub install animations-1776419941
文件大小: 2.81 KB | 发布时间: 2026-4-17 20:14