Web motion
Motion shows change; it is not decoration. The screen must work standing still; movement comes last, where it explains something or confirms an action. Durations, easing and micro-interaction timing belong to ui-design/references/motion.md: read it, do not restate it.
Precedence
- Project design system and motion tokens (DESIGN.md, tokens, components, CLAUDE.md/AGENTS.md).
ux-design: which feedback and states, flow, accessibility.ui-design: how each state looks; durations and easing.- An explicit aesthetic direction in the brief.
- This skill: how it moves and with which tool.
Add motion only after the static screen works: content, layout, states and focus correct with animation off.
Layout, spacing and visual finish belong to
ui-design: this skill never decides button width, the gap between fields or card styling; it only moves what ui-design laid out. Before writing code for an animation library (GSAP, three.js, Lottie, Rive, Motion), read its current docs (Context7 when connected, else the official site) instead of memory; pin the version you read.
1. Tool selector (lightest first; climb only on the signal)
- CSS - transitions,
@keyframes, scroll-driven animation (animation-timeline), View Transitions. Default for state changes, reveals, hovers. Climb for path drawing, morphing or many coordinated parts. - Animated SVG - stroke drawing, icon morphs, diagrams with independent parts (CSS or Web Animations API). Climb for hundreds of objects or per-pixel work.
- Canvas 2D - particles, simulations, data redrawn every frame. Climb when a designer hands over a timeline you should not rebuild by hand.
- Lottie or Rive - designer-authored vector animation; Rive when it reacts to input. Check file weight first.
- three.js - only when depth is the content: an object the user rotates, spatial data, a scene that explains what 2D cannot.
No 3D for background effects, logo spins, "premium feel", text-heavy pages, or low-end phones and slow networks; a still image or short video usually wins. GSAP or Motion help with complex sequences at any step; a library is not a step. Versions and support:
references/versoes.md.
2. Landing page
- One orchestrated moment at the top, done in about a second; the rest quiet: at most one short reveal per section, once, no loops.
- Nothing delays the top: hero text and image render without JS; heavy players load after first paint or on interaction, behind a same-size static poster (no layout shift).
- The CTA is visible and usable before and during the animation. No scroll-jacking, no parallax on body text.
3. Explanation
- Motion answers a user action (Next, slider, click on a part) and shows what changed; it never plays by itself.
- One state per step. Show what changed and how the part looks after the movement. When the diagram adds information, keep its caption or accessible description in sync with the visible state.
- Works without animation: text plus the final frame carry the meaning. If JavaScript drives the explainer, keep the instructions available without it. Previous, next, restart; keyboard reachable; step announced (
aria-live="polite"). Never auto-advance faster than reading.
4. Feedback in motion
- Respond to a press within 100 ms (pressed state on pointer down, not on the server reply).
- Form states, loading and submit belong to
ui-designandux-design.
5. Sound and vibration (only when asked)
- Never on load or by itself; only after a user action.
- Short, quiet, with a visible mute control that is remembered; respect silent mode and autoplay policy.
- Never the only signal of anything.
- Vibration only on phones that support it, only for confirmation or error; feature-detect, fail silently.
- Formats, preloading, Web Audio, autoplay:
references/som.md.
6. Fixed rules
- Animate only
transformandopacity; never width, height, top, left or shadows in a loop. - Pause off screen (IntersectionObserver) and on
visibilitychange. prefers-reduced-motion: reduce: write motion insideno-preference; when reduced, instant change or short fade, no loops or autoplay. Check it in JS too for canvas, WebGL, Lottie, GSAP.- No WebGL or context lost: show a static image or the 2D version, never a blank box.
- Budgets: 16 ms per frame, no long tasks during interaction; motion weight about 50 KB gzipped for CSS/SVG work, about 200 KB for a Lottie/Rive player plus file; three.js only with a measured reason. Measure with
web-performance. - Moving over 5 s needs pause (WCAG 2.2.2); nothing flashes over 3 times a second.
7. Default style
Sober and neutral: short distances (8 to 24 px), opacity plus small translate or scale (0.96 to 1), the project's easing. No bounce, glow, gradient sweeps, confetti, typing effects, cursor trails or floating blobs unless the brief asks.
8. Before delivering
Open it in a browser (headless is fine):
- Screenshots at first paint, mid-animation and settled: nothing overlaps, clips or jumps.
- No console errors.
- Reduced motion emulated: content complete, nothing loops.
- Fallback shows without WebGL or JS.
- Console has no errors on the fallback path too (WebGL disabled).
- Canvas and 3D: if the reanimate skill is installed in the project, record our page with the virtual clock and GPU trace and check in numbers: draws while the scene is still (expected 0), draw calls per frame, and the animated values against the motion table. Pass the options directly in the command and fit curves only from the trigger.
- Sound off: every state still clear.
- 390 px wide; dark theme too only if the project has one or the brief asks (unsure: ask; never assume). Report what was checked and what was not.
References
references/versoes.md- three.js, scroll-driven CSS, View Transitions, GSAP, Lottie, Rive: versions, API and support, dated.references/feedback.md- micro-interaction and state patterns with durations.references/som.md- Web Audio, formats, preloading, autoplay, vibration.references/BIBLIOGRAPHY.md- sources.