{"success":true,"name":"animate-only-transform-and-opacity-and-respect-reduced-motio","description":"Adding CSS/JS animations, or animations stutter on weaker devices.","category":"ai-brimind","path":"ai-brimind/animate-only-transform-and-opacity-and-respect-reduced-motio/SKILL.md","file":"SKILL.md","content":"---\nname: animate-only-transform-and-opacity-and-respect-reduced-motio\ndescription: \"Adding CSS/JS animations, or animations stutter on weaker devices.\"\n---\n\n# Animate Only Transform and Opacity, and Respect Reduced Motion\n\n## When to use\nUI animations are being built (transitions, moving elements, effects), and the animated properties or performance on low-end devices haven't been considered.\n\n## Example request\nAnimating width/left/top → every frame recalculates layout; smooth on the dev machine, slideshow on a TV or old phone — layout-triggering animation. A box-shadow pulsing on hover → constant repaints devour the frame budget — paint-heavy effect. Vestibular-sensitive user faces sliding, zooming screens → discomfort with no way to opt out — reduced-motion preference ignored.\n\n## Instructions\nAct like a developer who knows animation performance is decided by WHICH property moves, not how elegant the easing is. Rules: (1) animate transform (translate/scale/rotate) and opacity — these run on the compositor, skipping layout and paint; achieve movement via translate, size-feel via scale, never by animating width/height/top/left/margin, which force layout recalculation every frame; if a layout property seems necessary, restructure the technique (measure once, then transform between the states); (2) budget the frame: the target is 60fps ≈ 16ms per frame including all other work — heavy paint effects (large blurs, animated shadows) blow it on weak hardware; TEST on the weakest real target (the actual TV, an old phone, or CPU-throttled DevTools), because the dev machine lies; use DevTools' performance/paint-flashing to see what's really repainting; (3) honor prefers-reduced-motion: wrap non-essential motion so users who've requested calm get instant or minimal transitions — motion is garnish, and some vestibular systems genuinely can't tolerate it; (4) purpose check: each animation should orient (where did that come from), connect (this became that), or acknowledge (you clicked) — decoration that delays users on every interaction is negative value at any framerate. Only proceed once animations hold framerate on the weakest target and reduced-motion mode is honored.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1196\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}