Skip to content

176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.

docs: say how far from the card's edge the Parallax 3D Tilt change shows

matin77312149c4d6
diff --git a/docs/superpowers/plans/2026-09-29-3d-content.md b/docs/superpowers/plans/2026-09-29-3d-content.md
index 86404ad8..413cc97b 100644
--- a/docs/superpowers/plans/2026-09-29-3d-content.md
+++ b/docs/superpowers/plans/2026-09-29-3d-content.md
@@ -287,7 +287,7 @@ None: leave out the `details.hb-options` block.
- **Only `transform` and `opacity` change while the card follows the pointer, a finger or Show me (fix round 1).** CLAUDE.md's rule "transform and opacity only — never animate `box-shadow`" governs over "as today" (the coordinator's ruling for this page, following the one on Task 7 that CLAUDE.md's rules govern over the sheet). Today's `tilt()` wrote `card.style.boxShadow` and rewrote the shine's gradient on every frame, and the shadow was part of the card's transition; either repaints the whole card. A trace of 1.5 s of Show me (phone stage, 375×812 at pixel ratio 2) showed 183 paint events and 98 to 135 raster tasks (about 250 ms of raster time); after the change it shows 4 paint events and 16 raster tasks (about 10 to 18 ms), and on a 1280×800 stage 4 paints against 181 to 185.
- The card keeps its resting CSS shadow (`0 20px 60px rgba(0,0,0,.6)`), which turns with the card. Both writes to `boxShadow` go (`tilt()` and `onLeave()`), and the transition is `transform var(--reset-dur) ease` only.
- The shine is one fixed gradient on a layer of its own: `.card-shine{position:absolute;left:0;top:0;width:var(--shine-d,0);height:var(--shine-d,0);margin:calc(var(--shine-d,0px) / -2) 0 0 calc(var(--shine-d,0px) / -2);background:radial-gradient(circle closest-side,rgba(255,255,255,.18) 0%,transparent 65%);opacity:0;pointer-events:none;transition:opacity .3s;will-change:transform}`, a square twice as wide as the card's diagonal with its middle on the card's top left corner (the card's `overflow:hidden` clips it). `tilt()` reads `W = card.clientWidth` and `H = card.clientHeight` before it writes the card's transform, sets `--shine-d` (`D = 2*Math.hypot(W,H)`) on the card only when it changes, and moves the layer with `shine.style.transform = translate((x+.5)*W px, (y+.5)*H px) scale(2*R/D)`, where `R = Math.hypot((.5+Math.abs(x))*W, (.5+Math.abs(y))*H)` is the radius today's gradient has (a `circle` reaches the farthest corner). The Shine switch, `onLeave()` and the reduced-motion rule still work on the shine's `opacity`.
- - The card and the light look as before. Against the page as it was (shadow and gradient written every frame), at eight poses (two corners, the middle and five others), three pairs of settings (Medium and Medium, Large and Strong, Small and Subtle) and stages of 1280×800, 375×812 (pixel ratio 2) and 1280×590, no pixel of the stage differs by more than 27 levels of a channel, the mean difference is under 1.1 levels, and at most 0.45% of the pixels differ by more than 8 levels. Those pixels are the one-pixel rim of the card, where its edge blends with the shadow just outside it: at the middle pose the old shadow was centred under the card and the CSS one falls 20px below it.
+ - The card and the light look as before. Against the page as it was (shadow and gradient written every frame), at eight poses (two corners, the middle and five others), three pairs of settings (Medium and Medium, Large and Strong, Small and Subtle) and stages of 1280×800, 375×812 (pixel ratio 2) and 1280×590, no pixel of the stage differs by more than 27 levels of a channel, the mean difference is under 1.1 levels, and at most 0.45% of the pixels differ by more than 8 levels. Those pixels lie within 2px of the card's edge or outside it, where the edge blends with the shadow just outside it (in 36 pictures, none deeper inside the card differs by more than 8 levels): at the middle pose the old shadow was centred under the card and the CSS one falls 20px below it.
- **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, `font-weight:600` (was 9px) and `rgba(255,255,255,.7)` (was .4, which measures 2.3 to 3.8:1); `.card-sub` gets 13px and `rgba(255,255,255,.9)` (was 11px at .55) with `text-wrap:pretty`, so the phone card does not leave "it." alone on a third line. The first choice for `.card-sub`, .72, measured 3.6:1 with the pointer beside the purple orb (its glow and the light both under the words), 4.44:1 beside the blue orb and 5.1:1 at rest; .9, with the purple orb at `rgba(210,168,255,.2)` (was .25), holds at least 4.95:1 for the card line, 5.2:1 for the over-line and 7.4:1 for the title in every pose measured.
- **Stage:**