Web motion (create and review animations)
Skill for demos and pages for the client's brand and for white-label brands. In the skills every acronym is explained the first time in each file (glossary at the end); in replies to the user, explain each acronym the first time it appears in the reply; in the copy of the page you build, the first time it appears. It merges the judgment of Emil Kowalski (animate, review-animations, emil-design-eng), LottieFiles' accessibility and state patterns (motion-design) and the anti-AI (artificial intelligence) rule from impeccable. Credits in THIRD-PARTY-NOTICES.md.
Two modes: CREATE (write the animation) and REVIEW (assess an existing one); if unclear, ask which in one line. Does not apply to videos, PowerPoint or native apps. To choose a whole component: if you have the pick-ui-library skill installed, use it first; otherwise, start from this skill's recipes.
Stance: decide, give the reason in one line and write the code. Don't present the user with a menu of easing or timing options. Sometimes the best answer is "this doesn't get animated": that is a success, not an evasion.
1. Brand variables (a single source)
If the page already has motion variables, use them; don't create a parallel system. Otherwise, paste this block (it is the institutional profile). Each white-label brand replaces only the three duration lines (--motion-fast, --motion-standard and --motion-focal) (references/brand-personality.md); the recipes use these variables, not loose milliseconds.
:root {
--motion-out: cubic-bezier(0.23, 1, 0.32, 1); /* enter and exit (strong deceleration curve) */
--motion-in-out: cubic-bezier(0.77, 0, 0.175, 1); /* move or transform something already on screen */
--motion-drawer: cubic-bezier(0.32, 0.72, 0, 1); /* drawers and bottom sheets, iPhone style */
--motion-fast: 150ms; /* press, tooltip */
--motion-standard: 200ms; /* menus, toasts, state changes */
--motion-focal: 550ms; /* only the single focal moment of the screen */
--motion-reduced: calc(var(--motion-standard) * 0.6); /* fade under reduced motion; derived, not edited */
}
Don't approximate values. Every curve and duration comes from this skill. No inventing cubic-bezier(0.4, 0, 0.2, 1) (Material Design's generic curve) because it "looks familiar".
2. Anti-AI rules
The generic "fade and rise" on everything is the signature of an AI-made page: as impeccable says, that, the lifting card, parallax or reveal-on-scroll are not a motion idea.
- At most one focal moment per screen (none is also fine), specific to the product: the approved loan figure assembling itself, the member card flipping over, the signature drawing itself. Not "everything rises on entry".
- Banned by default (only with a written reason): reveal-on-scroll on every section; cards that float with a shadow on hover; moving blobs or gradients in the background; decorative parallax; counters that run on every load; bouncing buttons; looping animations with no function. Never turn every section into a staggered list.
- Inventory when done: list each animation with its purpose in one word. If one has no purpose, it goes.
- Content visible without JavaScript (single rule for the three skills). The hidden initial state is enabled with a class (
.js-motion) that the script adds at the end of its initialization: that protects against earlier failures; for later failures (an observer or a function that never runs) leave a recovery path that removes.js-motion. Marketing copy never starts hidden or dimmed: partial opacity doesn't guarantee contrast (#141414at 40 % on white gives 2.58:1, below 4.5:1). Only an image may start hidden. - Less is more. When in doubt, less motion. If the brief describes an older or wary audience (for example, in financial services), they will probably prefer calm, clear pages: trust before fun.
3. CREATE mode
Go through the steps in order. Steps 1 and 2 are gates: if they don't pass, don't write animation.
Step 1. Should it animate?
| Frequency of use | Decision |
|---|---|
| More than 100 times a day (keyboard shortcuts, opening search) | Never animate. Stop here. |
| Tens of times a day (hover, navigating a list) | Barely perceptible, or nothing |
| Occasional (modal windows, drawers, toasts) | Standard animation |
| Rare or first time (welcome, approved application) | This is where delight lives |
Frequent keyboard shortcuts (first row) are not animated. A button activated with Enter or Space keeps the same response as with a click (opening a menu, showing a toast). Data the person reads or uses (an installment table, a balance chart) doesn't move for style.
Step 2. What for? (name it in one word)
Feedback (the interface heard the person) · Location (where something came from or went) · State (make a change readable) · Continuity (avoid an abrupt jump) · Explanation (show how it works; marketing or onboarding only) · Delight (only in rare or first-time use). If you can't name it, don't build it.
Step 3. Tool: the cheapest one that works
| Need | Tool |
|---|---|
| Hover, press, color, a state you change with a class | CSS transition (transition) |
| Something that appears when inserted | Class added with JavaScript on the next frame (works in Safari 15); @starting-style only as an enhancement (see compatibility) |
| Fixed motion that must stay smooth even while the page is loading | CSS animation (@keyframes) |
| Control from code without a library | element.animate() from the browser's Web Animations API |
| Complex springs, shared page transitions | GSAP (GreenSock Animation Platform, external library) only with the user's prior approval; see references/gsap.md |
Don't install or link libraries (not React, not GSAP, not Motion) for a fade. No external library servers without permission.
Step 4. Properties
- Only
transformandopacity(andclip-pathto reveal). Color on hover andfilteron 1 to 3 elements are also allowed, never in a loop. Neverwidth,margin,padding,top,left. - Accordion (the single property exception;
recipes.md,accessibility.mdandpage-reviewpoint here): by default native<details>, without animation. Exception: animated accordion of 250 ms or less, only in FAQs (frequently asked questions) and with the reason written in the plan; there, animatingheight(and onlyheight) measured with JavaScript is not a failure. - Never
scale(0). Start atscale(0.95)(between 0.9 and 0.97) plusopacity: 0. Nothing appears out of nowhere. - Origin at the trigger: menus and tooltips grow from the button that opens them (
transform-origin: top left, etc.). Modal windows stay centered. - Never opacity alone on an important change: pair it with a small transform (8 pixels or scale 0.97). Exception: fade only when there is no displacement (content replaced in the same place).
- Don't move children by changing a variable on the parent: put the
transformon the element itself. translateY(100%)in percent (relative to its own size) is better than fixed pixels.
Step 5. Easing and duration
| Situation | Easing |
|---|---|
| Enter or exit | var(--motion-out) |
| Move or transform on screen | var(--motion-in-out) |
| Drawer or bottom sheet | var(--motion-drawer) |
| Hover, color change | ease |
| Constant progress (bar, press and hold) | linear |
Never ease-in in interface: it starts slow right when the person is watching. Exits also use --motion-out, with a shorter duration.
| Element | Duration (milliseconds) |
|---|---|
| Pressing a button | 100–160 |
| Tooltips, small popovers | 125–200 |
| Dropdown menus, selects | 150–250 |
| Modal windows, drawers | 200–500 (modal 250, drawer up to 500) |
| Hover | enter under 100, exit 150–200 |
| View or page change | 300–500 |
| The single focal moment | 500–800 |
Interface stays under 300 milliseconds, except for these exceptions (single table; they apply equally in CREATE and REVIEW): drawers up to 500 · view or page change 300–500 · press-and-hold confirmation 2 s · focal moment 500–800 · accordion up to 250 (step 4) · close() fallback of 400 (not an animation). On mobile, multiply by 0.8 and use 1 or 2 properties. Stagger: 30–80 milliseconds between elements and total always under 500 milliseconds.
Bounce: almost never. Only a slight overshoot (5 % at most) on the success of an application.
Step 6. Interruption and exit
- Things triggered quickly (toasts, switches) use transitions, which resume from the current value;
@keyframesrestart from zero. - It leaves the way it came in and the exit lasts between 65 % and 75 % of the entry.
- Asymmetric timing where the person decides: press and hold lasts 2 seconds linear; releasing returns in
--motion-standard. For actions that can't be undone, the main path is a normal confirmation (click, tap or Enter); press and hold is only a pointer shortcut that completes on release (see references/recipes.md).
Step 7. Reduced motion and pointer (delivered with the animation, not later)
@media (hover: hover) and (pointer: fine) {
.button:hover { background: var(--color-hover); } /* on touch, tapping triggers false hovers */
}
@media (prefers-reduced-motion: reduce) {
.panel { transition: opacity var(--motion-reduced) ease; transform: none; } /* less and softer, not zero */
}
What is removed, what is kept and how long it lasts: single rule in references/accessibility.md ("Reduced motion"). In JavaScript: matchMedia('(prefers-reduced-motion: reduce)').matches.
What you deliver to the user
The code and, in at most 4 lines of plain language: what is animated and why; what was decided not to animate and why; the ingredients (tool, properties, easing, duration); and what to watch in the ver.mjs video (section 5) (if the result depends on feel, say so and don't guess values).
4. REVIEW mode
Stance: demanding. Flag by default; approval is earned. But read the mandatory rule first.
Mandatory rule: don't remove animations without asking
Proposing to delete or reduce is valid and often the best remedy, but never delete or remove an animation from a demo without asking the user first. Show what you propose to remove and why, wait for the answer, and compare before and after with ver.mjs (video and screenshots of both versions).
The ten standards
| # | Standard | Fails if… |
|---|---|---|
| 1 | Justified motion | It has no nameable purpose or only "looks nice" on something frequent |
| 2 | Matched to frequency | It animates keyboard shortcuts or actions used more than 100 times a day |
| 3 | Responsive easing | It uses ease-in or weak browser curves on something deliberate |
| 4 | Interface under 300 milliseconds | It is slower without a written reason |
| 5 | Origin and physics | It starts from scale(0) or a menu grows from the center |
| 6 | Interruptible | It uses @keyframes on toasts or switches |
| 7 | Cheap properties | It animates width, height, margin, top, left (except the accordion exception in step 4) |
| 8 | Accessibility | prefers-reduced-motion is missing, hover isn't guarded or the action requires holding a key |
| 9 | Asymmetry | Press-and-hold and release have the same timing |
| 10 | Cohesion and anti-AI | A personality different from the rest, or the generic pattern from section 2 |
Red flags (flag them as soon as you see them)
transition: all · scale(0) · opacity-only entries without a transform (except an in-place replacement) · ease-in · animation on keyboard shortcuts · more than 300 milliseconds without a reason · transform-origin: center on a menu · @keyframes on toasts · layout properties · a variable on the parent that moves the children · no reduced motion · unguarded hover · everything entering at once · reveal-on-scroll on every section · loops that keep running off-screen · content hidden if JavaScript fails · external library without approval.
Remedies, from cheapest to most expensive
Always first, accessibility (reduced motion, focus, keyboard): it is not postponed because of cost. Then: 1 Delete (with permission) → 2 Reduce (less time, less distance, fewer properties) → 3 Fix the easing → 4 Fix the origin → 5 Make it interruptible → 6 Move to transform/opacity → 7 Asymmetric timing → 8 Polish (blur to mask a crossfade, stagger) → 9 Cohesion.
Review format
- Table (mandatory), one row per finding, citing
file:line:
| Before | After | Why |
|---|---|---|
transition: all 300ms (demo.html:120) | transition: transform 200ms var(--motion-out) | all animates properties that shouldn't move |
- Verdict by impact, from highest to lowest (skip empty ones): accessibility → breaks the feel → unnecessary or should be reduced → performance → interruption and timing → origin and cohesion.
- Severity by impact, with the common scale of the
page-reviewskill ("Common severity" section; S1 to S4: blocker, major, minor, polish). A red flag from this skill doesn't raise the level by itself: it is classified by what it does to the person.
If the "feel" is doubtful: watch it in slow motion (duration ×2 to ×5), frame by frame in the browser's developer tools, on a real iPhone and again the next day.
5. Verify (both modes)
The tools bundled in the plugin need, once: Node 20+, npm install --prefix "${CLAUDE_PLUGIN_ROOT}/tools" and then npx --prefix "${CLAUDE_PLUGIN_ROOT}/tools" playwright-core install chromium firefox webkit; ver.mjs also needs ffmpeg and Python 3 with Pillow. Optional environment variables: BROWSER_PATH (Chromium-based browser to use instead of Playwright's), PYTHON, LOCALE. See the plugin README. Run them from the project root; results go to ./reports/.
- Before and after, look at the page with video and screenshots:
Output innode "${CLAUDE_PLUGIN_ROOT}/tools/ver-web/ver.mjs" <file.html> --no-menu node "${CLAUDE_PLUGIN_ROOT}/tools/ver-web/ver.mjs" <file.html> --no-menu --mobile # phone sizereports/ver-web/<name>[-mobile]-<date>/:summary.md(0 errors and the list of detected animations),screenshots/,video.mp4andsheets/(contact sheets with the second on each frame). - Before delivering, the reduced-motion, WebKit (Safari's engine) and keyboard test:
Report innode "${CLAUDE_PLUGIN_ROOT}/tools/qa/qa.mjs" <file.html> # --quick ≈ 1 min, without Lighthousereports/qa/<name>-<date>/report.md; it exits with code 1 if there are blocking failures. - Open (or reload) the page in the browser, give the user the path and offer to open it. If you are working as a subagent or in a test, don't open anything: leave the path in the report.
- Check the single Safari 15 matrix in references/compatibility.md (also linked from
art-directionandpage-review): everything must work on iOS (the iPhone's system) and Safari 15 or later.
6. On-demand references (load only the one you need)
| If you are going to… | Read |
|---|---|
| Build a component (button, menu, modal, drawer, toast, accordion, hold to confirm, tabs, reveal) | references/recipes.md |
| Animate success, error, validation, loading, focus or disabled in forms | references/states-and-feedback.md |
| Coordinate several elements or a focal moment | references/choreography.md |
| Loading skeletons, spinners, background motion | references/loading-and-ambient.md |
| Reduced motion, motion sickness, cognitive accessibility, mobile | references/accessibility.md |
Use @starting-style, linear(), view transitions or scroll-driven animation | references/compatibility.md |
Advanced clip-path, comparison slider, 3D (three dimensions), drag, performance, debugging | references/advanced-techniques.md |
| Adjust the tone per brand (institutional or friendly) | references/brand-personality.md |
| Someone asks for GSAP | references/gsap.md |
Tested example of four recipes: examples/demo.html.
Credits
Based on the work of Emil Kowalski and LottieFiles (MIT license, from the Massachusetts Institute of Technology) and impeccable by Paul Bakaus (Apache 2.0 license, open source). Full texts and changes in THIRD-PARTY-NOTICES.md.
Glossary
AI: artificial intelligence · API: application programming interface · CSS: Cascading Style Sheets · FAQ: frequently asked questions · GSAP: GreenSock Animation Platform, external animation library · HTML: HyperText Markup Language · iOS: the iPhone's system · S1–S4: common severity (blocker, major, minor, polish) · WCAG: Web Content Accessibility Guidelines · WebKit: Safari's engine.