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.
HTML ai-promptsanimationcss-animationsfrontendgithub-pagesjavascriptmicrointeractionsmotion-designno-dependenciesreferencescroll-animationui-animationweb-animationweb-developmentwebgl
feat: Split-Flap Board (05.16)
matin8152c4e76ef3
diff --git a/README.md b/README.mdindex bed39fd5..9dd64569 100644--- a/README.md+++ b/README.md@@ -182,6 +182,7 @@ All 129 techniques, each linked to its live demo.- **[Text on a Path](animations/05-text-typography/text-on-path/)** — Text travels along a wave, an arc or a circle. Best for badges and seals.- **[Wavy Text](animations/05-text-typography/wavy-text/)** — A wave rolls through the word, letter by letter. Best for playful titles.- **[Highlighter Sweep](animations/05-text-typography/highlighter-sweep/)** — A marker sweeps in behind the key words, one after another. Best for key points.+- **[Split-Flap Board](animations/05-text-typography/split-flap-board/)** — Tiles flip through the letters to spell a word, like an airport board. Best for hero titles.</details>diff --git a/animations/05-text-typography/README.md b/animations/05-text-typography/README.mdindex 3f659083..8b78dfe7 100644--- a/animations/05-text-typography/README.md+++ b/animations/05-text-typography/README.md@@ -21,6 +21,7 @@ Animations specifically for type — where the letterforms themselves are the co| [Text on a Path](text-on-path/) | Text travels along a wave, an arc or a circle. Best for badges and seals. || [Wavy Text](wavy-text/) | A wave rolls through the word, letter by letter. Best for playful titles. || [Highlighter Sweep](highlighter-sweep/) | A marker sweeps in behind the key words, one after another. Best for key points. |+| [Split-Flap Board](split-flap-board/) | Tiles flip through the letters to spell a word, like an airport board. Best for hero titles. |## Key principlesdiff --git a/animations/05-text-typography/highlighter-sweep/index.html b/animations/05-text-typography/highlighter-sweep/index.htmlindex cf14d585..9e341b3e 100644--- a/animations/05-text-typography/highlighter-sweep/index.html+++ b/animations/05-text-typography/highlighter-sweep/index.html@@ -51,7 +51,7 @@<body class="hb" data-hb-kind="once" data-hb-autoplay><nav class="hb-bar" aria-label="Animation Handbook"><a class="hb-home" href="../../../"><svg class="hb-mark" viewBox="0 0 32 32" aria-hidden="true"><g class="g"><circle cx="11.16" cy="20.84" r="6.1"/><circle cx="15.12" cy="16.88" r="6.1"/><circle cx="18.51" cy="13.49" r="6.1"/></g><circle class="b" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>- <span class="hb-pager"><a href="../wavy-text/" rel="prev" aria-label="Previous: Wavy Text"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg><span><span class="hb-dir">Previous: </span>Wavy Text</span></a></span>+ <span class="hb-pager"><a href="../wavy-text/" rel="prev" aria-label="Previous: Wavy Text"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg><span><span class="hb-dir">Previous: </span>Wavy Text</span></a><a href="../split-flap-board/" rel="next" aria-label="Next: Split-Flap Board"><span><span class="hb-dir">Next: </span>Split-Flap Board</span><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m9 18 6-6-6-6"/></svg></a></span></nav><main class="hb-page"><header class="hb-head">diff --git a/animations/05-text-typography/split-flap-board/README.md b/animations/05-text-typography/split-flap-board/README.mdnew file mode 100644index 00000000..b57bf677--- /dev/null+++ b/animations/05-text-typography/split-flap-board/README.md@@ -0,0 +1,59 @@+# Split-Flap Board++## What it is+A split-flap board shows each letter on a tile that is cut across the middle, like the departure boards of old airports and train stations. To change a letter, the tile flips through the alphabet: the top half of the old letter falls forward over the hinge and the bottom half of the next letter lands under it, again and again, until the tile shows its new letter. Tiles whose letters come later in the alphabet keep flipping longer, so the word settles tile by tile.++## When to use it+- Hero titles and intros with a travel, transport or retro theme+- Gate, status and arrival boards, or a "now showing" line that changes now and then+- Short words that change: a destination, a status, a score (with digits added to the run of letters)+- Moments that should feel mechanical and a little playful++## How it works+Each tile is four layers of the same size and color. Two still halves fill the tile; two flaps sit over them and turn on the hinge in the middle. Every half is a box of half the tile's height with its overflow hidden, holding a letter box as tall as the whole tile, pinned to the top or the bottom, so a top half shows the top of its letter and a bottom half the bottom of it:++```css+.tile { position: relative; width: var(--tw); height: calc(var(--tw) * 1.4); perspective: calc(var(--tw) * 5); line-height: 1; }+.half, .flap { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; background-color: var(--tile); }+.up { top: 0; } .down { bottom: 0; }+.half b, .flap b { position: absolute; left: 0; right: 0; height: 200%; display: flex; align-items: center; justify-content: center; }+.up b { top: 0; } .down b { bottom: 0; }+.flap.up { transform-origin: 50% 100%; } /* turns on its bottom edge: the hinge */+.flap.down { transform-origin: 50% 0; } /* turns on its top edge: the hinge */+```++During a flip from one letter to the next, the still top half already shows the next letter and the still bottom half still shows the old one. The top flap, showing the old letter's top, falls from upright to edge-on, speeding up; then the bottom flap, showing the next letter's bottom, swings from edge-on down into place, slowing down. A dark layer on each flap gets stronger the further it turns, as if it turned away from the light. The letters are written only when a tile starts a new flip; between those moments only the two `rotateX()` transforms change.++One frame loop runs every tile. A clock moves on by the time since the last frame (at most 50ms, and a third as fast in Slow motion), and from it each tile works out which flip it is on and how far through it, so the board flips at the same pace on a 60 Hz and a 120 Hz screen:++```js+const local = clock - i * STAGGER; // each tile starts a moment after the one on its left+const k = Math.floor(local / flipMs); // the flip it is on+if (k >= flips) { rest(t, t.seq[flips]); return; } // done: its own letter+const p = local / flipMs - k; // how far through that flip, 0 to 1+if (p < .5) { const q = p * 2; turn(t.f1, t.s1, -90 * q * q); } // the old letter's top falls+else { const q = (p - .5) * 2; turn(t.f2, t.s2, 90 * (1 - q) * (1 - q)); } // the next letter's bottom lands+```++Each tile's run of letters is the drum from a blank to its letter (" ABC…" up to it), so a tile showing A flips once and a tile showing Z flips 26 times. Under reduced motion nothing turns: the letters fade in, tile after tile.++## Key parameters+| Parameter | Default | Effect |+|-----------|---------|--------|+| Word | BOARDING | The word on the board: up to 10 letters from A to Z, and a space leaves a blank tile |+| Flip speed | Normal | How long one flip takes: slow is 150ms, normal 85ms and fast 45ms; each tile starts 40ms after the one on its left |+| Tile color | Black | The color of the tiles: black, blue, red or green with light letters, or cream with dark letters |++## Production notes+- **The drum**: real boards only flip forward, so going from Z back to A passes every letter. Add digits and symbols to the run of letters for times, gates and scores; the order decides how long each change takes. For a change from one word to another, start each tile from the letter it shows now instead of from a blank.+- **Transforms only**: the flaps turn with `rotateX()` and the shade is an opacity, so nothing is laid out again while the board flips. The letters are written once per flip, never every frame.+- **Exact halves**: the two halves of a letter must meet at the hinge. Use `line-height: 1`, a letter box exactly twice the height of a half, and check the font's capitals: some sit a little high or low and need a small nudge.+- **Accessibility**: the row is one image named with the final word, and the tiles are hidden from screen readers, so the word is read once rather than every letter it passes through.+- **Sound**: a soft clatter makes the board feel real, but play it only after the visitor has interacted, and give them a way to mute it.+- **Libraries**: GSAP can sequence the `rotationX` tweens per tile; there are also small split-flap web components. CSS-only versions use keyframes with `steps()`, but they cannot stop each tile on its own letter.++## See also+- [Scramble / Glitch Text](../scramble-text/) — random symbols lock into the real text, left to right+- [Text Morphing](../text-morphing/) — one word changes into the next, letter by letter+- [Flip In](../../02-entrance-and-exit/flip-in/) — swings into view in 3D, like a card turning over+- [3D Flip Card](../../06-3d-advanced/flip-card-3d/) — a card turns over in 3D to show its backdiff --git a/animations/05-text-typography/split-flap-board/index.html b/animations/05-text-typography/split-flap-board/index.htmlnew file mode 100644index 00000000..d029729b--- /dev/null+++ b/animations/05-text-typography/split-flap-board/index.html@@ -0,0 +1,246 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Split-Flap Board — Animation Handbook</title>+ <meta name="description" content="Tiles flip through the letters to spell a word, like an airport board. Best for hero titles.">+ <link rel="canonical" href="https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/split-flap-board/">+ <link rel="icon" type="image/png" sizes="96x96" href="../../../favicon.png">+ <link rel="icon" type="image/svg+xml" href="../../../favicon.svg">+ <link rel="apple-touch-icon" href="../../../apple-touch-icon.png">+ <meta property="og:type" content="article">+ <meta property="og:site_name" content="Animation Handbook">+ <meta property="og:title" content="Split-Flap Board — Animation Handbook">+ <meta property="og:description" content="Tiles flip through the letters to spell a word, like an airport board. Best for hero titles.">+ <meta property="og:url" content="https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/split-flap-board/">+ <meta property="og:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png">+ <meta name="twitter:card" content="summary_large_image">+ <meta name="twitter:title" content="Split-Flap Board — Animation Handbook">+ <meta name="twitter:description" content="Tiles flip through the letters to spell a word, like an airport board. Best for hero titles.">+ <meta name="twitter:image" content="https://matinmonshizadeh.github.io/animation-handbook/og-image.png">+ <script type="application/ld+json">{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Split-Flap Board", "name": "Split-Flap Board", "description": "Tiles flip through the letters to spell a word, like an airport board. Best for hero titles.", "url": "https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/split-flap-board/", "inLanguage": "en", "articleSection": "Text & Typography", "isPartOf": {"@type": "WebSite", "name": "Animation Handbook", "url": "https://matinmonshizadeh.github.io/animation-handbook/"}, "author": {"@type": "Person", "name": "matinmonshizadeh"}, "keywords": "web animation, CSS animation, Text & Typography, Split-Flap Board"}</script>+ <style>+ :root{--ui-accent:#ff6f8b;--tile:#1c1d22;--ink:#f4f4f2}+ *,*::before,*::after{box-sizing:border-box;margin:0;padding:0}+ .stage{display:flex;align-items:center;justify-content:center;padding:16px;background:#0b0b0d;container-type:inline-size}+ /* The tiles share the stage's width (100cqw), up to 68px each */+ .board{--gap:clamp(4px,1.2cqw,8px);--pad:clamp(12px,3cqw,26px);--tw:min(68px,calc((100cqw - 2 * var(--pad) - (var(--n,8) - 1) * var(--gap)) / var(--n,8)));+ display:flex;flex-direction:column;gap:clamp(10px,2cqw,16px);padding:var(--pad);border-radius:14px;background:#141519;border:1px solid rgba(255,255,255,.08)}+ .board-top{display:flex;align-items:center;gap:8px;font-size:clamp(12px,1.6cqw,14px);font-weight:700;letter-spacing:.18em;text-transform:uppercase;color:#f2c94c}+ .lamp{width:8px;height:8px;border-radius:50%;background:#5fd88a}+ .row{display:flex;gap:var(--gap)}+ /* A tile: two still halves, and two flaps that turn on the hinge in the middle */+ .tile{position:relative;flex:none;width:var(--tw);height:calc(var(--tw) * 1.4);perspective:calc(var(--tw) * 5);+ font-size:calc(var(--tw) * .78);font-weight:700;line-height:1;color:var(--ink)}+ .half,.flap{position:absolute;left:0;right:0;height:50%;overflow:hidden;background-color:var(--tile)}+ .up{top:0;border-radius:calc(var(--tw) * .1) calc(var(--tw) * .1) 0 0;background-image:linear-gradient(rgba(255,255,255,.07),rgba(255,255,255,0))}+ .down{bottom:0;border-radius:0 0 calc(var(--tw) * .1) calc(var(--tw) * .1);background-image:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.14))}+ /* Each half holds the whole letter, as tall as the tile, so it shows the top or the bottom of it */+ .half b,.flap b{position:absolute;left:0;right:0;height:200%;display:flex;align-items:center;justify-content:center}+ .up b{top:0}+ .down b{bottom:0}+ .flap{z-index:1;visibility:hidden;backface-visibility:hidden}+ .flap.up{transform-origin:50% 100%}+ .flap.down{transform-origin:50% 0}+ .flap i{position:absolute;inset:0;background:#000;opacity:0}+ .tile::after{content:'';position:absolute;z-index:2;left:0;right:0;top:calc(50% - 1px);height:2px;background:rgba(0,0,0,.55)}+ .row.clearing .half b{opacity:0;transition:opacity .3s linear}+ .row.pre .half b{opacity:0;transition:none!important}+ /* Reduced motion: no flipping; each letter fades in, tile after tile */+ @media(prefers-reduced-motion:reduce){.half b{transition:opacity .4s linear calc(var(--i,0) * 60ms)}}+ </style>+ <link rel="stylesheet" href="../../../assets/css/demo-page.css?v=6">+ <script src="../../../assets/js/demo-page.js?v=6" defer></script>+</head>+<body class="hb" data-hb-kind="once" data-hb-autoplay>+<nav class="hb-bar" aria-label="Animation Handbook">+ <a class="hb-home" href="../../../"><svg class="hb-mark" viewBox="0 0 32 32" aria-hidden="true"><g class="g"><circle cx="11.16" cy="20.84" r="6.1"/><circle cx="15.12" cy="16.88" r="6.1"/><circle cx="18.51" cy="13.49" r="6.1"/></g><circle class="b" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>+ <span class="hb-pager"><a href="../highlighter-sweep/" rel="prev" aria-label="Previous: Highlighter Sweep"><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="m15 18-6-6 6-6"/></svg><span><span class="hb-dir">Previous: </span>Highlighter Sweep</span></a></span>+</nav>+<main class="hb-page">+ <header class="hb-head">+ <p class="hb-cat">05.16 · Text & Typography</p>+ <h1>Split-Flap Board</h1>+ <p class="hb-lede">Tiles flip through the letters to spell a word, like an airport board. Best for hero titles.</p>+ </header>++ <section class="hb-step hb-watch" aria-labelledby="hb-watch-title">+ <div class="hb-step-head">+ <span class="hb-num" aria-hidden="true">1</span>+ <div><h2 id="hb-watch-title">Watch it</h2><p>It plays by itself. Turn on slow motion to see each part of the movement.</p></div>+ </div>+ <div class="stage hb-dots">+ <div class="board">+ <p class="board-top" aria-hidden="true"><span class="lamp"></span>Departures</p>+ <div class="row" id="row" role="img" aria-label="BOARDING"></div>+ </div>+ </div>+ <div class="hb-player">+ <button class="hb-play" type="button" id="btn-play" data-hb-replay><svg class="hb-ic" viewBox="0 0 24 24" aria-hidden="true"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/></svg>Replay</button>+ <label class="hb-toggle"><input class="hb-switch" type="checkbox" role="switch" id="loop-tog" data-hb-loop autocomplete="off"><span>Loop</span></label>+ <label class="hb-toggle"><input class="hb-switch" type="checkbox" role="switch" id="slow-tog" data-hb-slowmo autocomplete="off"><span>Slow motion</span></label>+ </div>+ </section>++ <section class="hb-step hb-try" aria-labelledby="hb-try-title">+ <div class="hb-step-head">+ <span class="hb-num" aria-hidden="true">2</span>+ <div><h2 id="hb-try-title">Try it</h2><p>Change a setting and the animation plays again.</p></div>+ </div>+ <div class="hb-settings">+ <div class="hb-setting">+ <label class="hb-setting-name" for="word-in">Word</label>+ <input class="hb-text" type="text" id="word-in" value="BOARDING" maxlength="10" autocomplete="off" spellcheck="false" autocapitalize="characters">+ <p class="hb-hint">Up to 10 letters, A to Z. A space leaves a blank tile.</p>+ </div>+ <div class="hb-setting">+ <p class="hb-setting-name" id="speed-lbl">Flip speed</p>+ <div class="seg" id="speed-seg" role="group" aria-labelledby="speed-lbl">+ <button type="button" data-ms="150" aria-pressed="false">Slow</button>+ <button type="button" data-ms="85" class="on" aria-pressed="true">Normal</button>+ <button type="button" data-ms="45" aria-pressed="false">Fast</button>+ </div>+ <p class="hb-hint">How long each tile takes to turn one letter.</p>+ </div>+ <div class="hb-setting">+ <p class="hb-setting-name" id="color-lbl">Tile color</p>+ <div class="swatches" id="color-sw" role="group" aria-labelledby="color-lbl">+ <button type="button" class="on" aria-pressed="true" aria-label="Black" data-c="#1c1d22" data-ink="#f4f4f2" style="background:#1c1d22"></button>+ <button type="button" aria-pressed="false" aria-label="Blue" data-c="#1d3a6e" data-ink="#f4f4f2" style="background:#1d3a6e"></button>+ <button type="button" aria-pressed="false" aria-label="Red" data-c="#8a1d27" data-ink="#f4f4f2" style="background:#8a1d27"></button>+ <button type="button" aria-pressed="false" aria-label="Green" data-c="#134c39" data-ink="#f4f4f2" style="background:#134c39"></button>+ <button type="button" aria-pressed="false" aria-label="Cream" data-c="#ece5d3" data-ink="#1d1d22" style="background:#ece5d3"></button>+ </div>+ <p class="hb-hint">Cream tiles get dark letters.</p>+ </div>+ </div>+ </section>++ <section class="hb-step hb-prompt-step" aria-labelledby="hb-prompt-title">+ <div class="hb-step-head">+ <span class="hb-num" aria-hidden="true">3</span>+ <div><h2 id="hb-prompt-title">Copy the prompt</h2><p>Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.</p></div>+ </div>+ <div class="hb-card">+ <p class="hb-prompt">Add a split-flap board to [your headline or short word]. Show each letter on its own tile, split across the middle like an old airport departures board. To change a tile, flip it through the alphabet one letter at a time until it reaches its letter: the top half of the old letter falls forward over the hinge, turning in 3D and darkening as it turns, and the bottom half of the next letter swings down into place. Start the tiles a moment apart from left to right, so they settle one by one. Turn the halves with transforms only, and let screen readers hear the final word once. If the visitor has reduced motion turned on, fade the letters in instead. Match the settings listed below.</p>+ <div class="hb-chips-box" hidden>+ <p class="hb-chips-title">Your settings</p>+ <ul class="hb-chips"></ul>+ </div>+ <div class="hb-copy-row">+ <button class="hb-copy" type="button"><svg class="hb-ic hb-i-copy" viewBox="0 0 24 24" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg><svg class="hb-ic hb-i-done" viewBox="0 0 24 24" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg><span class="hb-copy-label" aria-live="polite">Copy prompt</span></button>+ <p class="hb-hint">Replace the words in brackets with your own element. Your settings are added at the end.</p>+ </div>+ </div>+ </section>++ <section class="hb-about" aria-labelledby="hb-what-title">+ <div class="hb-what">+ <h2 id="hb-what-title">What it is</h2>+ <div class="hb-what-text"><p>The full explanation is in <a href="README.md">README.md</a>.</p></div>+ </div>+ <div class="hb-fit">+ <h2>Good for</h2>+ <ul class="hb-tags hb-good"><li>Hero titles</li><li>Travel sites</li><li>Event intros</li><li>Retro designs</li></ul>+ <h3>Avoid on</h3>+ <ul class="hb-tags hb-avoid"><li>Long text</li><li>Calm pages</li></ul>+ </div>+ </section>++ <section class="hb-related" aria-labelledby="hb-related-title" hidden>+ <h2 id="hb-related-title">Similar animations</h2>+ <div class="hb-rel-list"></div>+ </section>+</main>+<footer class="hb-foot"><span>Animation Handbook</span><a href="#top">Back to top ↑</a></footer>+<script>+ const row=document.getElementById('row'),wordIn=document.getElementById('word-in');+ const vars=document.documentElement.style;+ const loopTog=document.getElementById('loop-tog'),slowTog=document.getElementById('slow-tog');+ const motionOk=()=>!window.matchMedia('(prefers-reduced-motion:reduce)').matches;+ const DRUM=' ABCDEFGHIJKLMNOPQRSTUVWXYZ',STAGGER=40; // the letters a tile turns through, in order; each tile starts 40ms after the one on its left+ let flipMs=85,tiles=[],raf=0,clock=0,lastT=null,timers=[];++ function word(){return wordIn.value.toUpperCase().replace(/[^A-Z ]/g,'').trim()||'BOARDING'}+ // One tile per letter. Each tile keeps its run of letters, from a blank to its own letter, and the flip it is on (k).+ function build(text){+ row.textContent='';+ row.parentNode.style.setProperty('--n',text.length);+ row.setAttribute('aria-label',text.trim());+ tiles=[...text].map((ch,i)=>{+ const el=document.createElement('div');+ el.className='tile';el.setAttribute('aria-hidden','true');el.style.setProperty('--i',i);+ el.innerHTML='<div class="half up"><b></b></div><div class="half down"><b></b></div><div class="flap up"><b></b><i></i></div><div class="flap down"><b></b><i></i></div>';+ row.appendChild(el);+ const [u,d,f1,f2]=el.children;+ return {u:u.firstChild,d:d.firstChild,f1,f2,f1b:f1.firstChild,f2b:f2.firstChild,s1:f1.lastChild,s2:f2.lastChild,seq:DRUM.slice(0,DRUM.indexOf(ch)+1),k:-1};+ });+ }+ function rest(t,ch){t.u.textContent=t.d.textContent=ch;t.f1.style.visibility=t.f2.style.visibility='hidden'}+ function turn(flap,shade,deg){flap.style.visibility='visible';flap.style.transform='rotateX('+deg.toFixed(2)+'deg)';shade.style.opacity=(Math.abs(deg)/180).toFixed(3)}++ // Every frame works out, from the time played, which flip each tile is on and how far through it. During a flip from+ // cur to nxt the still top half already shows nxt and the still bottom half still shows cur; cur's top half falls from+ // upright to edge-on (speeding up), then nxt's bottom half swings from edge-on down into place (slowing down).+ // The clock moves by the time since the last frame (at most 50ms, so a hidden tab does not jump), a third as fast in+ // Slow motion.+ function frame(ts){+ const dt=lastT===null?0:Math.min(ts-lastT,50);lastT=ts;+ clock+=dt*(slowTog.checked?1/3:1);+ let busy=false;+ tiles.forEach((t,i)=>{+ const flips=t.seq.length-1,local=clock-i*STAGGER;+ if(local<0){busy=true;return}+ const k=Math.floor(local/flipMs);+ if(k>=flips){if(t.k!=='done'){t.k='done';rest(t,t.seq[flips])}return}+ busy=true;+ if(t.k!==k){t.k=k;const cur=t.seq[k],nxt=t.seq[k+1];t.u.textContent=t.f2b.textContent=nxt;t.d.textContent=t.f1b.textContent=cur}+ const p=local/flipMs-k;+ if(p<.5){const q=p*2;turn(t.f1,t.s1,-90*q*q);t.f2.style.visibility='hidden'}+ else{const q=(p-.5)*2;t.f1.style.visibility='hidden';turn(t.f2,t.s2,90*(1-q)*(1-q))}+ });+ raf=busy?requestAnimationFrame(frame):0;+ if(!busy)finished();+ }+ function later(fn,wait){timers.push(setTimeout(fn,wait))}+ // While Loop is on, the word holds 1800ms, the letters fade away and the board flips again from blank+ function finished(){+ if(!loopTog.checked||!motionOk())return;+ later(()=>{+ if(!loopTog.checked)return;+ row.classList.add('clearing');+ later(cycle,400);+ },1800);+ }+ // Every play starts from blank tiles. Under reduced motion the letters fade in instead of flipping.+ function cycle(){+ cancelAnimationFrame(raf);raf=0;+ build(word());+ row.classList.remove('clearing');+ if(!motionOk()){+ tiles.forEach(t=>rest(t,t.seq[t.seq.length-1]));+ row.classList.add('pre');void row.offsetWidth;row.classList.remove('pre');+ return;+ }+ tiles.forEach(t=>rest(t,' '));+ clock=0;lastT=null;raf=requestAnimationFrame(frame);+ }+ function play(){timers.forEach(clearTimeout);timers=[];cycle()}+ document.addEventListener('visibilitychange',()=>{lastT=null});++ document.getElementById('btn-play').addEventListener('click',play);+ loopTog.addEventListener('change',()=>{if(loopTog.checked)play()});+ function choices(id,pick){+ const buttons=document.querySelectorAll('#'+id+' button');+ buttons.forEach(b=>b.addEventListener('click',()=>{+ buttons.forEach(x=>{x.classList.toggle('on',x===b);x.setAttribute('aria-pressed',String(x===b))});+ pick(b.dataset);+ }));+ }+ choices('speed-seg',d=>{flipMs=+d.ms});+ choices('color-sw',d=>{vars.setProperty('--tile',d.c);vars.setProperty('--ink',d.ink)});+ build(word());tiles.forEach(t=>rest(t,' '));+</script>+</body>+</html>diff --git a/index.html b/index.htmlindex 10f67216..25d2186e 100644--- a/index.html+++ b/index.html@@ -735,6 +735,18 @@ button,input{font:inherit;color:inherit}@keyframes hl-a{0%,6%{transform:scaleX(0);opacity:1}20%,78%{transform:scaleX(1);opacity:1}90%,100%{transform:scaleX(1);opacity:0}}@keyframes hl-b{0%,26%{transform:scaleX(0);opacity:1}40%,78%{transform:scaleX(1);opacity:1}90%,100%{transform:scaleX(1);opacity:0}}@keyframes hl-c{0%,46%{transform:scaleX(0);opacity:1}62%,78%{transform:scaleX(1);opacity:1}90%,100%{transform:scaleX(1);opacity:0}}+/* four tiles flip to GATE: each tile's letters step up one at a time while a flap falls over its top half, then the word holds and fades; 1cqw is 1% of the stage's width */+.pv-splitflap{background:#0c0608;display:flex;align-items:center;justify-content:center;gap:1.8cqw;padding-top:7cqh;container-type:size}+.pv-splitflap .t{position:relative;flex:none;width:15cqw;height:21cqw;border-radius:1.6cqw;overflow:hidden;perspective:70cqw;background:linear-gradient(#272930 50%,#1c1d22 50%)}+.pv-splitflap .t::after{content:"";position:absolute;left:0;right:0;top:calc(50% - .4cqw);height:.8cqw;background:#0c0608}+.pv-splitflap .col{display:block;animation:sf-roll 4s linear infinite}+.pv-splitflap .col b{display:block;height:21cqw;line-height:21cqw;text-align:center;font-family:var(--disp);font-weight:700;font-size:14cqw;color:#f4f4f2}+.pv-splitflap .fl{position:absolute;left:0;right:0;top:0;height:50%;opacity:0;transform-origin:50% 100%;background:linear-gradient(rgba(255,255,255,.22),rgba(255,255,255,.06));animation:sf-flap 4s ease-in infinite}+.pv-splitflap .t:nth-child(2) .col,.pv-splitflap .t:nth-child(2) .fl{animation-delay:.1s}+.pv-splitflap .t:nth-child(3) .col,.pv-splitflap .t:nth-child(3) .fl{animation-delay:.2s}+.pv-splitflap .t:nth-child(4) .col,.pv-splitflap .t:nth-child(4) .fl{animation-delay:.3s}+@keyframes sf-roll{0%{opacity:0;transform:translateY(0)}4%{opacity:1}5%{transform:translateY(0);animation-timing-function:steps(5,end)}45%{transform:translateY(-105cqw)}86%{opacity:1}96%,100%{opacity:0;transform:translateY(-105cqw)}}+@keyframes sf-flap{0%,5%{opacity:0;transform:rotateX(0)}5.01%{opacity:1}13%{transform:rotateX(-90deg)}13.01%{transform:rotateX(0)}21%{transform:rotateX(-90deg)}21.01%{transform:rotateX(0)}29%{transform:rotateX(-90deg)}29.01%{transform:rotateX(0)}37%{transform:rotateX(-90deg)}37.01%{transform:rotateX(0)}45%{opacity:1;transform:rotateX(-90deg)}45.01%,100%{opacity:0;transform:rotateX(0)}}/* ── bespoke: 06 3D & Advanced ── */.pv-orbit3d{background:#05080a;display:grid;place-items:center;perspective:460px}@@ -1032,7 +1044,7 @@ button,input{font:inherit;color:inherit}<section class="wrap home-hero" aria-labelledby="hero-title"><span class="float fl1" aria-hidden="true"></span><span class="float fl2" aria-hidden="true"></span><span class="float fl3" aria-hidden="true"></span><span class="float fl4" aria-hidden="true"></span><span class="float fl5" aria-hidden="true"></span><span class="float fl6" aria-hidden="true"></span>- <p class="pill"><span class="pill-dot" aria-hidden="true"></span>131 free animations · no coding needed</p>+ <p class="pill"><span class="pill-dot" aria-hidden="true"></span>132 free animations · no coding needed</p><h1 class="h1" id="hero-title">What do you want to animate?</h1><p class="sub">Pick a place, or describe it in your own words. Every animation plays live, and each one comes with a ready-made prompt for your AI assistant.</p><form class="search" id="search-form" role="search" action="./" method="get">@@ -1089,8 +1101,8 @@ button,input{font:inherit;color:inherit}<p class="empty-s">Try a simpler word, or pick one of these:</p><p class="pop"><button type="button" data-q="fade in">fade in</button><button type="button" data-q="typing text">typing text</button><button type="button" data-q="loading spinner">loading spinner</button><button type="button" data-q="parallax">parallax</button><button type="button" data-q="confetti">confetti</button></p></div>- <div class="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 131 animations</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button></div>- <noscript><p class="noscript">This page shows its animations with JavaScript. All 131 are still easy to reach: see the <a href="https://github.com/matinmonshizadeh/animation-handbook#categories">category list on GitHub</a> or the <a href="sitemap.xml">full sitemap</a>. Each demo is a page of its own under <code>/animations/<category>/<name>/</code>.</p></noscript>+ <div class="more" id="more"><button type="button" class="bigbtn" id="more-btn"><span id="more-label">Browse all 132 animations</span><svg class="i" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M6 13l6 6 6-6"/></svg></button></div>+ <noscript><p class="noscript">This page shows its animations with JavaScript. All 132 are still easy to reach: see the <a href="https://github.com/matinmonshizadeh/animation-handbook#categories">category list on GitHub</a> or the <a href="sitemap.xml">full sitemap</a>. Each demo is a page of its own under <code>/animations/<category>/<name>/</code>.</p></noscript></section><section class="how" id="how" aria-labelledby="how-title">@@ -1108,7 +1120,7 @@ button,input{font:inherit;color:inherit}<footer class="wrap foot"><a class="brand" href="./"><svg class="mark" viewBox="0 0 32 32" aria-hidden="true"><circle class="ring" cx="11.16" cy="20.84" r="6.1"/><circle class="ring" cx="15.12" cy="16.88" r="6.1"/><circle class="ring" cx="18.51" cy="13.49" r="6.1"/><circle class="ball" cx="21.2" cy="10.8" r="6.6"/></svg><span>Animation Handbook</span></a>- <p class="foot-t">131 web animations with live demos and copyable prompts.</p>+ <p class="foot-t">132 web animations with live demos and copyable prompts.</p><nav class="nav" aria-label="Footer"><a class="lnk" href="https://github.com/matinmonshizadeh/animation-handbook" target="_blank" rel="noopener noreferrer">GitHub</a><a class="lnk" href="#top">Back to top</a></nav></footer><div class="toast" id="toast" role="status" aria-live="polite"><span class="ok" aria-hidden="true"><svg class="i" viewBox="0 0 24 24"><path d="M5 12.5l4.5 4.5L19 7.5"/></svg></span><span class="toast-t"></span></div>@@ -1253,6 +1265,7 @@ const CATS=[['text-on-path','Text on a Path','Text travels along a wave, an arc or a circle. Best for badges and seals.'],['wavy-text','Wavy Text','A wave rolls through the word, letter by letter. Best for playful titles.'],['highlighter-sweep','Highlighter Sweep','A marker sweeps in behind the key words, one after another. Best for key points.'],+ ['split-flap-board','Split-Flap Board','Tiles flip through the letters to spell a word, like an airport board. Best for hero titles.'],]},{@@ -1342,7 +1355,7 @@ const PV={'grain-overlay':'grain2','scanline':'scan','light-leak':'leak','floating-elements':'floaters','grid-dot-pattern-parallax':'dotgrid','abstract-geometric-motion':'geo','magnetic-button':'magnet','heart-burst':'heart','success-confetti':'confetti','error-shake':'shake','swipe-to-dismiss':'swipe',- 'glitch-text':'glitch','text-on-path':'onpath','wavy-text':'wavy','highlighter-sweep':'hilite',+ 'glitch-text':'glitch','text-on-path':'onpath','wavy-text':'wavy','highlighter-sweep':'hilite','split-flap-board':'splitflap','particle-constellation':'particles','flow-field':'flow','synthwave-grid':'synth'};@@ -1449,6 +1462,7 @@ const PLACES={'text-on-path':['text'],'wavy-text':['text'],'highlighter-sweep':['text'],+ 'split-flap-board':['text','intro'],// 06'3d-model-orbit':['imgcard'],'scroll-driven-3d-rotation':['scroll','imgcard'],@@ -1501,6 +1515,7 @@ function pvMarkup(k){case 'hilite': return '<span class="ppr"><span class="ln"><b style="width:24%"></b><b class="k anim" style="width:40%"></b><b style="width:22%"></b></span>'+'<span class="ln"><b style="width:20%"></b><b style="width:28%"></b><b class="k k2 anim" style="width:38%"></b></span>'+'<span class="ln"><b class="k k3 anim" style="width:44%"></b><b style="width:30%"></b></span></span>';+ case 'splitflap': return ['BCDEFG','VWXYZA','OPQRST','ZABCDE'].map(function(s){return '<span class="t"><span class="col anim">'+s.split('').map(function(c){return '<b>'+c+'</b>';}).join('')+'</span><span class="fl anim"></span></span>';}).join('');case 'sig6': return '<div class="cube anim"><span class="face f1"></span><span class="face f2"></span><span class="face f3"></span><span class="face f4"></span><span class="face f5"></span><span class="face f6"></span></div>';case 'sig7': return '<span class="s7 anim"></span>';case 'aurora': return '<span class="band b1 anim"></span><span class="band b2 anim"></span><span class="band b3 anim"></span>';@@ -1779,7 +1794,7 @@ let shown=[];// under the place label or between two states). Nothing here runs without reduced motion.const STILL={cover:.1,curtain:.6,kinetic:.25,carousel:.1,typewriter:.55,textclip:.7,svgpath:.7,smoke:.3,leak:.7,- flash:.41,blurpage:.2,toggle:.7,shake:.8,hideheader:.72,hilite:.7+ flash:.41,blurpage:.2,toggle:.7,shake:.8,hideheader:.72,hilite:.7,splitflap:.7};function hold(card){const anims=card.querySelector('.pv').getAnimations({subtree:true});diff --git a/sitemap.xml b/sitemap.xmlindex 6e40857a..af568f11 100644--- a/sitemap.xml+++ b/sitemap.xml@@ -97,6 +97,7 @@<url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/text-on-path/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/wavy-text/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/highlighter-sweep/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>+ <url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/05-text-typography/split-flap-board/</loc><lastmod>2026-10-01</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/3d-model-orbit/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/scroll-driven-3d-rotation/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>https://matinmonshizadeh.github.io/animation-handbook/animations/06-3d-advanced/parallax-3d-tilt/</loc><lastmod>2026-07-14</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>