Skip to content

176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.

35.7 KB
Raw Blame

Animation Handbook — Claude Code Instructions

Project purpose

A visual reference of web animation techniques. Each animation has its own folder with a self-contained HTML demo and a short README explaining the mechanics. Goal: help people understand what each animation type is by seeing it work and reading why it works. Each page also gives a plain-words prompt to paste into an AI assistant, so the site itself shows no code.

Hard rules

  • One animation = one folder under animations/<category>/<slug>/.
  • Each folder contains exactly: index.html, README.md, optionally preview.gif or preview.png.
  • No build step. No frameworks. No npm packages. Plain HTML + CSS + vanilla JS only. The animation itself (its markup, styles and script) lives in one HTML file; the page around it comes from two shared files (below).
  • No external dependencies in demos. No CDN GSAP, no jQuery. If a technique requires a library in production, mention that in the README but demonstrate the principle with vanilla code. A page loads only files from this repository: the two shared files, the site font, the site icons and its own README.md (fetched for What it is and Similar animations).
  • Keep demos under ~300 lines total. If it's longer, the explanation has failed.
  • Demos must work offline. Open the HTML in a browser, it runs (from a checkout of the repository, which holds the shared files the page links).
  • The site is the repository as it is. The root has .nojekyll, so GitHub Pages serves every file as it is, with no Jekyll pages built from the Markdown. GitHub Pages shows the root 404.html at every missing address, at any depth, so every address in it starts with /animation-handbook/.

File template for each animation

index.html structure

A page is one HTML file: the demo's own CSS in a <style> and JS in a <script>, inside the shared guided-steps page. Copy the closest page of the same kind and change the demo, its settings and its texts; the tests pin the Pause, Show me, Reset, Play and Back to top buttons character by character. Starting points: rotate-in (plays once), aurora (loop in CSS), starfield (loop in JavaScript), checkmark-draw (do it), snap-scrolling (scroll). The <head> has the title Name — Animation Handbook, the canonical URL, the favicons, and the Open Graph, Twitter and JSON-LD tags that repeat the name and description: copy them from a neighbor page and change them together.

