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
docs: correct the 3D content sheet's preamble on paused redraws, Show me's rest, the phone rule and the paused pointer
matin7e460d83bd64
diff --git a/docs/superpowers/plans/2026-09-29-3d-content.md b/docs/superpowers/plans/2026-09-29-3d-content.mdindex 40901c43..ee5a91ec 100644--- a/docs/superpowers/plans/2026-09-29-3d-content.md+++ b/docs/superpowers/plans/2026-09-29-3d-content.md@@ -51,7 +51,7 @@ Ten pages move their picture with `requestAnimationFrame`: 3D Model Orbit, Canva- Each page's frame gate stays as it is today (`if(dt<16)return`, 12ms on GPGPU Particle System).- **Clocks.** Where the movement follows a clock, the page keeps its own, which adds up each frame's time (capped, and counted afresh from each start), so Play never jumps. Where a speed multiplies the clock inside a shader (Ray Marching's camera, Volumetric Smoke's rise), the page adds up the speed-weighted step itself, so a new speed never makes the picture jump; the sections say which uniform replaces which product.- **The first picture:** the page draws a frame at load, before the loop starts, so a loop that is paused on arrival never shows an empty stage. The sections name the call.-- **While paused,** a setting change or a resize draws the picture again so the change shows, without moving anything. This is the loop rule "changing a setting while paused shows the new setting without starting the loop again". Most pages already do this ("repaint while paused"); the sections name the function. Listeners that watched the old `aside` for `input` now watch the Try it step for `click` and `change` (choice buttons send `click`).+- **While paused,** a setting change or a resize draws the picture again so the change shows, without moving anything (a canvas that fades instead of clearing, as with Trails, is cleared first, so no ghost of the old picture stays under the new one). This is the loop rule "changing a setting while paused shows the new setting without starting the loop again". Most pages already do this ("repaint while paused"); the sections name the function. Listeners that watched the old `aside` for `input` now watch the Try it step for `click` and `change` (choice buttons send `click`).- **Slow motion (page):** while the switch is on, each frame moves things a third of the usual step, or adds a third of the frame's time to the page's clock. It takes effect from the next frame. Something that jumps straight to the pointer (3D Model Orbit's Follows the pointer, Fluid / Liquid Simulation's pointer blob) is left alone; something that glides after it or is pushed by it (Morphing Blob's drop, Canvas Particle Effect's dots) moves at a third of its speed like everything else.- **Pointer while paused:** the pointer's position is still recorded, but nothing on the stage moves until Play.- The fps badges, the counters and the shader-source panels go (the pages show no code). The "WebGL is unavailable" and "shader failed" messages stay, in the site font. Context-loss handling stays exactly as today.@@ -63,7 +63,7 @@ The browser tool (`tools/check-pages.mjs`) runs headless Chrome with `--disable-Four pages: Parallax 3D Tilt, 2.5D / Pseudo-3D, Image Distortion on Hover (step 1 "Hover it") and 3D Flip Card (step 1 "Click it").- The body is `<body class="hb" data-hb-kind="do" data-hb-autoplay>`. Step 1's title and help line are in the section, and every do-it help line ends with ", or press Show me." (a rule for every lane). The player bar holds the Show me button, and the Reset button where the section has one, exactly as in the do-it/scroll plan (Task 2). 3D Flip Card also has Slow motion (css).-- **Show me** runs one example of the interaction, 2.5 to 3 seconds long, and returns the demo to rest. The run keeps one handle (its animation frame or its timer), so a second press restarts it cleanly and anything can stop it.+- **Show me** runs one example of the interaction, 2.5 to 3 seconds long, and returns the demo to rest (Image Distortion on Hover's fade ends about three seconds after its run). The run keeps one handle (its animation frame or its timer), so a second press restarts it cleanly and anything can stop it.- **Stopping a run:** the page listens for `hb:input` at the top level of its inline script. Only if a run is under way (its own handle is set: its frame or its timer, or on Image Distortion on Hover its start time, because that page's render loop keeps `raf` set while the pointer rests) does it stop the run, leaving the visitor in control; otherwise it does nothing. A tap sends `hb:input` twice, for `pointerdown` and then for `touchstart`, the second after the page's own `pointerdown` handler has acted, so an unconditional stop would undo what the finger has just done (flatten a card, start fading a distortion). Hovering sends no `hb:input` (the shared script sends it for presses, keys, wheels and touches only), so on the three Hover it pages the page's own `pointermove` handler also ends a run that is under way, for trusted events only (`e.isTrusted`), before it acts on the pointer.- **Reset** is there only where the demo keeps a state (2.5D / Pseudo-3D's camera, 3D Flip Card's turned card). Parallax 3D Tilt and Image Distortion on Hover return to rest by themselves.- **Settings** apply at once to what they change (a depth, a colour) and play nothing; the visitor sees them at the next interaction or Show me.@@ -90,7 +90,7 @@ What stays: the still picture (every loop draws a full frame at load and is paus## Heavy effects and their phone fallbacks-CLAUDE.md asks for 60 fps on a mid-range phone, and a reduced-quality fallback on phones for heavy effects. Each section has a **Phone fallback** line: what the demo already does, or the smallest change that keeps it smooth. "On phones" means a screen 600px wide or less, which is how these demos already decide (`innerWidth<=600` or `matchMedia('(max-width:600px)')`).+CLAUDE.md asks for 60 fps on a mid-range phone, and a reduced-quality fallback on phones for heavy effects. Each section has a **Phone fallback** line: what the demo already does, or the smallest change that keeps it smooth. "On phones" means a screen 600px wide or less, or 500px tall or less, so a phone held sideways counts too: `matchMedia('(max-width:600px),(max-height:500px)')`, or the same two tests written out with `innerWidth` and `innerHeight`. Glassmorphism Animated's card layout is the one exception and looks at the width alone (`@media(max-width:600px)`); held sideways it still measured 182 compositor frames in 3 seconds.The WebGL pages already draw fewer pixels on phones (a lower pixel ratio, and fewer ray steps on the two ray-marching pages), and GPGPU Particle System starts with fewer particles; those stay, except that Volumetric Smoke needed more (its section has the numbers, measured with GPU rendering on an Intel UHD chip). Their cost is on the graphics chip, which a headless measurement in software cannot stand in for.@@ -622,7 +622,7 @@ None: leave out the `details.hb-options` block.- **Stage font:** no text on the stage; `.gl-msg` uses the site font.- **Stage:** only the canvas. The fps and pattern-name badges (`.overlay`) and the shader source panel go; `.gl-msg` stays. `hb-dots`: no. Default height. `touch-action:pan-y` stays.- **Phone fallback:** today's stays: the pixel ratio is capped at 1.5 on phones (2 on computers).-- **Touch and pointer:** `pointerdown` also sets the pointer's position, so with Reacts to the pointer a tap bends the pattern there. The `pointermove` and `pointerdown` handlers only record `MOUSE_UV`: today's `still()` call in the `pointermove` handler goes, so a paused pattern does not bend under a moving pointer (the preamble's rule). The picture takes the pointer only from a frame that moves on, as Fluid / Liquid Simulation does: `render()` sets `SHOWN_UV=MOUSE_UV` (it starts at the middle, `[.5,.5]`) just before `draw()`, and `draw()` sends `SHOWN_UV` to the shader. A repaint while paused (a setting change or a resize) therefore shows the new setting and nothing else: a paused Plasma to Waves to Plasma round trip changes 0 pixels, where it changed 99% of the stage when the repaint took the pointer recorded since pausing. The new position shows at the next Play. With Plasma the middle looks the same as no pointer, so switching Reacts to the pointer on while paused shows nothing until Play; Waves, Cells and Kaleidoscope show their bump or slices at the middle.+- **Touch and pointer:** `pointerdown` also sets the pointer's position, so with Reacts to the pointer a tap bends the pattern there. The `pointermove` and `pointerdown` handlers only record `MOUSE_UV`: today's `still()` call in the `pointermove` handler goes, so a paused pattern does not bend under a moving pointer (the preamble's rule). The picture takes the pointer only from a frame that moves on, as Fluid / Liquid Simulation does: `render()` sets `SHOWN_UV=MOUSE_UV` (it starts at the middle, `[.5,.5]`) just before `draw()`, and `draw()` sends `SHOWN_UV` to the shader. A repaint while paused (a setting change or a resize) therefore shows the new setting and nothing else: a paused Plasma to Waves to Plasma round trip changes 0 pixels, where it changed 99% of the stage when the repaint took the pointer recorded since pausing. The new position shows at the next Play. With Plasma the middle looks the same as no pointer, so if the pointer has not been over the stage, switching Reacts to the pointer on while paused shows nothing until Play; Waves, Cells and Kaleidoscope show their bump or slices at the middle.**Main settings**