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
fix: ignore a Noise-Based Motion resize that leaves the stage the same size, so the canvas does not blank
matind022f68a0f1a
diff --git a/animations/06-3d-advanced/noise-based-motion/index.html b/animations/06-3d-advanced/noise-based-motion/index.htmlindex 845fa127..ae51c3a8 100644--- a/animations/06-3d-advanced/noise-based-motion/index.html+++ b/animations/06-3d-advanced/noise-based-motion/index.html@@ -273,7 +273,7 @@ document.addEventListener('hb:pause',e=>{});resize();frame();start();-window.addEventListener('resize',()=>{resize();redraw();});+window.addEventListener('resize',()=>{if(stage.clientWidth===W&&stage.clientHeight===H)return;resize();redraw();});function choices(id,pick){const buttons=document.querySelectorAll('#'+id+' button');diff --git a/docs/superpowers/plans/2026-09-29-3d-content.md b/docs/superpowers/plans/2026-09-29-3d-content.mdindex b7759f46..53a6dc02 100644--- a/docs/superpowers/plans/2026-09-29-3d-content.md+++ b/docs/superpowers/plans/2026-09-29-3d-content.md@@ -696,6 +696,7 @@ None: leave out the `details.hb-options` block.- **Sequence:** the canvas loop as in the preamble (`loop(ts)`, 16ms gate). Each drawn frame adds Speed × 0.01 to `t` and draws with `frame()`.- **The dot spacing:** `drawGrid()` uses `SPACE` pixels as its step, in place of `Math.max(4,Math.floor(W/GRID))`. Today the grid is set by columns across the stage, so a narrow phone stage gets a finer grid and more dots than a laptop (340 dots on a phone stage against 160 on the stage of a 1280×800 screen). Spacing in pixels keeps the same look on every screen: Medium, 48px, is today's 20 columns on a 960px laptop stage.- **The first picture:** `frame()` runs at load. **While paused,** every setting (Try it's `click` and `change`, in place of today's `aside` listener) and a resize call `frame()`.+ - **The resize handler** returns at once when the stage's size has not changed (`if(stage.clientWidth===W&&stage.clientHeight===H)return;`, as on Canvas Particle Effect and Cloth / Soft-Body Simulation): setting a 2D canvas's size blanks it, and a phone's address bar showing or hiding also fires `resize`, which on a 90 or 120 Hz phone could flash the stage empty for a frame.- **The blob ripples.** The edge reads the noise along a circle of radius `RING × SCALE` with `RING = 48`, and the inner ring along `RING_IN × SCALE` with `RING_IN = 32`, in place of today's 12 and 8. Today's circle was so small that the noise hardly varied along it: at the default the edge departed only 12px from round (median, on a 106px radius, with one lobe) while the whole blob breathed 39px (86 to 125px), so it read as a breathing circle, not the ripple the Description and the prompt promise. Measured on the page over 120s of noise (the drawn outline, largest minus smallest radius): before, 11.5px median, 1.1 lobes; now, at the default settings, 33px median (25 to 41px from the 10th to the 90th percentile, 44px at most), about two lobes (2.3), and the whole blob breathes 20px (96 to 115px). The choices stay meaningful: Pattern size Large 23px and 1.4 lobes, Medium 33px and 2.3, Small 37px and 4.4 (busy); Wobble Small 16px, Medium 33px, Large 55px (73px at most). The largest ripple (Large wobble, Small pattern size) stays inside the canvas on the 286×298, 341×298, 745×258 and 958×378 stages. The edge is drawn with 96 points, up from 48 (`VERTS`), because the wider ripple made 48 show corners at the busy settings: the sharpest turn between neighbouring segments was 57° with 48 points at Small pattern size and Medium wobble (95° with Large wobble) and is 36° (69°) with 96; at the default settings it is 11° with 96 (21° with 48), where a plain circle of 96 points turns 3.8°. The blob still draws in under 1ms a frame on the throttled phone (181 of 180 frames in 3s on the phone, the sideways phone and the 320px phone). The dots are untouched.- **Slow motion:** while the switch is on, each drawn frame adds a third: `t += SPD*.01/3`, from the next frame.- **Reduced motion:** the page's reduced-motion branch goes (see the preamble).