Shared files. Every page links these after its own <style>, with one version N on every page. When either file changes, bump N on every page in the same change, or visitors keep a cached copy (a test fails if the pages differ). demo-page.css draws the page around the demo; demo-page.js runs it. The home page links demo-page.js too (its cards' Copy prompt builds the text with DemoPage.pageCopyText), with the same N.

<link rel="stylesheet" href="../../../assets/css/demo-page.css?v=N">
<script src="../../../assets/js/demo-page.js?v=N" defer></script>

The page (one centered column at every size; each part appears once):

  1. Top bar (nav.hb-bar): the home link, Previous / Next links to the neighbors in the category (rel="prev", rel="next"; the first and last page have one) and, last, the Star on GitHub link (a.hb-star).
  2. Header (header.hb-head): the category line NN.MM · Category (its place in the home page's All animations list), the <h1> and the one-line description (p.hb-lede) in plain words, ending "Best for …". That sentence is also the meta, Open Graph, Twitter and JSON-LD description, its card in the CATS array of the root index.html, and its line in both READMEs.
  3. 1 · Watch it (section.hb-watch): help line, stage (div.stage), player bar (div.hb-player); the step title and help line are written per page.
  4. 2 · Try it (section.hb-try): one to three settings, the rest under More options (details.hb-options). No settings: leave it out and number the steps 1 and 2.
  5. 3 · Copy the prompt (section.hb-prompt-step): prompt (p.hb-prompt), "Your settings" chips, Copy prompt; under the card, the star row (div.hb-star-row: a sentence and a Star on GitHub button). The star ask: after the first copy that works, the shared script marks the row is-asked and the button's edge and star turn gold, with one small pulse where motion is welcome; nothing scrolls or takes focus.
  6. About (section.hb-about): What it is (from the README) beside Good for (3–5 tags) and Avoid on (1–3 tags); then Similar animations (section.hb-related) and the footer, the same on every page (copy it from a neighbor):
<footer class="hb-foot"><span>Animation Handbook</span><a href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener">Source on GitHub</a><a href="#top">Back to top ↑</a></footer>

The Star link and the star row are the same on every page too: copy them from a neighbor (a test compares them).

The page owns the stage's width, border, corners and height (--hb-stage-h and --hb-stage-h-phone set another one); the demo owns overflow, background, alignment and perspective. hb-dots adds a dotted background to a plain dark stage; hb-grow lets a stage with visitor-editable text grow taller.

Mode switch (optional, on some pages). In the Watch step, between the heading and the stage, div.seg.hb-modes[data-hb-modes] holds three buttons with data-hb-mode: normal (pressed at first), inside (See inside) and compare. After the player bar, div.hb-mode-notes[aria-live=polite] holds exactly two hidden notes, direct children and one or two sentences each: p[data-hb-for="inside"] then p[data-hb-for="compare"] (the Compare note names the halves by their labels). A press marks the stage data-hb-mode, shows that mode's note and then sends hb:mode on document (detail.mode; again on a press of the mode already pressed, never at boot). The demo listens at the top level of its script, draws the mode at once and never scrolls, moves focus, presses a control, stops Play or changes Pause; every mode rule names .stage[data-hb-mode="inside"] or "compare" (Normal has none) and labels carry data-hb-caption. Ruling 1: after See inside or Compare the shared script presses Replay (once pages) or Show me (do pages) one time so the view is seen working; never under reduced motion, after Normal, or on a scroll or loop page. The mode is not a setting: it stays out of Your settings and the prompt. Copy fade-in-out (once), magnetic-button (do), parallax-scrolling (scroll) or marquee-ticker (loop).

Page kinds and their controls

The body declares one kind: <body class="hb" data-hb-kind="once|loop|do|scroll">. Every kind except loop also has data-hb-autoplay on the body, which runs the arrival. Player markers sit in the player bar, at most one of each, and the Loop and Slow motion switches start unchecked.

Kind Step 1 Player bar On arrival
once (plays once) Watch it Replay data-hb-replay, Loop switch data-hb-loop, Slow motion switch data-hb-slowmo Loop switches on after about 400 ms, so the demo plays and repeats
loop (moves by itself) Watch it Pause/Play data-hb-pause, Slow motion where it works, sometimes Reset data-hb-reset Nothing: it is already moving
do (the visitor acts) Hover it, Click it, Drag it, Scroll it or Press Tab Show me data-hb-demo, Reset where there is a state to reset, Slow motion where it works Show me is pressed once, unless the visitor got there first
scroll (driven by scroll position) Scroll it Play data-hb-autoscroll, Back to top data-hb-top Play is pressed once: the box scrolls to its end in about six seconds
  • data-hb-replay plays from the start (and keeps looping if Loop is on); data-hb-loop repeats while checked; data-hb-reset returns the demo to its start.
  • data-hb-slowmo: three times slower. With the value css the script slows every CSS animation and transition in the stage (later ones too); with no value the demo slows itself (its durations and timers, not the pauses).
  • data-hb-pause: with the value css the script holds the stage's CSS animations (class hb-paused); with no value the demo pauses itself. Either way hb:pause is sent on document (detail.paused). A demo with its own timers registers that listener at the top level of its script, not in a DOMContentLoaded handler: under reduced motion the event is sent once at boot, before DOMContentLoaded.
  • data-hb-demo: plays one example (two to four seconds) and returns to rest. A real press, key, wheel, touch or click in the stage is sent as hb:input on document (detail.type), so the page can stop a run. The press on arrival is skipped when the visitor has already acted (a real input or focus in the stage, or their own press of Show me), so a do-it page never moves focus into its stage while it loads: its own focus() counts as the visitor's.
  • data-hb-autoscroll: scrolls the scroller to its end at a steady speed (the whole box in about six seconds; it restarts from the top if already at the end, with CSS snapping off while it runs) until the visitor's own input in the stage stops it; data-hb-top stops it and jumps to the top; data-hb-scroller marks the scroller when it is not the stage.
  • data-hb-motion-note (scroll pages only): on the body, after data-hb-autoplay, one sentence with no full stop, for a page where reduced motion switches an effect off instead of only stopping its animation ("The layers stay still while the box scrolls"). The player bar shows it under reduced motion, followed by " because your device is set to reduce motion.", in place of the usual "The effects follow the scroll without animating".

A setting change replays a plays-once demo about 250 ms later; on other kinds it shows while the demo runs or at the next Show me, Play or interaction. Three owner rulings hold on every page: Pause freezes the stage at once (running transitions and timers stop mid-way); every setting and control visibly changes the stage; after Back to top or any jump, a scroll page shows the state for the new position at once.

Reduced motion

When the device asks for reduced motion, Loop and Slow motion are switched off and grayed out (they cannot be switched on) with a short note in the player bar, and loops start paused. Nothing is pressed for the visitor on arrival, except that a plays-once page plays its reduced version once so the stage is not empty. Replay, Pause/Play, Show me and Play still work when pressed. The demo itself shows the end state or a fade, not movement.

Try it

Show one to three settings (two or three is usual); the rest go under More options. Each has a plain label that says what changes ("How much it spins", never "Rotation (deg)" or a CSS name), the control and one hint line; every field has autocomplete="off". Prefer named choices ("Slow · Normal · Fast") to numbers, switches for on/off ("Grows from small") and a slider only when sliding is the point (it shows its value in plain words). Playback is not a setting, and Try it shows no status lines or code values.

Write each control one way. Choice buttons: div.seg[role=group] with aria-pressed, exactly one pressed. Switch: label.hb-switch-row around input.hb-switch[role=switch]. Colors: div.swatches buttons with the color name as aria-label. Text: label.hb-setting-name[for] with input.hb-text or textarea.hb-text. Copy these from a page that has one. No page has a slider (input[type=range] with an output.hb-value) or a menu (select.hb-select) yet: follow the controls table in docs/superpowers/specs/2026-09-27-demo-page-rollout-design.md. "Your settings" lists every control as label: value, except a hidden one or one with data-hb-skip (controls under a closed More options count); data-hb-label overrides a label. A setting whose default is lower on phones marks the choice button of its phone default with data-hb-phone; the page and the home page's Copy prompt both read it.

The copyable prompt

Written in the page (p.hb-prompt) in plain words: 60 to 130 words, never more, no code, no backticks. It starts with what to build and where ("Add a … to [the element you want to animate]"), with [square brackets] around what the reader fills in. It says what the viewer sees, the one or two rules that make it look right, how to keep it smooth, what to do under reduced motion and the touch equivalent of a hover or drag; it stays neutral about tools and never states a value that a setting controls. It ends with "Match the settings listed below." when the page has a Try it step, and a page without settings does not say it.

Colors and font

The demo's own styles use CSS variables for colors and default to a dark stage with light cards. Each page sets --ui-accent in :root to its category's color (copy it from another page in the category); the shared stylesheet uses it for step numbers, chips and pressed buttons. The site font is Schibsted Grotesk (assets/fonts/, loaded by demo-page.css); stage text uses it and a demo sets no other family. A typewriter (monospace) font is only for effects about typing.

README.md structure

Every animation README has exactly these sections:

  1. What it is — 2-3 sentence definition
  2. When to use it — bullets of real use cases
  3. How it works — the mechanic, with code snippet
  4. Key parameters — the values that matter (delay, threshold, etc.)
  5. Production notes — gotchas, library equivalents (GSAP, Framer Motion)
  6. See also — links to related animations in the handbook

The tests require What it is, When to use it, Key parameters and See also; the other two are required by convention. The page loads What it is and See also from the README; What it is and Key parameters contain no code. Each See also line is - [Title](../slug/) — one plain phrase, Title being the linked page's <h1>. Key parameters is a | Parameter | Default | Effect | table with one row per setting in Try it, named as on the page (a page without Try it lists the technique's own values), no empty cell, and each choice's demo value in plain words in Effect ("slow is 500ms, normal 300ms and fast 180ms"). How it works matches the demo's code. Opened from disk (file://), the pages still link to each other (the shared script points folder links at index.html), but What it is and Similar animations need a server: a page shows a README link in place of What it is and hides Similar animations.

Taxonomy (do not invent new top-level categories without asking)

  1. Scroll-Based — scroll-driven techniques (folder: 01-scroll-based)
  2. Entrance & Exit — element enter, exit, reveal animations (folder: 02-entrance-and-exit)
  3. Page Transitions — full-page/route transitions (folder: 03-page-transitions)
  4. Micro-Interactions — hover, click, focus, loading, UI feedback (folder: 04-micro-interactions)
  5. Text & Typography — text-specific animations (folder: 05-text-typography)
  6. 3D & Advanced — WebGL, shaders, particles, 3D transforms (folder: 06-3d-advanced)
  7. Ambient & Background — passive looping effects (folder: 07-ambient-background)

The home page calls them groups and shows the seven as chips under Good places to start (All, then one chip a group, written in the page's markup in CATS order; a test compares them). A chip shows its group's cards, and the address is ?cat= and the group's name as a slug (?cat=micro-interactions).

Distinction: technique vs tool

This handbook catalogs techniques, not libraries. GSAP, Framer Motion, Lottie, Three.js are tools that implement techniques. They get mentioned inside an entry's "Production notes" section, never as their own entry.

Writing style

  • Prose explanations, not bullet-soup.
  • Show, then explain. The demo is the main artifact; words support it.
  • Avoid hype. No "stunning", "amazing", "powerful". Describe what it does.
  • Code comments only when the code isn't self-explanatory.
  • On the pages, write for someone new to animation: plain labels, hints, descriptions and prompts, with no code and no CSS property names.
  • Use American spelling (color, behavior, center, neighbor, gray).

When asked to add a new animation

  1. Confirm the category, the slug and the page kind (plays once, loops, do it, scroll).
  2. Create the folder under animations/<category>/<slug>/.
  3. Create index.html by copying the closest page of the same kind and following the template above.
  4. Create README.md with all 6 required sections.
  5. Link it in: the page before it gets a Next link to it and the page after it a Previous link to it, each replacing its old one, if any (a page never has two rel="next" or two rel="prev" links); the new page links back to both. A new first or last page has one neighbor, so one link. The link text and aria-label use the linked page's <h1>; copy the markup from a neighbor. Adding a page mid-category renumbers the NN.MM category line of every later page.
  6. Update the root index.html index page to link to it: add a card to the category's entries in the CATS array (slug, name, the page's one-line description); sitemap.xml and the home page's plain list of links (in its <noscript>, for visitors and crawlers without JavaScript) are written from CATS (step 8). Give it one or more places in PLACES (right after PV in the same script): btn Buttons, text Text, imgcard Images & cards, bg Backgrounds, menu Menus & forms, load Loading & messages, intro Page intros, scroll Scrolling, page Page changes; the first one labels its card. Keep PLACES in the same order as CATS (a test checks it). Give the card its own preview too: its key in PV, its CSS at the end of the category's /* ── bespoke: … ── */ block (light: CSS with transform and opacity, no new canvas engine, inside its 16:10 stage), its markup as a case in pvMarkup(), and a STILL point when the middle of its loop is not a clear frame (reduced motion holds every preview there). Without one the card shows the category's generic picture. Give it its finder answers in FIND too, a row right after PLACES in CATS order: 'slug':['what','when','how'], each a space-separated list of answer keys from FIND_Q, the main one first. What takes 1–3 (the main one is what the demo moves), When 1–3 (every trigger the effect is commonly used with, the most common first) and How 1–4 (the most visible movement first, then the ones a visitor might name instead). Tag what a visitor sees and would say, not how it is built; a page transition answers newpage, a loop page loop, a Scroll-Based or scroll page scroll. tests/finder.test.js checks the row and runs the finder's test set. Give it extra search words in WORDS too, a row right after FIND in CATS order, when a visitor would type a word that its name, places and description do not say: another everyday name for the effect (lightbox, snackbar), the part of a page it is (navbar, tabs), a code library people name the technique by (aos) or a common misspelling: 'slug':'word word', lowercase single words. Only words that truly mean the card, never the name of a company or of something it sells; a card that needs none is left out. An extra word counts only when all of it is typed, or all but its ending, so it cannot take over a search for a shorter word. A word used by many cards belongs in a SAME group instead (words that mean the same, as word starts). tests/pages.test.js checks the rows; when the new card is one of the things that test lists as finding nothing (dock, chart, checkbox), take it out there.
  7. Update animations/<category>/README.md (its list of pages, and any other table there that names pages, such as 07's Implementation summary) and the root README.md catalog (the card's name, linked to its live page https://matinmonshizadeh.github.io/animation-handbook/animations/<category>/<slug>/, and its one-line description, in home page order); the page's own README has [Live demo](<that address>) on the line under its title. Update the technique count wherever it is written: the root README.md (the total and the category's count), the home page (its title and meta tags too), .github/ISSUE_TEMPLATE/config.yml and 404.html (its Browse all link); the tests compare each with CATS. The picture og-image.png shows the count in the home page's pill: with the repo served, run node tools/make-social-image.mjs --base http://127.0.0.1:<port>, which draws it again from the home page. The home check needs no edit: it reads its totals from CATS and PLACES.
  8. Run node tools/update-sitemap.mjs: it writes every card into sitemap.xml, dated by the last commit to its folder (today for a folder with changes not yet committed), and into the home page's plain list of links (between the two plain-links comment lines; a test compares the list with CATS). It writes llms.txt too: every card under its group, for AI tools that read the site without running its scripts. Run the tests and the page check on the new folder and on every page you edited. Run the home page check (home) too: the new card's Copy prompt is compared there.

Changing anything llms.txt or the home page's plain list repeats (a card's name, line or order in CATS, or the Famous effects page's description) also means running node tools/update-sitemap.mjs again: the tests fail until then. Changing a preview that the Famous effects page shows (its key in PV, its case in pvMarkup(), its rules or keyframes, its STILL point) or that page's cards means running node tools/make-famous.mjs again: the famous test (tests/famous.test.js) fails until then.

Famous effects page

famous/index.html shows effects people admire on well-known websites as a gallery: one tile per effect, and a press opens the whole entry in a pop-up with our version, a working demo built from the entry's own prompt (docs/superpowers/specs/2026-10-13-famous-effects-design.md, then 2026-10-22-famous-gallery-popup-design.md, which wins). It is one page in the home page's look and colors (a test compares them); it links neither shared file, and its own script copies, shows the message, falls back to the copy keys and shortens prompts on phones in the animation pages' words. Its two marked blocks, the previews' CSS and the PREVIEWS object, are written by node tools/make-famous.mjs from the home page, never by hand.

The gallery (ul.fx-grid) holds one tile per entry in page order, then the "Seen one we should add?" tile. A tile has a 16:10 picture of our version (a light CSS loop with transform and opacity, playing only in view, a still frame under reduced motion) tagged "Our version" and with what starts it; the entry's title as a link to #<id> stretched over the tile; one line in our words (at most 90 characters); "Seen on ↗" (the entry's address, in a new tab) and "N animations". The pop-up is one native <dialog class="fx-dlg">: a tile press, or arriving at famous/#<id>, moves that entry into it (and back to its place on close), focuses its heading, loads its version and pushes #<id> (Back closes it; Previous and Next replace it). Its bar holds Previous, Next, Close and a short not-connected note. Without JavaScript the entries read as a plain list under the gallery (div.fx-list).

An entry is a section.fx with an id (site-what, as stripe-ribbon), data-fx-site (the site's name) and data-fx-start (loop, load, scroll, hover or press), then, in order: "Seen on" and the site's address as a link (https://, in a new tab, its text the address without https:// or www., its name ending "(opens in a new tab)") and the year in a <time> whose datetime is the day it was checked; the plain title as an h2 with tabindex="-1"; the chip row (what starts it, "Made from N animations"); the Our version block (div.fx-version: the stage with an iframe titled "Our version: " whose <code>data-src</code> is <code>versions/<id>.html</code>, the "Our version" label, and the player bar with <code>data-fx-cmd</code> buttons: Pause for loop, Replay for load, Show me for hover and press, Play and Back to top for scroll); "What you see" and what you see, 25 to 70 words; "Good to know" (<code>dl.fx-know</code>: Starts, On phones and Reduced motion, each a line from its prompt); "Build it with these animations" and one to three cards (the card's <code>CATS</code> name and line, its page's link and <code>data-slug</code>, and on its preview a label of one to three words saying what that animation makes here; two different animations on the page never share a preview); "A prompt to build something similar" and Copy prompt, which names its entry; "Watch the real one on <host> ↗". Copy a neighbor entry's markup and tile, and count it in the pill.</p> <p><strong>Our version</strong> (<code>famous/versions/<id>.html</code>) is a self-contained page of under about 300 lines, loaded in the stage only while its pop-up is open: <code>noindex</code>, only the site font loaded, and the demo rules of this file (fluid down to 280px, 44px targets, keyboard and touch, transform and opacity, frame loops by elapsed time, a lighter version when the parent page is a phone, reduced motion as its prompt says, <code>overscroll-behavior: contain</code> on its own scroller and nowhere else; a version whose prompt makes a finger drag over it drive the effect keeps that finger with <code>touch-action: none</code> and says so with <code>data-fx-touch="drag"</code> on its html, and every other version leaves the wheel and a finger free to scroll the pop-up). It does everything its prompt says and moves as close to the real effect as it can (the same steps, order, timing and distances), while all you see in it is ours: shapes, pictures, words and the handbook palette. It obeys only its parent's messages <code>{fx: 'pause' | 'play' | 'replay' | 'show' | 'top'}</code> and runs its arrival once on load (a loop runs, a load plays, Show me or Play is pressed once), never under reduced motion.</p> <p><strong>Its prompt</strong> follows "The copyable prompt" above, but the page has no settings, so it never ends "Match the settings listed below.": 60 to 130 words, starting "Add a … to [what the reader fills in]" with each bracketed part in a <code><mark></code>; it asks for the reader's own colors and content, never a copy of the site, says what happens under reduced motion and, when the effect starts on hover or press, what touch does. It never names a site of the page, by name or by address.</p> <p><strong>The legal checklist</strong> binds every entry (rules to follow, not legal advice):</p> <ul> <li>The title, what you see and the prompt are in our own words: no sentence, feature name or slogan from the site.</li> <li>The site is named in plain text, in the page's own font and colors (no logo, icon, brand color or typeface), and linked to its public page.</li> <li>Shown only with the handbook's own demos and previews; nothing from the site in the repository or in posts about the page: no code, screenshots, videos, pictures, icons or logos. Our versions copy how an effect moves, never how the site looks: no brand colors, product shapes, typefaces or words of the site.</li> <li>The line saying the handbook is not connected to these sites stays on the page, above the gallery, on the first screen, and its short form stays in the pop-up's bar.</li> <li>Nothing implies approval or partnership: no "official", "approved", "partner", "as used by"; no company name in the page's title, description or social card; the prompt names no company.</li> <li>"Seen on <site> in <year>", with the day checked in <code>datetime</code>.</li> <li>A site owner who asks for an entry to be changed or removed gets it done promptly (the Suggest link is the contact).</li> </ul> <p><strong>Adding or checking an entry again.</strong> Watch the effect on the live site, logged out, and write what you see in your own words; add the entry, its tile, its version and its count in the pill; run <code>node tools/make-famous.mjs</code>, <code>node tools/update-sitemap.mjs</code>, the tests and the page check's <code>famous</code> target. Every entry is checked again on its site before each release of the page and at least once a year: an effect that changed is described again from what shows now (its prompt, Good to know, tile line and version with it), one that has gone stays true as a past sighting or is replaced, and its <code>datetime</code> takes the day of the check (and <code>RECHECKED</code> in <code>tests/famous.test.js</code> with it).</p> <h2>When asked to refactor</h2> <ul> <li>Preserve every demo's behavior exactly. Visual parity matters more than code elegance.</li> <li>Never combine multiple animations into one file.</li> <li>Run the tests and the page check afterwards.</li> </ul> <h2>Tests and the page check</h2> <p>Run both before calling a page done. They need Node 22 or later (the <code>--test</code> glob, the page check's <code>WebSocket</code>).</p> <ul> <li><strong>Tests:</strong> <code>node --test "tests/*.test.js"</code> from the repo root (nothing to install) checks every page and its README, the shared stylesheet, the home page and the Famous effects page. GitHub Actions runs them too, on every push to <code>main</code> and every pull request (<code>.github/workflows/tests.yml</code>).</li> <li><strong>Page check:</strong> serve the repo root (<code>python -m http.server <port> --bind 127.0.0.1</code>), then run <code>node tools/check-pages.mjs --base http://127.0.0.1:<port> <page or category folder></code>. It drives Chrome (set <code>CHROME</code> to its path if it is not in the default Windows folder) and loads each page at six setups (1280×800, 1366×657, 768×1024, 375×812, 375×812 with reduced motion, 320×640), printing <code>ok</code> or <code>FAIL</code> for each: a passing page gives <strong>six <code>ok</code> lines</strong>, a failure exits with 1. It fails a page on console errors and warnings (a control with no label or value is left out and the console warns), overflow, small touch targets on phones, a stage or player bar below a laptop's first screen and chips that do not match the settings, and it works the controls of the page's kind. It skips controls inside <code>.stage</code> when it measures touch targets, so check buttons and handles a demo draws there by hand.</li> <li><strong>Home page:</strong> <code>node tools/check-pages.mjs --base http://127.0.0.1:<port> home</code> checks the home page at the same six setups (six <code>ok</code> lines). Its desktop run also tries the tiles, the group chips, the search and Show all, and compares Copy prompt on the home page with every page's own; its phone run tries a tile, the slim bar and a group chip, and its reduced-motion run checks that nothing moves. Every setup also opens the finder (<code>?view=find</code>): its desktop run works the answers, See N matches, Start over, Show all, the Not here? link and the ways in, and its reduced-motion run checks that every How picture holds a still. Run it after changing any page's settings or prompt.</li> <li><strong>Famous effects:</strong> <code>node tools/check-pages.mjs --base http://127.0.0.1:<port> famous</code> checks <code>famous/</code> at the same six setups (six <code>ok</code> lines): the first screen, overflow and touch targets, and one pop-up opened by the keyboard (focus, address, fit, its note, its version, and Escape back to its tile); its desktop run opens every entry, presses each version's player buttons, watches the tile and card previews, presses each Copy prompt (twice more with the clipboard refused or missing) and tries Previous, Next, Close, Back and arriving at <code>#<id></code>; its reduced-motion run opens every pop-up and checks that nothing moves, that every preview holds a still frame that shows something and that Copy prompt's message does not slide. Run it after changing that page, its cards, a version or a preview it shows.</li> </ul> <h2>Out of scope</h2> <ul> <li>Backend code, databases, APIs.</li> <li>Anything requiring a server beyond a static file server.</li> <li>React/Vue/Svelte components — this is framework-agnostic by design.</li> </ul> <h2>Responsiveness requirements (mandatory)</h2> <p>Every demo must be fully responsive across mobile, tablet, and desktop. This is non-negotiable — a demo that breaks on phones fails the quality bar.</p> <h3>Breakpoints</h3> <ul> <li><strong>Mobile:</strong> ≤ 600px viewport width</li> <li><strong>Tablet:</strong> 601px – 1024px</li> <li><strong>Desktop:</strong> ≥ 1025px</li> </ul> <h3>Layout rules</h3> <ul> <li>Use CSS Grid or Flexbox for all layouts. No fixed pixel widths on containers — always use <code>%</code>, <code>fr</code>, <code>minmax()</code>, or <code>clamp()</code>.</li> <li>The page is one column at every size: the player bar right below the stage, the settings below it, nothing beside the stage. Settings go two per row from 760px wide, one below.</li> <li>The animation stage itself must scale fluidly. The shared stylesheet sets its height (300–440px, about the screen height minus 420px; 260px at the least on short laptop windows; 300px on phones), so build what is inside it with <code>%</code>, <code>clamp()</code> or <code>aspect-ratio</code>, not at a fixed size.</li> <li>Typography must scale: use <code>clamp()</code> for headings (e.g. <code>font-size: clamp(18px, 4vw, 28px)</code>).</li> <li>Padding and gaps should shrink on mobile — use <code>clamp()</code> or media queries to prevent cramped layouts.</li> <li>Text is at least 4.5:1 against its background.</li> </ul> <h3>Touch and input rules</h3> <ul> <li>All interactive controls (sliders, buttons, toggles) must be at least <strong>44×44px</strong> on mobile (Apple/WCAG touch target minimum). The shared stylesheet does this for the page's own controls; buttons and handles a demo draws inside the stage need it too.</li> <li>Replace hover-only interactions with tap-equivalent behavior on touch devices. Use <code>@media (hover: hover)</code> to gate hover effects.</li> <li>An effect that follows the pointer or appears on hover also works from the keyboard: focus shows it and the arrow keys move it. An effect that starts on a press also starts on Enter or Space, from the control's center. A script never moves focus into the stage.</li> <li>Scroll-driven demos must work with touch scroll, not just mouse wheel.</li> <li>Drag interactions must use Pointer Events (<code>pointerdown</code> / <code>pointermove</code> / <code>pointerup</code>), not mouse events, so they work on touch.</li> </ul> <h3>Performance on mobile</h3> <ul> <li>Demos must run at 60fps on a mid-range mobile device. If an effect is too heavy (heavy blur, many particles, complex shaders), provide a reduced-quality fallback on mobile: a phone is <code>(max-width:600px),(max-height:500px)</code>, so a phone held sideways counts.</li> <li>Use <code>transform</code> and <code>opacity</code> for animations — never animate <code>width</code>, <code>height</code>, <code>top</code>, <code>left</code>, or <code>box-shadow</code> directly.</li> <li>A JavaScript frame loop moves by elapsed time, never by a fixed amount per frame, or it runs twice as fast on a 120 Hz screen and half as fast on a 30 Hz phone (the page check runs at 60 Hz and cannot see it). With <code>FRAME = 1000 / 60</code> and <code>dt = lastT === null ? 0 : Math.min(ts - lastT, 50)</code> (a start, Play and <code>visibilitychange</code> set <code>lastT = null</code>; an easing that restarts on input may count its first frame as one <code>FRAME</code>), multiply each step by <code>dt / FRAME</code> (and by 1/3 in Slow motion) and turn an easing share <code>k</code> into <code>1 - Math.pow(1 - k, dt / FRAME)</code>. Physics that needs equal steps (Verlet, a spring) takes fixed steps from an accumulator. A trail washes once for every 60th of a second at its 60 Hz opacity, and a frame with no wash due draws nothing. Copy the loop of Synthwave Grid, Starfield (trails) or Cloth Simulation (fixed steps).</li> <li>Respect <code>@media (prefers-reduced-motion: reduce)</code> — disable or simplify animations for users who request it (see Reduced motion above).</li> </ul> <h3>Testing checklist (Claude Code should self-verify before declaring done)</h3> <p>Before finishing any animation, mentally walk through:</p> <ul> <li><input disabled="" type="checkbox"> Does the layout reflow cleanly at 375px width (iPhone SE)?</li> <li><input disabled="" type="checkbox"> Are all touch targets ≥ 44px?</li> <li><input disabled="" type="checkbox"> Does it work with touch scroll / drag, not just mouse?</li> <li><input disabled="" type="checkbox"> Does a pointer, hover or press effect work from the keyboard too?</li> <li><input disabled="" type="checkbox"> Does text remain readable (no overlap, no overflow) at every size?</li> <li><input disabled="" type="checkbox"> Is text at least 4.5:1 against its background?</li> <li><input disabled="" type="checkbox"> Is the player bar right below the stage, with Try it under it and nothing beside the stage on mobile?</li> <li><input disabled="" type="checkbox"> Does it respect prefers-reduced-motion?</li> <li><input disabled="" type="checkbox"> Do the tests and the page check pass (six <code>ok</code> lines per page)?</li> </ul> <p>If any answer is no, the demo is not complete.</p>