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: widen the Morphing Blob's viewBox so its extreme poses stay inside
matin0954b5436fb2
diff --git a/animations/06-3d-advanced/morphing-blob/README.md b/animations/06-3d-advanced/morphing-blob/README.mdindex 19971fd9..74f01a21 100644--- a/animations/06-3d-advanced/morphing-blob/README.md+++ b/animations/06-3d-advanced/morphing-blob/README.md@@ -57,7 +57,7 @@ instead of 0.09.The pointer's position is turned into the drawing's own units with the SVG's screenmatrix (`svg.getScreenCTM().inverse()`), so the droplet stays under the pointerhowever the SVG is scaled and centred, also beside the drawing on a wide stage. The-`viewBox` is a 340-unit box around the blob's middle (`30 30 340 340`) with+`viewBox` is a 360-unit box around the blob's middle (`20 20 360 360`) with`preserveAspectRatio="xMidYMid meet"`: the circles wander up to about 190 units fromthe middle, so the box shows them almost always, and the whole box fits whatever theshape of the stage.diff --git a/animations/06-3d-advanced/morphing-blob/index.html b/animations/06-3d-advanced/morphing-blob/index.htmlindex 3383e7a9..8663e6c7 100644--- a/animations/06-3d-advanced/morphing-blob/index.html+++ b/animations/06-3d-advanced/morphing-blob/index.html@@ -47,9 +47,9 @@<div><h2 id="hb-watch-title">Watch it</h2><p>It moves by itself, and one drop follows your pointer or finger. Pause it to look closely, or turn on slow motion.</p></div></div><div class="stage" id="stage">- <!-- The circles wander up to about 190 units from the middle (200, 200); this 340-unit box holds them nearly always,+ <!-- The circles wander up to about 190 units from the middle (200, 200); this 360-unit box holds them almost always,and "meet" fits the whole box into any stage, so the blob is never cut. Beside the box the stage is still drawn. -->- <svg id="svg" viewBox="30 30 340 340" preserveAspectRatio="xMidYMid meet" role="img" aria-label="Soft purple and blue circles drifting and melting into one liquid shape, with one drop that follows the pointer">+ <svg id="svg" viewBox="20 20 360 360" preserveAspectRatio="xMidYMid meet" role="img" aria-label="Soft purple and blue circles drifting and melting into one liquid shape, with one drop that follows the pointer"><defs><!-- The "goo": blur spreads the circles, then the alpha channel ispushed through a steep contrast curve so soft edges snap back to adiff --git a/docs/superpowers/plans/2026-09-29-3d-content.md b/docs/superpowers/plans/2026-09-29-3d-content.mdindex a7721bcd..896ec973 100644--- a/docs/superpowers/plans/2026-09-29-3d-content.md+++ b/docs/superpowers/plans/2026-09-29-3d-content.md@@ -1411,7 +1411,7 @@ None: leave out the `details.hb-options` block.- **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.-- **Stage:** the SVG only; the "Move your pointer" tip goes. The stage keeps its radial gradient, `touch-action:none` and `cursor:crosshair`. `:root` gets `--ui-accent:#3fd6c4`; `--accent` and `--accent2` go with the panel, and `--stage` stays (the gradient uses it). `hb-dots`: no (it would replace the gradient). Default height. **The whole blob shows on every stage:** the SVG keeps its drawing coordinates (every formula, and the drop starting at (200, 200)) but becomes `viewBox="30 30 340 340"` with `preserveAspectRatio="xMidYMid meet"`, in place of the full 400 square sliced to fill the stage. Sliced, a stage as wide as the laptop ones showed only a horizontal band of the blob: measured on the page, 57% of each circle's box at 1280×590 (a 958×258 stage), 70% at 1366×657, 77% at 1280×800 and 72% on a sideways phone, and 57% to 71% in the paused first pictures. Now the box is as tall as the stage on a wide stage, and the stage beside it is drawn too. The circles reach at most about 194 units from the middle (about 160 at the extremes of a typical build, and 176 or less in nine builds of ten), so the 340-unit box keeps 99.9% or more of every circle in view on average with 4, 6 and 9 circles and cuts one, briefly and slightly, in about 1 to 3% of moments (the 300-unit box first tried cut one in 16% to 26% of moments). The drop is 52 to 88px wide on the shared stages, and on the phone stage the picture is almost as before (drawing scale 0.876, was 0.8575).+- **Stage:** the SVG only; the "Move your pointer" tip goes. The stage keeps its radial gradient, `touch-action:none` and `cursor:crosshair`. `:root` gets `--ui-accent:#3fd6c4`; `--accent` and `--accent2` go with the panel, and `--stage` stays (the gradient uses it). `hb-dots`: no (it would replace the gradient). Default height. **The whole blob shows on every stage:** the SVG keeps its drawing coordinates (every formula, and the drop starting at (200, 200)) but becomes `viewBox="20 20 360 360"` with `preserveAspectRatio="xMidYMid meet"`, in place of the full 400 square sliced to fill the stage. Sliced, a stage as wide as the laptop ones showed only a horizontal band of the blob: measured on the page, 57% of each circle's box at 1280×590 (a 958×258 stage), 70% at 1366×657, 77% at 1280×800 and 72% on a sideways phone, and 57% to 71% in the paused first pictures. Now the box is as tall as the stage on a wide stage, and the stage beside it is drawn too. The circles reach at most about 194 units from the middle (about 160 at the extremes of a typical build, and 176 or less in nine builds of ten), so the size of the box is a choice between blob size and cuts. Measured on the page over random builds, phases and 4, 6 and 9 circles: a 300-unit box (`50 50 300 300`) cut some circle in 21% of moments, a 320 box in 7%, a 340 box in 2%, this 360 box in 0.2% to 0.4% (never more than 9% of one circle, a graze) and a 380 box in none, while the blob's size on screen falls only about 5% with each 20 units. The 360 box keeps 99.99% or more of every circle in view on average, on the shared stages and the paused first pictures. The drop is 49 to 83px wide on the shared stages (44px with the full 400 square), and on the phone stage the picture is almost as before (drawing scale 0.828, was 0.8575).- **Phone fallback:** none needed. Measured on the throttled phone: 0.5 to 0.8ms a frame and a full 60 frames a second with the filter, at 4, 6 and 9 blobs.- **Touch:** as today: `pointerdown` and `pointermove` set the drop's target, and the stage's `touch-action:none` lets a finger drag it. The position is turned into drawing units through the SVG itself, `new DOMPoint(e.clientX, e.clientY).matrixTransform(svg.getScreenCTM().inverse())`, so the drop stays under the pointer or finger anywhere on the stage, also beside the box on a wide stage.