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.

fix: the skill after the re-test: each part gets one plain way to use it (a close button, not also taps and swipes), decorative motion stops under reduced motion and stays still on touch, pointer-following effects keep their normal focus style, pointer handlers feed one frame loop, nothing in view after a load or a jump waits for a scroll, and answers to which-animation questions give real timings

matin752549007ff6
diff --git a/skills/animation-handbook/SKILL.md b/skills/animation-handbook/SKILL.md
index 42a335ac..6d783655 100644
--- a/skills/animation-handbook/SKILL.md
+++ b/skills/animation-handbook/SKILL.md
@@ -13,23 +13,23 @@ license: MIT
1. **Find the technique.** Search [references/catalog.md](references/catalog.md) for the effect the user describes and a synonym or two; read the whole file only when you cannot search, the user wants ideas or nothing fits (its By place index is at the end). Each line ends with its places, the parts of a page it suits (Buttons, Text, Images & cards, Backgrounds, Menus & forms, Loading & messages, Page intros, Scrolling, Page changes): match both what the user describes and where it goes. When two fit equally well, build one and mention the other; when none fits, say so and build what the user asked for with the rules below.
2. **Read its entry.** It is in the category file named after the folder in its address (references/04-micro-interactions.md for an address under animations/04-micro-interactions/), from the heading with the technique's name to the next heading. If the user's place is on its Avoid on list, prefer a better fit; if they asked for this one by name, build it and say what may suit better.
3. **Choose the settings.** Each setting lists its choices and what they do, with the demo's values. The choice in bold is where the demo starts, set to show the effect off in a small box: a starting point, not advice for every page. Take what the user asked for first ("a panel that slides in slowly from the left" picks the slow speed and the left side), then choose the rest for their page: its size, how many things move and what the effect is for. A speed that suits a small demo can feel rushed across a full-width hero, and a delay that reads well between many small tiles can vanish between a few large cards. Ask only when a choice changes the result a lot and nothing points either way.
-4. **Build what the user asked, no more and no less**, in their own stack, with their element in place of each [part in square brackets]. The prompt describes the whole technique as its demo shows it. Keep what it says about how each part looks, moves and behaves, accessibility and reduced motion included, but build only the parts the request needs: one confirmation message does not need a stack of them. "Match the settings listed below" means your choices from step 3.
+4. **Build what the user asked, no more and no less**, in their own stack, with their element in place of each [part in square brackets]. The prompt describes the whole technique as its demo shows it, with every option the demo offers. Take from it the look and the rules that make it look right, and build only the parts the request needs, each with one plain way to use it: a single confirmation needs one message with a close button, not a stack of messages that also close on a tap or a swipe. Every extra gesture and option is more code that can break. "Match the settings listed below" means your choices from step 3.
5. **Check it** against the rules below. Then tell the user, in a few lines, which technique you built, with its live demo address; the settings you chose, and why where they differ from the demo's; and the parts of the prompt you left out, which they can ask for.
-When the user only asks which animation to use, suggest one or two for each place they ask about, with their live demo addresses, and build once they choose. To improve an animation the project already has, find its closest technique the same way and change only what falls short of that prompt and the rules below, adding no part they did not ask for.
+When the user only asks which animation to use, answer for their page: suggest one or two for each place they ask about, and for each say in concrete terms what moves, for how long and after what delay, and what visitors who ask for reduced motion see, with its live demo address. Give real values, not the demo setting names, which mean nothing to someone who has not seen the demo, and build once they choose. To improve an animation the project already has, find its closest technique the same way and change only what falls short of that prompt and the rules below, adding no part they did not ask for.
## The rules for the user's page
Keep these even where a prompt does not say them, and follow them where a prompt differs: each prompt describes its technique as its demo shows it, in a box on a page about animation.
-- **Keep the page whole without the animation.** No entrance on the first screen waits for a scroll: it plays as the page loads, and only what starts below the first screen waits to scroll into view. An effect that moves only as far as the visitor scrolls, such as a scrub, simply starts from its first frame. Hide content for an entrance only from a script, early enough that nothing flickers, and create controls that work only with a script, such as an accordion's buttons, from that script, so the page still shows everything if the script fails. Where the browser cannot run an effect, such as one that needs WebGL, show a still version in its place rather than an error.
-- **Give keyboard users what mouse users get on what they can reach.** On a link, button or form control, or a card that holds one, an effect that shows on hover also shows on keyboard focus, and one that starts on a press also starts when the keyboard presses it, from the middle of the control. Do not make other content focusable for a decorative effect, and leave the arrow keys alone unless the element is a control that uses them, such as a slider, a carousel or a list you reorder: extra tab stops and captured keys cost keyboard users more than the effect gives them.
-- **Give touch what it needs.** When a hover reveals or does something people need, such as a menu, a tooltip, a hidden button or a pause to read moving text, a tap does it too, and a drag uses pointer events so that touch works. A purely decorative hover effect, such as a tilt or a glow, can stay still on touch screens.
-- **Follow reduced motion as the prompt says**: its version keeps what the technique needs. Where nothing says, show the end state or a short fade instead of the movement, and start loops paused.
+- **Keep the page whole without the animation.** Nothing in view waits for a scroll: whatever is on screen when the page loads, or after a jump to an anchor, plays its entrance right away, and anything the visitor can scroll to reaches its trigger, even at the very end of the page. An effect that moves only as far as the visitor scrolls, such as a scrub, simply starts from its first frame. Hide content for an entrance only from a script, early enough that nothing flickers, and create controls that work only with a script, such as an accordion's buttons, from that script, so the page still shows everything if the script fails. Where the browser cannot run an effect, such as one that needs WebGL, show a still version in its place rather than an error.
+- **Give keyboard users what mouse users get on what they can reach.** On a link, button or form control, or a card that holds one, a hover state such as a color, a lift or a revealed label also shows on keyboard focus, and an effect that starts on a press also starts when the keyboard presses it, from the middle of the control. An effect that follows the pointer has nothing to follow from the keyboard: leave the element its normal focus style. Do not make other content focusable for a decorative effect, and leave the arrow keys alone unless the element is a control that uses them, such as a slider, a carousel or a list you reorder: extra tab stops and captured keys cost keyboard users more than the effect gives them.
+- **Give touch what it needs.** When a hover reveals or does something people need, such as a menu, a tooltip, a hidden button or a pause to read moving text, a tap does it too, and a drag uses pointer events so that touch works. A purely decorative pointer effect, such as a tilt, a glow or a pull toward the pointer, stays still on touch screens, even where the prompt describes a touch version: a finger on a page is usually starting a scroll.
+- **Follow reduced motion.** When the device asks for it, decorative movement stops: show the end state or a short fade instead, start loops paused and keep pointer effects still. Where the movement itself tells the visitor something, such as a spinner, a progress bar or an effect tied to the scroll position, keep the calm version the prompt describes.
- **Move with transform and fade with opacity.** Never animate width, height, top, left or box-shadow, which make the browser lay out or repaint the page on every frame; only a box that pushes the content below as it opens or closes, such as an accordion's answer, may animate its height. Where the effect is something else, such as a clip, a line that draws itself, a color change or a blur-in, the prompt says how to keep it smooth.
- **Make soft shapes from gradients.** A glow or a blob of color that only needs soft edges gets them from a gradient that fades to transparent, not from a large blur filter, which costs the browser a lot on every frame while the shape moves; a gradient is drawn once and then only moved. Keep the blur where it is the effect, as in a blur-in, depth of field, frosted glass, a gooey merge or the glow of a moving border.
- **Stop what nobody can see.** A loop that keeps running, such as an ambient background, a canvas or a frame loop, pauses while it is scrolled out of view; a frame loop or timer also stops while the tab is hidden. A small CSS loop, such as a spinner, needs neither.
-- **Time a frame loop by the clock.** Each frame moves by the time since the last one, capped at about 50 ms, never by a fixed amount per frame, so it runs at the same speed on 30, 60 and 120 Hz screens.
+- **Run pointer and frame-by-frame effects from one frame loop.** Pointer and scroll handlers only store the latest position; a frame callback reads sizes once, writes the styles and stops when nothing moves. Each frame moves by the time since the last one, capped at about 50 ms, never by a fixed amount per frame, so it runs at the same speed on 30, 60 and 120 Hz screens.
- **Lighten heavy effects on phones**, up to 600 px wide or 500 px tall when held sideways: less blur, fewer particles, a simpler shader.
- **Keep touch targets at least 44×44 px on phones**, buttons and handles drawn inside the animation included, and **text meant to be read at least 4.5:1 against its background.**
- **Add no library the project does not already use.** Every prompt works with plain code; use GSAP, Framer Motion, Three.js or the like only where the project has it or the user asks for it.
diff --git a/tools/make-skill.mjs b/tools/make-skill.mjs
index 75c7a66a..fa70c1bc 100644
--- a/tools/make-skill.mjs
+++ b/tools/make-skill.mjs
@@ -310,23 +310,23 @@ const SKILL_BODY = ({ total, base, cats }) => `# Animation Handbook
1. **Find the technique.** Search [references/catalog.md](references/catalog.md) for the effect the user describes and a synonym or two; read the whole file only when you cannot search, the user wants ideas or nothing fits (its By place index is at the end). Each line ends with its places, the parts of a page it suits (${cats.places}): match both what the user describes and where it goes. When two fit equally well, build one and mention the other; when none fits, say so and build what the user asked for with the rules below.
2. **Read its entry.** It is in the category file named after the folder in its address (references/04-micro-interactions.md for an address under animations/04-micro-interactions/), from the heading with the technique's name to the next heading. If the user's place is on its Avoid on list, prefer a better fit; if they asked for this one by name, build it and say what may suit better.
3. **Choose the settings.** Each setting lists its choices and what they do, with the demo's values. The choice in bold is where the demo starts, set to show the effect off in a small box: a starting point, not advice for every page. Take what the user asked for first ("a panel that slides in slowly from the left" picks the slow speed and the left side), then choose the rest for their page: its size, how many things move and what the effect is for. A speed that suits a small demo can feel rushed across a full-width hero, and a delay that reads well between many small tiles can vanish between a few large cards. Ask only when a choice changes the result a lot and nothing points either way.
-4. **Build what the user asked, no more and no less**, in their own stack, with their element in place of each [part in square brackets]. The prompt describes the whole technique as its demo shows it. Keep what it says about how each part looks, moves and behaves, accessibility and reduced motion included, but build only the parts the request needs: one confirmation message does not need a stack of them. "Match the settings listed below" means your choices from step 3.
+4. **Build what the user asked, no more and no less**, in their own stack, with their element in place of each [part in square brackets]. The prompt describes the whole technique as its demo shows it, with every option the demo offers. Take from it the look and the rules that make it look right, and build only the parts the request needs, each with one plain way to use it: a single confirmation needs one message with a close button, not a stack of messages that also close on a tap or a swipe. Every extra gesture and option is more code that can break. "Match the settings listed below" means your choices from step 3.
5. **Check it** against the rules below. Then tell the user, in a few lines, which technique you built, with its live demo address; the settings you chose, and why where they differ from the demo's; and the parts of the prompt you left out, which they can ask for.
-When the user only asks which animation to use, suggest one or two for each place they ask about, with their live demo addresses, and build once they choose. To improve an animation the project already has, find its closest technique the same way and change only what falls short of that prompt and the rules below, adding no part they did not ask for.
+When the user only asks which animation to use, answer for their page: suggest one or two for each place they ask about, and for each say in concrete terms what moves, for how long and after what delay, and what visitors who ask for reduced motion see, with its live demo address. Give real values, not the demo setting names, which mean nothing to someone who has not seen the demo, and build once they choose. To improve an animation the project already has, find its closest technique the same way and change only what falls short of that prompt and the rules below, adding no part they did not ask for.
## The rules for the user's page
Keep these even where a prompt does not say them, and follow them where a prompt differs: each prompt describes its technique as its demo shows it, in a box on a page about animation.
-- **Keep the page whole without the animation.** No entrance on the first screen waits for a scroll: it plays as the page loads, and only what starts below the first screen waits to scroll into view. An effect that moves only as far as the visitor scrolls, such as a scrub, simply starts from its first frame. Hide content for an entrance only from a script, early enough that nothing flickers, and create controls that work only with a script, such as an accordion's buttons, from that script, so the page still shows everything if the script fails. Where the browser cannot run an effect, such as one that needs WebGL, show a still version in its place rather than an error.
-- **Give keyboard users what mouse users get on what they can reach.** On a link, button or form control, or a card that holds one, an effect that shows on hover also shows on keyboard focus, and one that starts on a press also starts when the keyboard presses it, from the middle of the control. Do not make other content focusable for a decorative effect, and leave the arrow keys alone unless the element is a control that uses them, such as a slider, a carousel or a list you reorder: extra tab stops and captured keys cost keyboard users more than the effect gives them.
-- **Give touch what it needs.** When a hover reveals or does something people need, such as a menu, a tooltip, a hidden button or a pause to read moving text, a tap does it too, and a drag uses pointer events so that touch works. A purely decorative hover effect, such as a tilt or a glow, can stay still on touch screens.
-- **Follow reduced motion as the prompt says**: its version keeps what the technique needs. Where nothing says, show the end state or a short fade instead of the movement, and start loops paused.
+- **Keep the page whole without the animation.** Nothing in view waits for a scroll: whatever is on screen when the page loads, or after a jump to an anchor, plays its entrance right away, and anything the visitor can scroll to reaches its trigger, even at the very end of the page. An effect that moves only as far as the visitor scrolls, such as a scrub, simply starts from its first frame. Hide content for an entrance only from a script, early enough that nothing flickers, and create controls that work only with a script, such as an accordion's buttons, from that script, so the page still shows everything if the script fails. Where the browser cannot run an effect, such as one that needs WebGL, show a still version in its place rather than an error.
+- **Give keyboard users what mouse users get on what they can reach.** On a link, button or form control, or a card that holds one, a hover state such as a color, a lift or a revealed label also shows on keyboard focus, and an effect that starts on a press also starts when the keyboard presses it, from the middle of the control. An effect that follows the pointer has nothing to follow from the keyboard: leave the element its normal focus style. Do not make other content focusable for a decorative effect, and leave the arrow keys alone unless the element is a control that uses them, such as a slider, a carousel or a list you reorder: extra tab stops and captured keys cost keyboard users more than the effect gives them.
+- **Give touch what it needs.** When a hover reveals or does something people need, such as a menu, a tooltip, a hidden button or a pause to read moving text, a tap does it too, and a drag uses pointer events so that touch works. A purely decorative pointer effect, such as a tilt, a glow or a pull toward the pointer, stays still on touch screens, even where the prompt describes a touch version: a finger on a page is usually starting a scroll.
+- **Follow reduced motion.** When the device asks for it, decorative movement stops: show the end state or a short fade instead, start loops paused and keep pointer effects still. Where the movement itself tells the visitor something, such as a spinner, a progress bar or an effect tied to the scroll position, keep the calm version the prompt describes.
- **Move with transform and fade with opacity.** Never animate width, height, top, left or box-shadow, which make the browser lay out or repaint the page on every frame; only a box that pushes the content below as it opens or closes, such as an accordion's answer, may animate its height. Where the effect is something else, such as a clip, a line that draws itself, a color change or a blur-in, the prompt says how to keep it smooth.
- **Make soft shapes from gradients.** A glow or a blob of color that only needs soft edges gets them from a gradient that fades to transparent, not from a large blur filter, which costs the browser a lot on every frame while the shape moves; a gradient is drawn once and then only moved. Keep the blur where it is the effect, as in a blur-in, depth of field, frosted glass, a gooey merge or the glow of a moving border.
- **Stop what nobody can see.** A loop that keeps running, such as an ambient background, a canvas or a frame loop, pauses while it is scrolled out of view; a frame loop or timer also stops while the tab is hidden. A small CSS loop, such as a spinner, needs neither.
-- **Time a frame loop by the clock.** Each frame moves by the time since the last one, capped at about 50 ms, never by a fixed amount per frame, so it runs at the same speed on 30, 60 and 120 Hz screens.
+- **Run pointer and frame-by-frame effects from one frame loop.** Pointer and scroll handlers only store the latest position; a frame callback reads sizes once, writes the styles and stops when nothing moves. Each frame moves by the time since the last one, capped at about 50 ms, never by a fixed amount per frame, so it runs at the same speed on 30, 60 and 120 Hz screens.
- **Lighten heavy effects on phones**, up to 600 px wide or 500 px tall when held sideways: less blur, fewer particles, a simpler shader.
- **Keep touch targets at least 44×44 px on phones**, buttons and handles drawn inside the animation included, and **text meant to be read at least 4.5:1 against its background.**
- **Add no library the project does not already use.** Every prompt works with plain code; use GSAP, Framer Motion, Three.js or the like only where the project has it or the user asks for it.