agentleFS
YehorSSYehorSS/storymotion/skills/web-motion/SKILL.md

web-motion

Skill1 starsChanged 13 days agoMITView on GitHub

Use when adding, designing, fixing or reviewing animation on a website or web app — scroll reveals, page and state transitions, hover and micro-interactions, text effects, parallax, pinned scroll scenes, loaders, GSAP/ScrollTrigger, View Transitions, CSS scroll-driven animations, or when motion feels janky, cheap, slow or "too much".

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not add a library for what CSS already does.

    line 24
  2. Very specific:

    Read layout once per frame in requestAnimationFrame.

    line 51
  3. Very specific:

    Use IntersectionObserver to start/stop work.

    line 52
  4. Distinctive:

    No layout shift: reserve space.

    line 54
  5. Distinctive:

    Check: DevTools Performance with CPU 4× slowdown — no long frames during scroll.

    line 55
  6. Distinctive:

    If the native scrollbar is hidden for style, provide a custom draggable, clickable progress gauge.

    line 64
  7. Distinctive:

    Write the motion intent next to each section: job, lead element, trigger, duration.

    line 70
  8. Very specific:

    Add motion from the recipes in references/recipes.md.

    line 72
  9. Distinctive:

    Verify: 375 px and 1440 px, reduced-motion on, CPU throttled, keyboard-only pass.

    line 73

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Web Motion

Motion is a sentence in the page's story, not decoration. Every animation must do one job: orient (where did this come from / go), focus (look here), confirm (your action worked), or narrate (time passes, a path is travelled, something transforms). No job → cut it.

1. Pick the lightest tool that does the job

NeedTool
Hover, focus, toggleCSS transition
Looping or one-shot entranceCSS @keyframes
Tied to scroll position (reveal, parallax, progress)CSS animation-timeline: view() / scroll(), JS --p variable as fallback
Element morphs between two states or pagesView Transitions API (document.startViewTransition, view-transition-name)
Sequenced timeline you control from JSWeb Animations API (el.animate)
Many synced tracks, pinning, scrubbed timelines, SVG morphGSAP + ScrollTrigger (free, now including plugins)
Real 3DThree.js — and still drive it from the same scroll progress

Do not add a library for what CSS already does. Do not add smooth-scroll hijacking (wheel interception) — native scroll stays native.

2. Timing and easing

KindDuration
Micro (press, toggle, hover)120–200 ms
UI (menu, modal, tab)200–350 ms
Entrance of a block450–700 ms
Hero / story moment800–1400 ms
  • Exit ≈ 70 % of entrance. Things leave faster than they arrive.
  • Enter: cubic-bezier(.16, 1, .3, 1) (expo-out). Exit: cubic-bezier(.7, 0, .84, 0). Move on screen: cubic-bezier(.65, 0, .35, 1).
  • linear only for scrubbed-by-scroll, progress bars and endless loops.
  • Distance: 16–32 px for reveals. Big travel reads as "PowerPoint".

3. Choreography

  • One lead per moment. It moves first and most; supporting elements follow quieter.
  • Stagger 40–80 ms; past ~6 items stagger groups, not items.
  • Direction carries meaning: keep one axis for "forward in the story" across the whole site.
  • Layer depth with speed: background slowest, text fastest (parallax 0.1–0.3 ratio, not more).
  • Rest is part of the rhythm: after a big scene, give a calm section with almost no motion.

4. Performance (non-negotiable)

  • Animate only transform, opacity; filter and clip-path sparingly. Never top/left/width/height/margin.
  • Read layout once per frame in requestAnimationFrame; scroll listeners { passive: true }.
  • Use IntersectionObserver to start/stop work; pause off-screen loops, canvases and videos.
  • will-change only on the element while it animates, never on dozens.
  • No layout shift: reserve space; animated elements start in their final box, offset by transform.
  • Check: DevTools Performance with CPU 4× slowdown — no long frames during scroll.

5. Accessibility (non-negotiable)

  • Content is visible without JS. Hide-for-reveal styles apply only under a .js class set by the script.
  • @media (prefers-reduced-motion: reduce): remove movement, parallax and scrubbing; keep instant or short opacity changes; show final numbers.
  • Nothing flashes more than 3 times per second.
  • Auto-playing motion longer than 5 s gets a pause control (WCAG 2.2.2).
  • Focus states are animated at most subtly and never hidden.
  • If the native scrollbar is hidden for style, provide a custom draggable, clickable progress gauge; wheel, keyboard and touch scrolling keep working.
  • A loading screen is allowed only as the story's first frame: built from the site name with the site's device, palette and type; once per session, click to skip, ≤ 2 s on top of real load (≤ 0.7 s or none for shops, docs and apps), never with reduced motion or without JS, and it hands off to the hero.
  • That gauge belongs to the site's story and style: same palette, type and metaphor as the narrative (clock for a day, km for a route, scale for a zoom, year for a before/after, numbered chapters for a case study; a quiet slim rail for shops and products). Never a generic grey bar on a styled site.

6. Workflow

  1. Write the motion intent next to each section: job, lead element, trigger, duration.
  2. Build without motion first; the page must read fine static.
  3. Add motion from the recipes in references/recipes.md; reuse tokens (--ease-out, --dur-*).
  4. Verify: 375 px and 1440 px, reduced-motion on, CPU throttled, keyboard-only pass.

See references/recipes.md for copy-ready code, and references/frameworks.md for React, Next.js and Astro. The runtime the recipes use is in assets/ (storymotion.css, storymotion.js): copy both into the project.

Page transitions between pages of one site follow the same rule as the loader and the gauge: they speak the site's story (dawn, trail, zoom, wipe, chapter turn), stay under ~0.9 s and are off with reduced motion.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.