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.

chore: Task 3 leftovers - reword the markdown helper comment, drop the orphaned tools/migrations data, give the sample page the site icon

matin153d8316f333
diff --git a/samples/home-redesign.html b/samples/home-redesign.html
index e3b45eab..c68267e8 100644
--- a/samples/home-redesign.html
+++ b/samples/home-redesign.html
@@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Animation Handbook — redesign sample</title>
+<link rel="icon" type="image/svg+xml" href="../favicon.svg">
<script>document.documentElement.classList.add('js')</script>
<style>
@font-face{font-family:'Bricolage';src:url('fonts/brico-400.woff2') format('woff2');font-weight:400;font-display:swap}
diff --git a/tests/helpers/markdown.js b/tests/helpers/markdown.js
index a380336c..2fac8dce 100644
--- a/tests/helpers/markdown.js
+++ b/tests/helpers/markdown.js
@@ -1,4 +1,4 @@
-/* Markdown parsing helpers for tests. Extracted from assets/js/handbook.js. */
+/* Markdown helpers for the page tests: a README split into its sections, and its Key parameters table read as rows. */
'use strict';
function escapeHtml(s) {
diff --git a/tools/migrations/02-entrance-and-exit.json b/tools/migrations/02-entrance-and-exit.json
deleted file mode 100644
index bbe07946..00000000
--- a/tools/migrations/02-entrance-and-exit.json
+++ /dev/null
@@ -1,189 +0,0 @@
-{
- "category": "02-entrance-and-exit",
- "name": "Entrance & Exit",
- "demos": [
- {
- "slug": "bounce-in",
- "number": "02.12",
- "prev": { "href": "../flip-in/", "name": "Flip In" },
- "next": { "href": "../rotate-in/", "name": "Rotate In" },
- "autoplay": true,
- "attrs": { "btn-in": "data-hb-replay", "btn-rst": "data-hb-reset", "loop-tog": "data-hb-skip data-hb-loop" },
- "edits": [
- [" <div class=\"div\"></div>\n <div class=\"lbl\">Live keyframes</div>\n <div class=\"kf-block\" id=\"kf-display\">", " <div class=\"kf-block\" id=\"kf-display\" hidden>"]
- ],
- "lede": "Overshoots its final size and position, then springs back to rest.",
- "prompt": "Add a bounce-in entrance to [the element you want to animate]. When it appears, it should start small and a little below its final spot, grow slightly past full size, dip just under it, then settle, as if it landed with a small spring. Each bounce is smaller than the one before, like energy running out, and one bounce usually looks best. Unless the settings turn it off, fade it in at the same time. Animate only its position, size and opacity so it stays smooth. If the visitor has reduced motion turned on, show the element without the bounce. Match the settings listed below."
- },
- {
- "slug": "fade-in-out",
- "number": "02.01",
- "prev": null,
- "next": { "href": "../slide-in/", "name": "Slide In" },
- "autoplay": true,
- "attrs": { "btn-in": "data-hb-replay", "btn-rst": "data-hb-reset", "loop-tog": "data-hb-skip data-hb-loop", "hold-sl": "data-hb-skip" },
- "edits": [],
- "lede": "Goes from invisible to visible to enter, and back again to leave.",
- "prompt": "Add a fade-in and fade-out to [the element you want to show and hide]. When it appears, it should go smoothly from fully transparent to fully visible, and when it leaves it should do the reverse. Nothing moves or changes size; only the opacity changes, which keeps the animation smooth because the browser doesn't need to repaint. Reserve the element's space while it is invisible so the layout doesn't jump, and make sure a hidden element can't be clicked or focused. If the visitor has reduced motion turned on, show and hide it instantly or with a very short fade. Match the settings listed below."
- },
- {
- "slug": "slide-in",
- "number": "02.02",
- "prev": { "href": "../fade-in-out/", "name": "Fade In / Fade Out" },
- "next": { "href": "../slide-up-reveal/", "name": "Slide Up Reveal" },
- "autoplay": true,
- "attrs": { "btn-in": "data-hb-replay", "btn-rst": "data-hb-reset", "loop-tog": "data-hb-skip data-hb-loop" },
- "edits": [
- ["<button data-dir=\"top\" class=\"on\">↑ Top</button>", "<button data-dir=\"top\" class=\"on\" aria-label=\"From the top\">↑ Top</button>"],
- ["<button data-dir=\"bottom\">↓ Bot</button>", "<button data-dir=\"bottom\" aria-label=\"From the bottom\">↓ Bot</button>"],
- ["<button data-dir=\"left\">← Left</button>", "<button data-dir=\"left\" aria-label=\"From the left\">← Left</button>"],
- ["<button data-dir=\"right\">→ Right</button>", "<button data-dir=\"right\" aria-label=\"From the right\">→ Right</button>"]
- ],
- "lede": "Travels into place from one edge, with or without a fade.",
- "prompt": "Add a slide-in entrance to [the element you want to animate]. It should start a short distance away from its final position, on the side given in the settings, and travel into place, slowing down as it arrives so it feels like it came from somewhere. Unless the settings turn it off, fade it in during the slide too, because a slide on its own tends to look mechanical. Give longer distances a little more time so the speed still feels natural. Move it without changing the layout, so nothing around it shifts. If the visitor has reduced motion turned on, skip the travel and simply show it. Match the settings listed below."
- },
- {
- "slug": "slide-up-reveal",
- "number": "02.03",
- "prev": { "href": "../slide-in/", "name": "Slide In" },
- "next": { "href": "../scale-in/", "name": "Scale In / Zoom In" },
- "autoplay": true,
- "attrs": { "btn-in": "data-hb-replay", "btn-rst": "data-hb-reset", "loop-tog": "data-hb-skip data-hb-loop", "method-seg": "data-hb-skip", "multi-tog": "data-hb-skip" },
- "edits": [
- ["<div class=\"kv\"><span>Technique</span><span class=\"v\" id=\"tech-val\">", "<div class=\"kv\" hidden><span>Technique</span><span class=\"v\" id=\"tech-val\">"],
- ["<button data-m=\"translatey\" class=\"on\">translateY</button>", "<button data-m=\"translatey\" class=\"on\">Move</button>"],
- ["<button data-m=\"clippath\">clip-path</button>", "<button data-m=\"clippath\">Clip</button>"]
- ],
- "lede": "Text rises into view from behind an invisible edge.",
- "prompt": "Add a slide-up reveal to [your headline or lines of text]. Each line should rise into place from just below an invisible edge, as if it is coming up from behind a solid surface: the text moves, but anything below the line stays hidden, so viewers only see it arrive. When there are several lines, start each one a moment after the line above it so they cascade. The text must stay readable by screen readers and search engines the whole time. If the visitor has reduced motion turned on, show the text immediately without the rise. Match the settings listed below."
- },
- {
- "slug": "scale-in",
- "number": "02.04",
- "prev": { "href": "../slide-up-reveal/", "name": "Slide Up Reveal" },
- "next": { "href": "../clip-path-reveal/", "name": "Clip-Path Reveal" },
- "autoplay": true,
- "attrs": { "btn-in": "data-hb-replay", "btn-rst": "data-hb-reset", "loop-tog": "data-hb-skip data-hb-loop" },
- "edits": [
- ["<button data-o=\"top left\">Top-L</button>", "<button data-o=\"top left\" aria-label=\"Top left\">Top-L</button>"],
- ["<button data-o=\"bottom center\">Bot</button>", "<button data-o=\"bottom center\" aria-label=\"Bottom\">Bot</button>"]
- ],
- "lede": "Grows from slightly smaller to full size, from a point you choose.",
- "prompt": "Add a scale-in entrance to [the element you want to animate]. It should start a little smaller than its final size and grow to full size, anchored at the point given in the settings: its center, or an edge or corner so it seems to grow out of the button that opened it. A springy curve lets it overshoot slightly and settle, which makes the arrival feel physical. Unless the settings turn it off, fade it in while it grows so it never flashes at full strength while it is still tiny. Animate only its size and opacity. If the visitor has reduced motion turned on, show it at full size without the zoom. Match the settings listed below."
- },
- {
- "slug": "clip-path-reveal",
- "number": "02.05",
- "prev": { "href": "../scale-in/", "name": "Scale In / Zoom In" },
- "next": { "href": "../curtain-reveal/", "name": "Curtain Reveal" },
- "autoplay": true,
- "attrs": { "btn-in": "data-hb-replay", "btn-rst": "data-hb-reset", "loop-tog": "data-hb-skip data-hb-loop", "outline-tog": "data-hb-skip" },
- "edits": [
- ["<div class=\"kv\"><span>clip-path</span><span class=\"v\" id=\"cp-val\">", "<div class=\"kv\" hidden><span>clip-path</span><span class=\"v\" id=\"cp-val\">"],
- ["<button data-d=\"left\" class=\"on\">←</button>", "<button data-d=\"left\" class=\"on\" aria-label=\"From the left\">←</button>"],
- ["<button data-d=\"right\">→</button>", "<button data-d=\"right\" aria-label=\"From the right\">→</button>"],
- ["<button data-d=\"top\">↑</button>", "<button data-d=\"top\" aria-label=\"From the top\">↑</button>"],
- ["<button data-d=\"bottom\">↓</button>", "<button data-d=\"bottom\" aria-label=\"From the bottom\">↓</button>"],
- ["<button data-d=\"center\">⊙</button>", "<button data-d=\"center\" aria-label=\"From the center\">⊙</button>"]
- ],
- "lede": "A shape uncovers the element while it stays perfectly still.",
- "prompt": "Add a mask reveal to [the image or block you want to reveal]. The element should stay completely still and fully drawn while a shape uncovers it, like a window opening: an edge wipe that travels in from one side, a circle or ellipse that opens from the middle, or an angled swipe. Nothing moves, fades or changes size; only the visible area grows until the whole element shows. Let the wipe slow down as it finishes instead of stopping abruptly. The content must stay accessible even while part of it is hidden. If the visitor has reduced motion turned on, show it fully without the wipe. Match the settings listed below."
- },
- {
- "slug": "curtain-reveal",
- "number": "02.06",
- "prev": { "href": "../clip-path-reveal/", "name": "Clip-Path Reveal" },
- "next": { "href": "../split-text-reveal/", "name": "Split Text Reveal" },
- "autoplay": false,
- "attrs": { "btn-play": "data-hb-replay", "btn-rst": "data-hb-reset", "loop-tog": "data-hb-skip data-hb-loop" },
- "edits": [
- ["<button data-ax=\"h\" data-dir=\"ltr\" class=\"on\">→ L→R</button>", "<button data-ax=\"h\" data-dir=\"ltr\" class=\"on\" aria-label=\"Left to right\">→ L→R</button>"],
- ["<button data-ax=\"h\" data-dir=\"rtl\">← R→L</button>", "<button data-ax=\"h\" data-dir=\"rtl\" aria-label=\"Right to left\">← R→L</button>"],
- ["<button data-ax=\"v\" data-dir=\"ttb\">↓ Top</button>", "<button data-ax=\"v\" data-dir=\"ttb\" aria-label=\"Top to bottom\">↓ Top</button>"],
- ["<button data-ax=\"v\" data-dir=\"btt\">↑ Bot</button>", "<button data-ax=\"v\" data-dir=\"btt\" aria-label=\"Bottom to top\">↑ Bot</button>"]
- ],
- "lede": "A colored panel covers the content, then slides away to reveal it.",
- "prompt": "Add a curtain reveal to [the content you want to reveal]. A solid colored panel should slide across and cover the content completely, pause for a beat, then keep going and slide off the far side, leaving the content visible. The pause is what makes the change register, so keep it. In split mode, two panels come in from opposite sides, meet in the middle, then part. Pick a panel color that contrasts strongly with the content. Move the panels rather than resizing them so the motion stays smooth. If the visitor has reduced motion turned on, show the content without the curtain. Match the settings listed below."
- },
- {
- "slug": "split-text-reveal",
- "number": "02.07",
- "prev": { "href": "../curtain-reveal/", "name": "Curtain Reveal" },
- "next": { "href": "../letter-by-letter-stagger/", "name": "Letter-by-Letter Stagger" },
- "autoplay": true,
- "attrs": { "btn-in": "data-hb-replay", "btn-rst": "data-hb-reset", "loop-tog": "data-hb-skip data-hb-loop" },
- "edits": [
- ["<button data-a=\"fade-up\" class=\"on\">↑Fade</button>", "<button data-a=\"fade-up\" class=\"on\" aria-label=\"Fade up\">↑Fade</button>"]
- ],
- "lede": "Text breaks into pieces that animate in one after another.",
- "prompt": "Add a split-text reveal to [your headline]. Break the text into pieces (characters, words or lines) and animate each piece into view one after another with a short delay between them, so the text flows in as a cascade instead of appearing all at once. Every piece plays the same small entrance, such as fading up from slightly below. Screen readers should still read the text as one normal sentence, not as separate pieces, and the text must not reflow or jump while it animates. If the visitor has reduced motion turned on, show the text immediately. Match the settings listed below."
- },
- {
- "slug": "letter-by-letter-stagger",
- "number": "02.08",
- "prev": { "href": "../split-text-reveal/", "name": "Split Text Reveal" },
- "next": { "href": "../word-by-word-reveal/", "name": "Word-by-Word Reveal" },
- "autoplay": true,
- "attrs": { "btn-play": "data-hb-replay", "btn-rst": "data-hb-reset" },
- "edits": [
- ["<button data-a=\"fade-up\" class=\"on\">↑Fade</button>", "<button data-a=\"fade-up\" class=\"on\" aria-label=\"Fade up\">↑Fade</button>"]
- ],
- "lede": "A phrase assembles one letter at a time, as a cascade or a typewriter.",
- "prompt": "Add a letter-by-letter entrance to [a short phrase or headline]. In cascade mode, every letter plays a small entrance a moment after the previous one, so the phrase assembles from left to right. In typewriter mode, the letters appear one at a time behind a blinking cursor, as if someone is typing. Use it only on short phrases, because long text becomes tedious to wait for. Screen readers should hear the whole phrase once, not letter by letter. If the visitor has reduced motion turned on, show the full phrase immediately. Match the settings listed below."
- },
- {
- "slug": "word-by-word-reveal",
- "number": "02.09",
- "prev": { "href": "../letter-by-letter-stagger/", "name": "Letter-by-Letter Stagger" },
- "next": { "href": "../blur-in/", "name": "Blur In" },
- "autoplay": true,
- "attrs": { "btn-in": "data-hb-replay", "btn-rst": "data-hb-reset", "loop-tog": "data-hb-skip data-hb-loop" },
- "edits": [
- [">↑ Fade up</option>", ">Fade up</option>"]
- ],
- "lede": "Words appear one after another at a comfortable reading pace.",
- "prompt": "Add a word-by-word reveal to [the paragraph or quote you want to reveal]. Each word should appear a moment after the one before it, at roughly the pace people read, so the text builds up as if it is being spoken. If sentence pauses are on, wait a little longer at the end of each sentence before continuing. Keep the delay short enough that nobody waits for text they could already read. The full text must stay readable by screen readers and must not reflow while it appears. If the visitor has reduced motion turned on, show all the text at once. Match the settings listed below."
- },
- {
- "slug": "blur-in",
- "number": "02.10",
- "prev": { "href": "../word-by-word-reveal/", "name": "Word-by-Word Reveal" },
- "next": { "href": "../flip-in/", "name": "Flip In" },
- "autoplay": true,
- "attrs": { "btn-in": "data-hb-replay", "btn-rst": "data-hb-reset", "loop-tog": "data-hb-skip data-hb-loop" },
- "edits": [
- ["<span>+ Slight upward translate</span>", "<span>Slight upward drift</span>"]
- ],
- "lede": "Fades in while sharpening from blurred to crisp, like a camera focusing.",
- "prompt": "Add a blur-in entrance to [the element you want to animate]. It should start blurred and transparent, then sharpen into focus while it fades in, like a camera pulling focus onto the subject. It can also drift up slightly as it settles. Use it on one focal element at a time, not on a list or grid, because blur is expensive for the browser to draw. Remove the blur completely once the animation ends. If the visitor has reduced motion turned on, show the element sharp and visible without the effect. Match the settings listed below."
- },
- {
- "slug": "flip-in",
- "number": "02.11",
- "prev": { "href": "../blur-in/", "name": "Blur In" },
- "next": { "href": "../bounce-in/", "name": "Bounce In" },
- "autoplay": true,
- "attrs": { "btn-in": "data-hb-replay", "btn-rst": "data-hb-reset", "loop-tog": "data-hb-skip data-hb-loop" },
- "edits": [],
- "lede": "Swings into view in 3D, like a hinged card turning toward you.",
- "prompt": "Add a 3D flip-in entrance to [the card you want to animate]. The card should start turned edge-on, like a door seen from the side, and swing toward the viewer until it faces them flat. Give the card's container a 3D perspective so the swing has real depth; without it, the flip looks like a flat squash. The hinge can sit in the middle or along one edge, and the card can fade in while it turns. If the visitor has reduced motion turned on, show the card facing forward without the flip. Match the settings listed below."
- },
- {
- "slug": "rotate-in",
- "number": "02.13",
- "prev": { "href": "../bounce-in/", "name": "Bounce In" },
- "next": null,
- "autoplay": true,
- "attrs": { "btn-in": "data-hb-replay", "btn-rst": "data-hb-reset", "loop-tog": "data-hb-skip data-hb-loop" },
- "edits": [
- ["<button data-x=\"0\" class=\"on\">0×</button>", "<button data-x=\"0\" class=\"on\" aria-label=\"No extra turns\">0×</button>"],
- ["<button data-x=\"1\">+1×</button>", "<button data-x=\"1\" aria-label=\"One extra turn\">+1×</button>"],
- ["<button data-x=\"2\">+2×</button>", "<button data-x=\"2\" aria-label=\"Two extra turns\">+2×</button>"],
- ["<button data-d=\"ccw\" class=\"on\">↺ CCW</button>", "<button data-d=\"ccw\" class=\"on\" aria-label=\"Counter-clockwise\">↺ CCW</button>"],
- ["<button data-d=\"cw\">↻ CW</button>", "<button data-d=\"cw\" aria-label=\"Clockwise\">↻ CW</button>"]
- ],
- "lede": "Spins into place while growing, best for icons, stars and badges.",
- "prompt": "Add a rotate-in entrance to [the icon or badge you want to animate]. It should spin around its center as it appears, growing from small to full size at the same time, so it looks like it is arriving rather than just turning. Let it overshoot slightly and settle, so the spin lands instead of gliding to a stop. Use this on round or symmetric shapes like icons, stars, gears and badges; it looks wrong on text or wide rectangles. If the visitor has reduced motion turned on, show it in place without spinning. Match the settings listed below."
- }
- ]
-}