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: tighten the 3D & Advanced content sheet after review
matinb28105bc81ab
diff --git a/docs/superpowers/plans/2026-09-29-3d-content.md b/docs/superpowers/plans/2026-09-29-3d-content.mdindex 1aeb55d2..42415e74 100644--- a/docs/superpowers/plans/2026-09-29-3d-content.md+++ b/docs/superpowers/plans/2026-09-29-3d-content.md@@ -46,8 +46,8 @@ How to read a section:Ten pages move their picture with `requestAnimationFrame`: 3D Model Orbit, Canvas Particle Effect, Fluid / Liquid Simulation, WebGL Shader Animation, Noise-Based Motion, Ray Marching / SDF Scene, GPGPU Particle System, Cloth / Soft-Body Simulation, Volumetric Smoke / 3D Noise and Morphing Blob. Each follows Text on a Path; its section only adds what differs.-- The loop keeps exactly one pending frame in `raf`. `start()` returns at once when `raf` is set; otherwise it forgets the time of the last frame and requests a frame.-- The page listens for `hb:pause`, registered at the top level of its inline script. Paused: `cancelAnimationFrame(raf); raf=null;` and the picture on screen stays. Not paused: `start()`, which carries on from the current state. The page keeps its own `paused` flag from this event; the old panel's Pause button, its label code and its flag handling go.+- The loop keeps exactly one pending frame in `raf`. The function that starts it, `start()`, returns at once when `raf` is set; otherwise it forgets the time of the last frame and requests a frame. On Cloth / Soft-Body Simulation it is called `resume()`, because that page's own `start()` rebuilds the cloth (see its section).+- The page listens for `hb:pause`, registered at the top level of its inline script. Paused: `cancelAnimationFrame(raf); raf=null;` and the picture on screen stays. Not paused: `start()` (`resume()` on Cloth), which carries on from the current state. The page keeps its own `paused` flag from this event; the old panel's Pause button, its label code and its flag handling go.- 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.@@ -62,9 +62,9 @@ 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. 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).+- 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.-- **Stopping a run:** the page listens for `hb:input` at the top level of its inline script and stops a run that is under way, leaving the visitor in control. 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, for trusted events only (`e.isTrusted`), before it acts on the pointer.+- **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 frame or timer handle is set) 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.- **Reduced motion:** nothing runs on arrival. Show me, Reset and the visitor's own pointer still work, so CSS rules that would stop them go (Parallax 3D Tilt's `transform:none!important`), while rules that only swap an animation for an instant change stay (3D Flip Card's face fade).@@ -94,16 +94,21 @@ CLAUDE.md asks for 60 fps on a mid-range phone, and a reduced-quality fallback oThe 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. Their cost is on the graphics chip, which a headless measurement cannot stand in for.-The canvas and SVG pages were measured in a scratch run: headless Chrome at 375×812 with pixel ratio 2, the CPU slowed four times (roughly a mid-range phone), the old demos with their stage set to 351×300 (a phone stage), recording how long each animation-frame callback runs and how many frames were drawn in 3 seconds (180 is a full 60 fps). The browser draws the canvas in software there, so frame counts are pessimistic, but they show where the work is.+The canvas and SVG pages were measured in a scratch run: headless Chrome at 375×812 with pixel ratio 2, the CPU slowed four times (roughly a mid-range phone), the old demos with their stage set to a phone stage (351×300 in the first runs, 343×300, the shared phone stage, in the later Canvas Particle Effect runs), recording how long each animation-frame callback runs and how many frames were drawn in 3 seconds (180 is a full 60 fps). The browser draws the canvas in software there, so frame counts are pessimistic, but they show where the work is.| Page | What was measured | Callback median | Frames in 3 s ||---|---|---|---|| Canvas Particle Effect | today's drawing, 250 dots (today's phone default), 100px links | 140 ms | 8 || | today's drawing, 100 dots, 100px links | 18.5 ms | 48 || | today's drawing, 60 dots, 70px links | 3.7 ms | 174 |-| | links batched in six paths, 120 dots, 100px links | 2.6 ms | 91 |-| | same, on a 1000×440 laptop stage at full CPU: today's drawing, 500 dots | 13.5 ms | 96 |-| | links batched, 500 dots, laptop stage, full CPU | 3.4 ms | 148 |+| | links batched in six paths, 40 or 60 dots, 100px links | 1.7–2.4 ms | 159–181 |+| | links batched, 80, 100 or 120 dots, 100px links | 3.3–3.8 ms | 81–90 |+| | links batched, 60 dots, 150px links | 2.0–2.1 ms | 114–131 |+| | links batched, 200 dots, 100px links | 8.1 ms | 30 |+| | links batched, tablet stage 707×440 (pixel ratio 2, CPU ×4): 60 / 90 / 120 dots | 2.1 / 3.1 / 3.1 ms | 180 / 122 / 111 |+| | links batched, tablet stage: 250 / 500 dots | 8.4 / 19.4 ms | 33 / 9 |+| | today's drawing, 1000×440 laptop stage at full CPU, 500 dots | 13.5 ms | 96 |+| | links batched, 960×380 desktop stage at full CPU and pixel ratio 1: 250 / 500 / 800 dots | 2.6 / 2.9 / 5.0 ms | 181 / 177 / 113 || Cloth / Soft-Body Simulation | 16 × 12 points (today's phone default) | 5.2 ms | 102 || | 24 × 18 | 8.1 ms | 82 || | 40 × 30 | 29.2 ms | 43 |@@ -113,7 +118,7 @@ The canvas and SVG pages were measured in a scratch run: headless Chrome at 375| Morphing Blob | 4, 6 or 9 blobs, with the SVG filter | 0.5–0.8 ms | 181 || 2.5D / Pseudo-3D | a continuous camera pan | 0.6 ms | 176 |-Canvas Particle Effect's cost is its links: one `stroke()` per line, thousands a frame. Its section batches the links and draws a quarter of the dots on phones (the same density as on a laptop). Noise-Based Motion places its dots by columns, so a narrow phone stage gets more dots than a laptop; its section places them by spacing instead.+Canvas Particle Effect's cost is its links: one `stroke()` per line, thousands a frame. Its section batches the links and draws far fewer dots on phones and tablets; every phone choice draws close to a full 60 frames a second (159 to 181 of 180 frames in 3 s) with Short and Medium links. Frame counts from 40 to 120 dots were measured twice and ranged as shown. Noise-Based Motion places its dots by columns, so a narrow phone stage gets more dots than a laptop; its section places them by spacing instead.## Pointer and touch@@ -169,7 +174,7 @@ Canvas Particle Effect's cost is its links: one `stroke()` per line, thousands a- The fps and shape badges.- The Mode and Object menus. They become Movement and Shape.- The Spin X and Spin Y sliders, which could reach zero. They become Speed and Tumbles as it spins.- - The Camera Distance slider. It becomes Distance. Close is 2.6 rather than the slider's 2.2: closer than about 2.5, the turning cube's corners leave the stage at some angles.+ - The Camera Distance slider. It becomes Distance. Close is 2.6: closer than about 2.5, the turning cube's corners leave the stage at some angles.- The colour picker. It becomes the Color swatches.- "Wireframe" becomes Edges only.- **Good for:** Product showcases · Hero sections · Logos · 3D previews · **Avoid on:** Long reading pages · Low-power devices@@ -274,11 +279,11 @@ None: leave out the `details.hb-options` block.- **Kind:** do it. The card moves only when the pointer, a finger or Show me moves it.- **Description:** A card tilts toward your pointer, and a light slides over it. Best for cards.-- **Step 1:** Hover it — "Move your pointer over the card, or drag a finger across it."+- **Step 1:** Hover it — "Move your pointer over the card, drag a finger across it, or press Show me."- **Player bar:** Show me. No Reset: the card settles flat by itself when the pointer leaves. No Slow motion: the tilt follows the pointer directly.-- **Show me:** one run of 3 seconds. A pretend pointer circles the card's middle one and a half times, starting and ending at the centre and reaching 40% of the way to the edges halfway through. For progress p from 0 to 1, `r = 0.4*Math.sin(Math.PI*p)` and `a = 3*Math.PI*p`, and each animation frame calls `tilt(r*Math.cos(a), r*Math.sin(a))`. At the end it calls `onLeave()`, so the card settles flat over Return speed. A second press starts the run again from the centre.-- **Stopping a run:** on `hb:input`, and in the card's `pointermove` handler for the visitor's own (trusted) events, the run's frame is cancelled and `onLeave()` runs; the visitor's pointer then tilts the card as usual.-- **Sequence:** `onMove(e)` becomes `tilt(x, y)` (x and y from −0.5 to 0.5) plus a small `onMove(e)` that works out x and y from the event and calls it. Everything else runs as today: `pointerdown` and `pointermove` on the card tilt it, and `pointerleave` and `pointercancel` call `onLeave()`.+- **Show me:** one run of 3 seconds. A pretend pointer starts from where the card is, circles the card's middle one and a half times, reaching 80% of the way to the edges halfway through, and ends in the middle. For progress p from 0 to 1, `r = 0.4*Math.sin(Math.PI*p)` and `a = 3*Math.PI*p`, and each animation frame calls `tilt(x0*(1-p) + r*Math.cos(a), y0*(1-p) + r*Math.sin(a))`, where x0 and y0 are the card's tilt when the run starts (the last values `tilt()` was given; 0 after `onLeave()`). At the end it calls `onLeave()`, so the card settles flat over Return speed. A second press starts a new run from where the card is, as on 2.5D / Pseudo-3D.+- **Stopping a run:** on `hb:input`, only if a run is under way (its frame handle is set): cancel the frame and call `onLeave()`; otherwise do nothing, so a tap does not flatten the card under a resting finger. The card's `pointermove` handler also ends a run that is under way the same way, for the visitor's own (trusted) events, then tilts the card to the pointer.+- **Sequence:** `onMove(e)` becomes `tilt(x, y)` (x and y from −0.5 to 0.5) plus a small `onMove(e)` that works out x and y from the event and calls it. `tilt()` keeps the last x and y it was given (Show me starts from them), and `onLeave()` sets them back to 0. Everything else runs as today: `pointerdown` and `pointermove` on the card tilt it, and `pointerleave` and `pointercancel` call `onLeave()`.- **Reduced motion:** Show me does not run on arrival (the shared script). The demo's reduced-motion rule loses `transform:none!important` on the card and the orbs and `opacity:0!important` on the shine, which would stop Show me and the visitor's own tilt. What stays is `.tilt-card{transition:none!important}` and `.card-shine{transition:none!important}`, so the card snaps flat when the pointer leaves instead of easing back.- **Stage font:** site font. `.card-h` drops Georgia and the italic and gets `font-weight:700`. `.card-over` gets 11px and `font-weight:600` (was 9px); `.card-sub` gets 13px and `rgba(255,255,255,.72)` (was 11px at .55).- **Stage:**@@ -292,7 +297,7 @@ None: leave out the `details.hb-options` block.| Setting | Control | Choices or range (value shown) | Default | Hint | Sets in the demo ||---|---|---|---|---|---|-| Tilt amount | Choice buttons | Small · Medium · Large | Medium | How far the card leans at its edges. | `maxTilt`: 8 / 15 / 25 (degrees) |+| Tilt amount | Choice buttons | Small · Medium · Large | Medium | How far the card leans at its edges. | `maxTilt`: 8 / 15 / 25 (degrees; the pointer's position runs from −0.5 to 0.5, so the card leans half that at its edges) || 3D depth | Choice buttons | Subtle · Medium · Strong | Medium | Strong looks closer and more dramatic. | `--perspective`: 1500px / 1000px / 500px || Shine | Switch | on / off | on | A soft light follows the pointer across the card. | `shineOn` true / false (off also hides the shine at once, as today) |@@ -323,7 +328,7 @@ None: leave out the `details.hb-options` block.| Parameter | Default | Effect ||-----------|---------|--------|- | Tilt amount | Medium | How far the card leans at its edges: small is 8°, medium 15° and large 25°; beyond about 25° it feels unsteady |+ | Tilt amount | Medium | How far the card leans at its edges: small is 4°, medium 7.5° and large 12.5°; much more starts to feel unsteady || 3D depth | Medium | How close the viewer seems: subtle is 1500px, medium 1000px and strong 500px; closer makes the lean more dramatic || Shine | on | A soft light follows the pointer across the card, like light catching a real card || Return speed | Normal | How long the card takes to settle flat when the pointer leaves: slow is 650ms, normal 400ms and fast 250ms |@@ -348,13 +353,14 @@ None: leave out the `details.hb-options` block.- **Watch it help line:** It moves by itself, and the dots move away from your pointer or finger. Pause it to look closely, or turn on slow motion to see each part of the movement.- **Player bar:** Pause (page) · Slow motion (page)- **Sequence:** the canvas loop as in the preamble (`loop(t)`, 16ms gate). Each drawn frame runs `update()` on every particle (the pointer's push or pull within 120px, the speed cap, the move, the bounce), then `draw()`.- - **The links in six batches:** `draw()` puts every link into one of six paths by its opacity step and strokes each path once, in place of one `stroke()` per link. For a pair closer than Link distance, `k = Math.min(5, Math.floor((1 - d2/d2max) * 6))` picks the path, and path k is stroked at opacity `(k + 0.5) / 6 * 0.4` (today's opacity, `(1 - d2/d2max) * 0.4`, in six steps). The dots are drawn as today.+ - **The links in six batches:** `draw()` puts every link into one of six paths by its opacity step and strokes each path once, in place of one `stroke()` per link. For a pair closer than Link distance, `k = Math.min(5, Math.floor((1 - d2/d2max) * 6))` picks the path, and path k is stroked at opacity `(k + 0.5) / 6 * 0.4` (today's opacity, `(1 - d2/d2max) * 0.4`, in six steps). `ctx.lineWidth=.5` stays, set once before the six strokes. The dots are drawn as today.- **The first picture:** `draw()` runs at load, after `spawn()`. **While paused,** every setting and a resize call `draw()` (today's `if(paused)draw()` calls).+ - **The resize handler** returns at once when the stage's size has not changed (`if(stage.clientWidth===W&&stage.clientHeight===H)return;`, as on Cloth / Soft-Body Simulation), so a phone's address bar showing or hiding does not scatter the dots again.- **Slow motion:** while the switch is on, `update()` moves each particle by a third of its velocity (`this.x += this.vx/3`, and the same for y), and the pointer's push or pull adds a third of today's amount, from the next frame. The speed cap stays.- **Reduced motion:** the page's reduced-motion branch (paused at load with one frame drawn) goes (see the preamble).- **Stage font:** no text on the stage.- **Stage:** only the canvas. The fps badge goes. `hb-dots`: no (its dots would mix with the particles). Default height.-- **Phone fallback:** on screens 600px wide or less (today's `innerWidth<=600` test, which today only lowers the default to 250), the page draws a quarter of the dots: 60 · 120 · 200 (checked at each `spawn()`, so turning a phone does not leave a stale count). A phone stage has about a quarter of a laptop stage's area, so the dots stay as dense as on a laptop. With the batched links, 120 dots take 2.6ms a frame on the throttled phone, against 140ms for today's 250 dots (see the preamble).+- **Phone fallback:** the number of dots depends on the screen's width, checked at each `spawn()` (today's `innerWidth<=600` test only lowered the default to 250): up to 600px (phones) 30 · 45 · 60; up to 1024px (tablets) 60 · 90 · 120; wider 250 · 500 · 800. Measured with the batched links on the throttled phone (see the preamble): 40 or 60 dots draw close to a full 60 frames a second with Medium links (159 to 181 frames in 3 s), at 1.7–2.4ms of script a frame, where today's 250 took 140ms; from 80 dots on, the browser's drawing falls to about 28 frames a second, which is why Many stops at 60 on phones. Long links cost more (60 dots: 114–131 frames in 3 s). On a tablet stage, 60, 90 and 120 dots drew 180, 122 and 111 frames in 3 s, at 2–3ms of script a frame.- **Touch:** `touchstart` also sets the pointer's position (today only `touchmove` does), so a finger resting on the stage pushes the dots too. `touchend` and `touchcancel` still clear it.**Main settings**@@ -362,7 +368,7 @@ None: leave out the `details.hb-options` block.| Setting | Control | Choices or range (value shown) | Default | Hint | Sets in the demo ||---|---|---|---|---|---|| Pointer effect | Choice buttons | Push · Pull · None | Push | What your pointer or finger does to nearby dots. | `FORCE`: −0.5 / 0.5 / 0 |-| Number of particles | Choice buttons | Few · Medium · Many | Medium | More dots make more links; phones draw a quarter. | `COUNT`: 250 / 500 / 800 (60 / 120 / 200 on phones), then `spawn()` |+| Number of particles | Choice buttons | Few · Medium · Many | Medium | More dots make more links; phones and tablets draw fewer. | `COUNT`: 250 / 500 / 800 on screens wider than 1024px, 60 / 90 / 120 up to 1024px, 30 / 45 / 60 up to 600px (the width is checked at each `spawn()`), then `spawn()` || Link distance | Choice buttons | None · Short · Medium · Long | Medium | How close two dots must be to join with a line. | None: `CONNECTIONS` false; Short · Medium · Long: `CONNECTIONS` true and `DIST` 70 / 100 / 150 |**More options**@@ -384,7 +390,7 @@ None: leave out the `details.hb-options` block.- **Good for:** Hero sections · Tech sites · Loading screens · Dark backgrounds · **Avoid on:** Long reading pages · Busy layouts- **Prompt:**- > Add a particle background to [the section you want it behind]. Draw small dots on a canvas, give each its own direction, and bounce them off the edges. When the settings include lines, join any two dots that come close with a thin line that fades as they move apart, so a network keeps forming and breaking. Dots near the pointer, or a finger on touch screens, can be pushed away or pulled in. Checking every pair of dots gets slow quickly, so draw a quarter as many dots on phones and stroke the lines in a few batches rather than one at a time. If the visitor has reduced motion turned on, show the dots still. Match the settings listed below.+ > Add a particle background to [the section you want it behind]. Draw small dots on a canvas, give each its own direction, and bounce them off the edges. When the settings include lines, join any two dots that come close with a thin line that fades as they move apart, so a network keeps forming and breaking. Dots near the pointer, or a finger on touch screens, can be pushed away or pulled in. Checking every pair of dots gets slow quickly, so draw far fewer dots on phones and tablets, and stroke the lines in a few batches rather than one at a time. If the visitor has reduced motion turned on, show the dots still. Match the settings listed below.- **README What it is:** rewritten:@@ -395,7 +401,7 @@ None: leave out the `details.hb-options` block.| Parameter | Default | Effect ||-----------|---------|--------|| Pointer effect | Push | What the pointer or a finger does to dots within 120px: pushes them away, pulls them in, or nothing |- | Number of particles | Medium | Few is 250, medium 500 and many 800 dots; phones draw a quarter (60, 120 and 200), which keeps the same density on a smaller stage |+ | Number of particles | Medium | Few is 250, medium 500 and many 800 dots on computers; tablets draw 60, 90 and 120, and phones 30, 45 and 60, which keeps them smooth || Link distance | Medium | How close two dots must be to join with a line: short is 70px, medium 100px and long 150px; none draws no lines || Speed | Normal | How fast the dots drift: slow is 0.5, normal 0.8 and fast 1.3 (the fastest dots' pixels a frame); slow feels calm, fast looks busy || Color | Blue | The color of the dots and lines |@@ -422,6 +428,7 @@ None: leave out the `details.hb-options` block.}}}+ ctx.lineWidth = 0.5;paths.forEach((path, k) => {ctx.strokeStyle = `rgba(88, 166, 255, ${(k + 0.5) / 6 * 0.4})`;ctx.stroke(path);@@ -431,7 +438,7 @@ None: leave out the `details.hb-options` block."Stroking each link on its own costs one draw call per line, thousands a frame; grouping the links into six opacity steps draws them all in six calls, with no visible difference."- **README Production notes:**- The `ctx.clearRect` bullet's "(enable "trails" toggle in the demo)" becomes "(turn on Trails in the demo)".- - Add a bullet after "O(n²) limit": "**Phones**: the demo draws a quarter as many dots on screens 600px wide or less, which keeps a laptop's density on a smaller stage, and strokes the links in six batches instead of one call per line."+ - Add a bullet after "O(n²) limit": "**Phones and tablets**: the demo draws 30 to 60 dots on screens 600px wide or less and 60 to 120 up to 1024px, and strokes the links in six batches instead of one call per line."- The rest is unchanged.- **Category line:** `06.04 · 3D & Advanced`- **Pager:** Previous: Parallax 3D Tilt (`../parallax-3d-tilt/`) · Next: Fluid / Liquid Simulation (`../fluid-simulation/`)@@ -527,8 +534,8 @@ None: leave out the `details.hb-options` block.- "Still" / "Fixed frost" / "The blur stays the same." (was "Static" / "Fixed Frost" / "Constant blur at the configured intensity. The baseline glass effect.")- "Animated" / "Breathing frost" / "The blur grows and fades." (was "Blur cycles 8px → 20px → 8px — the frost intensifies and recedes.")- "Shifting" / "Shifting tint" / "The tint keeps changing." (was "Tint Cycle" / "Frost color rotates through the palette over 8 seconds.")- - **Phones:** today the cards wrap into one column, and the 300px stage would show only the first. Under `@media(max-width:600px)` the three cards sit in one row: `.stage{gap:8px;padding:12px;flex-wrap:nowrap}`, `.glass-card{width:auto;flex:1 1 0;min-width:0;min-height:0;padding:12px 8px;border-radius:12px;gap:6px}`, `.card-title` 13px, `.card-tag` 10px with 1px letter spacing, and `.card-body` 12px with `line-height:1.4`. Previewed: about 100×145px cards on a 375px phone and 82px wide on a 320px phone, all text inside.- - On computers and tablets the cards stay in one row as today (180×200px).+ - **Phones:** today the cards wrap into one column, and the 300px stage would show only the first. Under `@media(max-width:600px)` the stage becomes a grid of three equal columns, and the cards share one row at one height: `.stage{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-content:center;align-items:stretch;gap:8px;padding:12px}` (the blobs are absolutely positioned, so they stay out of the grid), `.glass-card{width:auto;min-width:0;min-height:0;padding:12px 8px;border-radius:12px;gap:6px}`, `.card-title` 13px, `.card-tag` 10px with 1px letter spacing, and `.card-body` 12px with `line-height:1.4`. Measured with the site font: three 100×137px cards on a 375px phone and three 82×137px cards on a 320px phone, all text inside.+ - On computers and tablets the cards stay in one row as today (180×200px on computers, 145×200px on a tablet).- `hb-dots`: no. Default height.- **Phone fallback:** today's stays: the blobs blur 36px on phones instead of 60px. The glass blur only covers the three small cards.@@ -602,7 +609,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:** `pointerdown` also sets the pointer's position, so with Reacts to the pointer a tap bends the pattern there.+- **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 new position shows at the next Play or setting change.**Main settings**@@ -646,7 +653,21 @@ None: leave out the `details.hb-options` block.- [Fluid / Liquid Simulation](../fluid-simulation/) — blobs drawn by the same one-surface shader setup- [Ray Marching / SDF Scene](../ray-marching-sdf/) — a whole 3D scene drawn by one shader- [Noise-Based Motion](../noise-based-motion/) — moving patterns drawn on a 2D canvas instead-- **README How it works:** unchanged+- **README How it works:** in the first snippet, `render()` adds up its own clock, as the demo does, in place of `ts / 1000 * speed`:++ ```js+ let t = 0, last = 0;+ function render(ts) {+ if (last) t += Math.min(ts - last, 100) / 1000 * speed; // add up time, so a new speed never jumps+ last = ts;+ gl.uniform2f(uRes, W, H);+ gl.uniform1f(uT, t);+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);+ requestAnimationFrame(render);+ }+ ```++ The rest is unchanged.- **README Production notes:** unchanged- **Category line:** `06.07 · 3D & Advanced`- **Pager:** Previous: Glassmorphism Animated (`../glassmorphism-animated/`) · Next: Noise-Based Motion (`../noise-based-motion/`)@@ -739,6 +760,7 @@ None: leave out the `details.hb-options` block.- **Stage:** only the drawing.- The three preset tabs on the stage move to Try it as Drawing. The label under the drawing and the Path length readout go.- `svg{…}` becomes `.stage svg{…}`, so it cannot size the page's icons.+ - `#svg-stage` gets `role="img"` and an `aria-label` naming the drawing, set with each play from Drawing: "House and star icon", "Signature" or "Logo mark". Screen readers then find the whole drawing as one labelled image from the start, as What it is says.- The stage keeps `background:#04060c`, its flex centring and 24px padding. The drawing fits: previewed at 343×300 and 288×300.- `hb-dots`: yes. Default height.- **Phone fallback:** none needed.@@ -777,7 +799,7 @@ None: leave out the `details.hb-options` block.- **README What it is:** rewritten:- > An SVG path animation makes a line drawing appear as if drawn by hand. Each line is hidden behind a dash exactly as long as the line, and sliding that dash away uncovers the line from one end to the other. The whole drawing is in the page from the start, so screen readers can always find it.+ > An SVG path animation makes a line drawing appear as if drawn by hand. Each line is hidden behind a dash exactly as long as the line, and sliding that dash away uncovers the line from one end to the other. The whole drawing is in the page from the start, with a label, so screen readers can always find it.- **README Key parameters:**@@ -866,7 +888,7 @@ None: leave out the `details.hb-options` block.| Setting | Control | Choices or range (value shown) | Default | Hint | Sets in the demo ||---|---|---|---|---|---|| Soft color edges | Switch | on / off | off | Blurs the colored copies, like a real lens. | `--ca-blur`: 2px / 0px |-| Your text | Text (`input.hb-text`) | any text | PRISM | Short words work best. | `setText(txtIn.value.trim())` on input (blank falls back to "PRISM") |+| Your text | Text (`input.hb-text`) | any text | PRISM | Short words work best. | on input, `setText(v.trim() ? v : 'PRISM')` with `v = txtIn.value`: blank falls back to "PRISM", other text stays as typed |- **Removed:**- The note.@@ -908,14 +930,14 @@ None: leave out the `details.hb-options` block.- **Kind:** do it. Nothing moves until the pointer, a finger or Show me moves the camera.- **Description:** Flat layers slide by different amounts, faking depth. Best for hero scenes.-- **Step 1:** Hover it — "Move your pointer across the scene, or drag a finger sideways."+- **Step 1:** Hover it — "Move your pointer across the scene, drag a finger sideways, or press Show me."- **Player bar:** Show me · Reset. No Slow motion: the camera follows the pointer directly.- **Show me:** one run of 3 seconds: the camera sweeps right, back through the middle, left and back, dipping a little, then rests in the middle. For progress p from 0 to 1 and the camera's position when the run starts (`x0 = mx`, `y0 = my`), each animation frame calls `applyParallax(x0*(1-p) + 0.45*Math.sin(2*Math.PI*p), y0*(1-p) + 0.2*Math.sin(Math.PI*p))`. At the end `mx = my = 0`. A second press starts again from where the camera is.-- **Stopping a run:** on `hb:input`, and in the stage's `pointermove` handler for the visitor's own (trusted) events, the run's frame is cancelled and the camera stays where it is; the visitor's pointer moves it from then on.+- **Stopping a run:** on `hb:input`, only if a run is under way (its frame handle is set): cancel the frame, leaving the camera where it is; otherwise do nothing. The stage's `pointermove` handler also ends a run that is under way the same way, for the visitor's own (trusted) events, then moves the camera to the pointer.- **Reset:** stops a run, sets `mx = my = 0` and calls `applyParallax(0,0)` (today's Reset camera, without the readout).- **Sequence:** the Mode menu and `autoLoop()` go (Auto-pan becomes Show me). The pointer moves the camera as today (`pointermove` → `applyParallax(mx,my)`), and the camera stays where the pointer leaves it, as today.- **Reduced motion:** Show me does not run on arrival. The page's `motionOk` branch goes with the Mode menu. The rule `.scene-inner{transition:none!important}` can stay (it changes nothing).-- **Stage font:** site font. The layer labels get 11px and `font-weight:600` (were 8px) and read "moves 5%" to "moves 100%" (were "depth 0.05" to "depth 1.0"). Their stagger becomes `top = 4 + i*16` px so the larger labels do not overlap, and `MAX_PAN` becomes 35 (half the largest Camera movement; the slider it read goes).+- **Stage font:** site font. The layer labels get 11px and `font-weight:600` (were 8px) and read "moves 5%" to "moves 100%" (were "depth 0.05" to "depth 1.0"). Their stagger becomes `top = 4 + i*16` px so the larger labels do not overlap, and `MAX_PAN` becomes 35 (half the largest Camera movement; the slider it read goes). The labels move to the top-left corner (`left` in place of `right`, with the same inset, `6 + pad + MAX_PAN*depth`): on the right, their column crossed the moon on phones. Checked at the laptop, tablet and both phone stages: every label stays clear of the moon.- **Stage:**- The seven layers, the custom cursor ring and the labels stay. `cursor:none` and `touch-action:pan-y` stay.- **A smaller scene.** The scene was drawn for a 620px stage: on the shared 300–440px stage the mountains' peaks are cut off and the moon hides behind the hills. Its fixed sizes shrink to about 0.7 (the hills to 0.6), previewed at the laptop, tablet and both phone stages with the peaks, the moon and the tree line all in view:@@ -959,26 +981,36 @@ None: leave out the `details.hb-options` block.| Parameter | Default | Effect ||-----------|---------|--------|- | Camera movement | Medium | How far the nearest layer moves as the pointer crosses the scene: small is 20px, medium 40px and large 70px; the farthest layer moves 5% of that |+ | Camera movement | Medium | How far the nearest layer travels as the pointer crosses the scene from one side to the other: small is 20px, medium 40px and large 70px (half that each way from the middle); the farthest layer moves 5% of that || Layer labels | off | Labels each layer with the share of the camera movement it follows, from 5% for the sky to 100% for the ground |- **README See also:**- [Parallax Depth-of-Field](../../01-scroll-based/parallax-depth-of-field/) — the same layered depth, driven by scrolling- [Parallax 3D Tilt](../parallax-3d-tilt/) — one card leans toward the pointer- [Scroll-Driven 3D Rotation](../scroll-driven-3d-rotation/) — scrolling moves a 3D object-- **README How it works:** the sentence "For an **auto-pan** camera, drive the norm values with sine:" and its snippet become "For **Show me**, the demo drives the same layers with a three-second sweep instead of the pointer, ending in the middle:" and:+- **README How it works:** two changes, so the snippets match the demo:+ - The first snippet listens for `pointermove`, as the demo does, and measures the pointer against the stage's box. Its first three lines become:- ```js- function sweep(now) { // start = performance.now() when Show me is pressed- const p = Math.min(1, (now - start) / 3000);- const normX = 0.45 * Math.sin(2 * Math.PI * p);- const normY = 0.2 * Math.sin(Math.PI * p);- LAYERS.forEach(({ el, depth }) => {- el.style.transform = `translate(${-normX * STRENGTH * depth}px, ${-normY * STRENGTH * depth * 0.4}px)`;- });- if (p < 1) requestAnimationFrame(sweep);- }- ```+ ```js+ stage.addEventListener('pointermove', e => {+ const r = stage.getBoundingClientRect();+ const normX = (e.clientX - r.left) / r.width - 0.5; // -0.5 to 0.5+ const normY = (e.clientY - r.top) / r.height - 0.5;+ ```++ - The sentence "For an **auto-pan** camera, drive the norm values with sine:" and its snippet become "For **Show me**, the demo drives the same layers with a three-second sweep instead of the pointer, ending in the middle:" and:++ ```js+ function sweep(now) { // start = performance.now() when Show me is pressed+ const p = Math.min(1, (now - start) / 3000);+ const normX = 0.45 * Math.sin(2 * Math.PI * p);+ const normY = 0.2 * Math.sin(Math.PI * p);+ LAYERS.forEach(({ el, depth }) => {+ el.style.transform = `translate(${-normX * STRENGTH * depth}px, ${-normY * STRENGTH * depth * 0.4}px)`;+ });+ if (p < 1) requestAnimationFrame(sweep);+ }+ ```The rest is unchanged.- **README Production notes:** unchanged@@ -1132,13 +1164,15 @@ None: leave out the `details.hb-options` block.- **Kind:** do it. The picture bends only where the pointer, a finger or Show me touches it.- **Description:** The picture ripples and bends around your pointer. Best for portfolio images.-- **Step 1:** Hover it — "Move your pointer over the picture, or drag a finger across it."+- **Step 1:** Hover it — "Move your pointer over the picture, drag a finger across it, or press Show me."- **Player bar:** Show me. No Reset: the distortion fades by itself. No Slow motion.-- **Show me:** one run of 3 seconds: a pretend pointer crosses the picture from left to right along a gentle S, then lets go, and the distortion fades over Fade-out speed. The render loop drives it: while a run is under way, each frame sets `mouseX = W*(0.2 + 0.6*p)` and `mouseY = H*(0.5 + 0.18*Math.sin(2*Math.PI*p))` (backing-store pixels, p from 0 to 1), `active = true` and `amp = 1`; when p reaches 1, `active = false` and the run ends. A second press starts again from the left.-- **Stopping a run:** on `hb:input`, and in the stage's `track()` handler for the visitor's own (trusted) events, the run ends and `active = false`; `track()` then follows the visitor's pointer as today.-- **Sequence:** the render loop runs all the time, as today when not paused: `paused`, `poke()` and the Pause button go (a do-it page has no Pause).+- **Show me:** one run of 3 seconds: a pretend pointer crosses the picture from left to right along a gentle S, then lets go, and the distortion fades over Fade-out speed. The render loop drives it: while a run is under way, each frame sets `mouseX = W*(0.2 + 0.6*p)` and `mouseY = H*(0.5 + 0.18*Math.sin(2*Math.PI*p))` (backing-store pixels, p from 0 to 1), `active = true` and `amp = 1`; when p reaches 1, `active = false` and the run ends. A second press starts again from the left. Show me wakes the render loop when it has stopped (see Sequence).+- **Stopping a run:** on `hb:input`, only if a run is under way: end it and set `active = false`; otherwise do nothing, so a tap does not start fading the distortion under a resting finger. The stage's `track()` handler also ends a run that is under way, for the visitor's own (trusted) events, then follows the visitor's pointer as today.+- **Sequence:** `paused`, `poke()` and the Pause button go (a do-it page has no Pause).+ - **The render loop runs only while something moves.** After drawing a frame, `render()` requests the next one only while the pointer is on the picture (`active`), the distortion is still fading (`amp > 0`) or a Show me run is under way; otherwise it sets `raf = null` and stops, so a picture at rest is not redrawn 60 times a second. A frame skipped by today's 15ms gate still requests the next one. `wake()` starts the loop again when it has stopped (it sets `lastT` and `startT` to `performance.now()`, so `phase` does not jump, then requests a frame); `track()` and Show me call it.+ - **The first picture:** `draw()` at load. While the loop is stopped, a resize and every setting call `draw()` once (a resize clears the canvas).- **The picture stands still:** the shader's `uT` stays 0. Today the pattern drifts slowly by itself; a real image would not, and a do-it page moves only when the visitor or Show me moves it.- - `phase` and the fade (`amp`) run as today.+ - `phase` and the fade (`amp`) run as today while the loop runs.- **Reduced motion:** the page's reduced-motion branch goes. With the picture still, nothing on the stage moves until the visitor or Show me does.- **Stage font:** no text on the stage; `.fallback` uses the site font.- **Stage:** only the canvas. The fps badge and the shader source panel go. `touch-action:none` on the canvas stays. `hb-dots`: no. Default height.@@ -1192,8 +1226,8 @@ None: leave out the `details.hb-options` block.- [WebGL Shader Animation](../webgl-shader-animation/) — the same shader setup, painting patterns- [Parallax 3D Tilt](../parallax-3d-tilt/) — a card leans toward the pointer instead of bending- [Fluid / Liquid Simulation](../fluid-simulation/) — a liquid look that follows the pointer-- **README How it works:** unchanged, plus one sentence after the procedural-texture snippet: "In the demo the pattern stands still, as a real image would: its time value stays at 0, and only the distortion moves."-- **README Production notes:** unchanged+- **README How it works:** unchanged, plus two sentences after the procedural-texture snippet: "In the demo the pattern stands still, as a real image would: its time value stays at 0, and only the distortion moves. Once the pointer has gone and the fade has finished, the demo stops drawing, and the pointer or Show me starts it again."+- **README Production notes:** in the "Backing store and DPR" bullet, "so a paused or reduced-motion demo has to repaint after a resize or it goes black" becomes "so a demo that is not drawing every frame (this one stops at rest) has to repaint after a resize or it goes black". The rest is unchanged.- **Category line:** `06.14 · 3D & Advanced`- **Pager:** Previous: GPGPU Particle System (`../gpgpu-particle-system/`) · Next: Cloth / Soft-Body Simulation (`../cloth-simulation/`)@@ -1207,10 +1241,11 @@ None: leave out the `details.hb-options` block.- **Player bar:** Pause (page) · Reset. No Slow motion: each frame is one physics step, and slowing the steps would change how stiff the cloth is.- **Reset:** hangs a fresh cloth (`initCloth()`, today's Reset cloth). While paused it shows the fresh cloth still.- **Sequence:** the canvas loop as in the preamble (`loop(ts)`, 16ms gate). Each drawn frame runs `update()`, then `draw()`, as today.- - **The first picture:** `initCloth()` draws the cloth at load (today it draws only while paused).+ - **Two functions in place of today's `start()`,** which both rebuilt the cloth and started the loop: `rebuild()` is `resize(); initCloth();`, for Detail and for a resize; `resume()` is `if(raf)return; lastT=performance.now(); raf=requestAnimationFrame(loop);`, for Play (`hb:pause` with `paused` false). At load the page runs `rebuild()`, then `resume()`.+ - **The first picture:** `initCloth()` draws the cloth (today it draws only while paused), so `rebuild()` at load shows it.- **While paused,** Hangs from and Detail show a fresh cloth, Shows the points redraws, and Wind, Gravity and Stiffness show at the next Play (they change how it moves).- **Dragging does nothing while paused:** the `if(paused){update();draw();}` line in the `pointermove` handler goes, so a paused cloth stays still.- - The resize handler rebuilds the cloth, as today.+ - The resize handler keeps its guard (it returns when the stage's size has not changed) and calls `rebuild()`.- **Reduced motion:** the page's `paused=matchMedia(…).matches` start goes, and so does the rule `*,*::before,*::after{animation:none!important;transition:none!important}` (see the preamble).- **Stage font:** no text on the stage.- **Stage:** only the canvas. The fps badge goes. `touch-action:none` on the stage and the canvas stays (dragging needs it). `hb-dots`: no. Default height.@@ -1230,7 +1265,7 @@ None: leave out the `details.hb-options` block.| Setting | Control | Choices or range (value shown) | Default | Hint | Sets in the demo ||---|---|---|---|---|---|| Gravity | Choice buttons | Light · Normal · Heavy | Normal | Heavy cloth hangs straighter and falls faster. | `GRAVITY`: 0.06 / 0.12 / 0.2 |-| Detail | Choice buttons | Low · Medium · High | Medium (Low on phones) | More points make finer folds; phones start at Low. | `COLS`: 16 / 24 / 40, with `ROWS=Math.round(COLS*.75)`, then `start()` |+| Detail | Choice buttons | Low · Medium · High | Medium (Low on phones) | More points make finer folds; phones start at Low. | `COLS`: 16 / 24 / 40, with `ROWS=Math.round(COLS*.75)`, then `rebuild()` || Shows the points | Switch | on / off | off | Marks each point; pinned ones are red. | `SHOW_VERTS` true / false, then `draw()` while paused |- **Removed:**@@ -1280,7 +1315,7 @@ None: leave out the `details.hb-options` block.- **Watch it help line:** default- **Player bar:** Pause (page) · Slow motion (page)- **Sequence:** the WebGL loop as in the preamble (`render(ts)`, 16ms gate).- - **The clock:** the page keeps its own clock, `curT` (each frame's time, at most 50ms, and nothing on the first frame after a start), in place of `(ts-startT)/1000`. `startT` and `pausedAt` go.+ - **The clock:** the page keeps its own clock, `curT` (each frame's time, at most 50ms, and nothing on the first frame after a start), in place of `(ts-startT)/1000`. `startT` and `pausedAt` go. `curT` starts at 2 (today's value) and `rise` (below) at 1.2, 2 × the default Speed, so the first picture is today's still frame.- **The rise:** the page also keeps `rise`, which adds the same step × Speed. The shader takes `uniform float uRise` and `density()` uses `fbm(q*1.4+vec3(0.,uRise*.4,0.))` in place of `t*uSpd*.4`, so a new Speed never makes the smoke jump (today the rise is the time × the speed). The wind drift still follows the clock.- **The first picture:** `draw(curT)` at load. **While paused,** settings call `refresh()` and a resize redraws, as today.- **Slow motion:** while the switch is on, the clock and the rise add a third of each frame's step, from the next frame.@@ -1352,9 +1387,9 @@ None: leave out the `details.hb-options` block.- **Watch it help line:** It moves by itself, and one drop follows your pointer or finger. Pause it to look closely, or turn on slow motion to see each part of the movement.- **Player bar:** Pause (page) · Slow motion (page)- **Sequence:** an animation-frame loop moving SVG circles.- - `frame(t)` splits into `step(dt)` (the drift phase and the drop's chase) and `place()` (writes each circle's `cx`, `cy` and `r`); each frame runs both.+ - `frame(t)` splits into `step(dt)` and `place()`, and each frame runs both. `step(dt)` only advances `phase` and moves the drop toward the pointer. `place()` works out every drifting circle's position from `phase`, as today's `frame()` does (`b.x = b.bx + Math.sin(phase*b.sx + b.px)*b.ax`, `b.y = b.by + Math.cos(phase*b.sy + b.py)*b.ay`), and writes every circle's `cx`, `cy` and `r` (the drop at its own `x`, `y`).- `start()` returns when `raf` is set; otherwise it forgets the last frame's time, so the first frame after a start adds nothing (today `Math.min(time-last,0.1)` could add a tenth of a second at once), and requests a frame.- - **The first picture:** `place()` at load, after `build()`. **While paused,** Number of blobs rebuilds and calls `place()`; Gooeyness shows at once (it is an attribute of the filter); Speed shows at the next Play. The drop's target still follows the pointer, and the drop catches up after Play.+ - **The first picture:** `place()` at load, after `build()`: the circles appear where the first moving frame continues from, so Play never snaps. (`build()` only creates the circles and sets no position or size on them; today's still picture came from `paintStatic()`, which goes.) **While paused,** Number of blobs rebuilds and calls `place()` the same way; Gooeyness shows at once (it is an attribute of the filter); Speed shows at the next Play. The drop's target still follows the pointer, and the drop catches up after Play.- **Slow motion:** while the switch is on, `phase` adds a third (`dt*speed/3`) and the drop closes 0.03 of the gap each frame in place of 0.09, from the next frame.- **Reduced motion:** `reduce` goes, with `speed=0` and `paintStatic()`; the `.tip` rule goes with the tip (see the preamble).- **Stage font:** no text on the stage.@@ -1412,10 +1447,10 @@ None: leave out the `details.hb-options` block.- **Kind:** do it. The card turns only when it is clicked, tapped, hovered (with Flips on hover) or shown by Show me.- **Description:** A card turns over in 3D to show its back. Best for profile and product cards.-- **Step 1:** Click it — "Click the card, or tap it, to turn it over."+- **Step 1:** Click it — "Click or tap the card to turn it over, or press Show me."- **Player bar:** Show me · Reset · Slow motion (css)- **Show me:** one click's worth, about 2.5 seconds at Normal: `setFlipped(true)` at once; after Speed + 1200ms (Speed × 3 + 1200ms while Slow motion is on), `setFlipped(false)`. It ends on the front. A second press clears the pending timer and starts again.-- **Stopping a run:** on `hb:input` the pending timer is cleared and the card stays as it is; the visitor's click, tap or key then turns it as usual.+- **Stopping a run:** on `hb:input`, only if a run is under way (its timer is pending): clear the timer, leaving the card as it is; otherwise do nothing. The visitor's click, tap or key then turns it as usual.- **Reset:** stops a run, calls `setFlipped(false)` and sets the tilt flat (`tilt.style.transform='rotateX(0deg) rotateY(0deg)'`).- **Sequence:** as today. A click, a tap, Enter or Space turns the card over; with Flips on hover, pointing turns it and leaving turns it back, and a tap still turns it on touch screens. While idle under a hovering pointer, the card leans toward it (Tilt toward the pointer). The "Flip card" button goes: Show me demonstrates the flip, and the card itself is the control.- **Slow motion:** css: the flip and the tilt's return run at a third of their speed, and Show me's wait uses Speed × 3 while the switch is on.@@ -1423,10 +1458,10 @@ None: leave out the `details.hb-options` block.- **Stage font:** site font. `.avatar` and `.front .name` drop `var(--disp)` (their weights 800 and 700 stay). `.front .hint` and `.back .hint` get 11px and `rgba(255,255,255,.6)` (were 9px at .4); `.back .over` gets 11px and `font-weight:600` (was 9px).- **Stage:**- The card only, directly in the stage; the `.stage-wrap` wrapper goes.- - **The card is sized from the stage's height.** Today's width formula assumes the old 360–560px stage, and the card overflows the 300px phone stage. `.tilt` gets `height:100%`, and `.card` gets `height:min(100%,420px);width:auto;aspect-ratio:5/7` in place of its width formula. Previewed: 184×258px on a 375px phone (both faces' text inside), 164×229px on the 1366×657 laptop and 269×377px on a tablet.+ - **The card is sized from the stage's height.** Today's width formula assumes the old 360–560px stage, and the card overflows the 300px phone stage. `.tilt` gets `height:100%;align-items:center`, which centres the card on the stage and on the perspective's vanishing point, and `.card` gets `height:min(95%,340px);width:auto;aspect-ratio:5/7` in place of its width formula. Measured: 175×245px on both phones (both faces' text inside), 243×340px on a tablet, 155×218px on the 1366×657 laptop and 191×268px on a 1280×800 screen. Probed from 70° to 89.5° on both axes at Strong depth, nothing is clipped at any of those sizes; a card filling the stage's height (`min(100%,420px)`) was clipped by 4px on phones and 24px on a tablet.- Card text: the front hint becomes "Tap or click to flip →" (was "Click / tap / Enter to flip →"). The name, role, rows and the back's hint stay.- `.front .role` and `.back .over` use `#b98cff` directly, the card's own purple, since `--ui-accent` becomes the category's teal. `.card:focus-visible` keeps `var(--ui-accent)`.- - The stage keeps its radial gradient, its `clamp(20px,4vw,48px)` padding and `perspective:var(--perspective)`; its own height goes. The shared `overflow:hidden` applies: the card fits, and only at Strong depth can a few pixels of its near edge pass the padding halfway through a turn.+ - The stage keeps its radial gradient, its `clamp(20px,4vw,48px)` padding and `perspective:var(--perspective)`; its own height goes. The shared `overflow:hidden` applies; the card fits at every depth and angle (above).- `hb-dots`: no (the stage keeps its gradient). Default height.- **Phone fallback:** none needed.- **Touch:** as today: a tap turns the card. The idle tilt stays off on touch screens (`@media(hover:none)` and the `canHover` check), because it follows a hovering pointer; turning the card is the tap equivalent.@@ -1444,7 +1479,7 @@ None: leave out the `details.hb-options` block.| Setting | Control | Choices or range (value shown) | Default | Hint | Sets in the demo ||---|---|---|---|---|---|| Flips on hover | Switch | on / off | off | Pointing flips it; a tap still flips it on phones. | `trigger`: `'hover'` / `'click'`; switching it on turns the card to its front, as today |-| Tilt toward the pointer | Choice buttons | Off · Gentle · Strong | Gentle | The card leans toward a hovering pointer. | `maxTilt`: 0 / 10 / 18 (degrees; Off also sets the tilt flat, as today) |+| Tilt toward the pointer | Choice buttons | Off · Gentle · Strong | Gentle | The card leans toward a hovering pointer. | `maxTilt`: 0 / 10 / 18 (degrees; the card leans half that at the stage's edges; Off also sets the tilt flat, as today) |- **Removed:**- The note.@@ -1468,7 +1503,7 @@ None: leave out the `details.hb-options` block.| Speed | Normal | How long one turn takes: slow is 1000ms, normal 650ms and fast 400ms; 600 to 900ms feels physical || 3D depth | Medium | How close the viewer seems: subtle is 2000px, medium 1200px and strong 600px; closer exaggerates the turn || Flips on hover | off | Pointing at the card turns it over and leaving turns it back; a tap still turns it on touch screens |- | Tilt toward the pointer | Gentle | While idle, the card leans up to 10° (gentle) or 18° (strong) toward a hovering pointer; off keeps it flat |+ | Tilt toward the pointer | Gentle | While idle, the card leans toward a hovering pointer, up to 5° (gentle) or 9° (strong) at the stage's edges; off keeps it flat |- **README See also:** each line gets a phrase, as the page checks require.- [Parallax 3D Tilt](../parallax-3d-tilt/) — a card leans toward the pointer without turning over