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: correct the last Micro wording found by the fix-wave re-reviews

matinaa186ac4ce6c
diff --git a/animations/04-micro-interactions/README.md b/animations/04-micro-interactions/README.md
index c726742e..435ca834 100644
--- a/animations/04-micro-interactions/README.md
+++ b/animations/04-micro-interactions/README.md
@@ -1,6 +1,6 @@
# 04 — Micro-Interactions & UI Animation
-Short, user-triggered animations that provide feedback, confirm actions, and communicate state. Duration is typically ≤300ms — they must feel instant, not decorative.
+Short, user-triggered animations that provide feedback, confirm actions, and communicate state. They start the moment the visitor acts and stay short (see Duration discipline below), so they feel instant, not decorative.
## Animations
diff --git a/animations/04-micro-interactions/focus-ring/index.html b/animations/04-micro-interactions/focus-ring/index.html
index 397f5c27..7c03dfd9 100644
--- a/animations/04-micro-interactions/focus-ring/index.html
+++ b/animations/04-micro-interactions/focus-ring/index.html
@@ -25,7 +25,7 @@
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
.stage{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px;background:#0b0b0d}
.form{display:flex;flex-direction:column;gap:12px;width:100%;max-width:340px}
- /* A window this short gives the stage 260px, less than the form needs: the stage and the form give up some spacing, the items keep their size.
+ /* A window this short gives the stage 260 to 290px, less than the form needs: the stage and the form give up some spacing, the items keep their size.
The bottom keeps 11px, the reach of the widest ring (Thick, Large gap, Wide), so the last item's ring is not cut. */
@media(min-width:601px) and (max-height:620px){.stage{padding:5px 8px 11px}.form{gap:8px}}
.field{display:flex;flex-direction:column;gap:6px}
diff --git a/animations/04-micro-interactions/hover-state/index.html b/animations/04-micro-interactions/hover-state/index.html
index 934ceb50..9908dee3 100644
--- a/animations/04-micro-interactions/hover-state/index.html
+++ b/animations/04-micro-interactions/hover-state/index.html
@@ -24,7 +24,7 @@
:root{--ui-accent:#ff9d5c;--ui-bg:#111114;--ui-border:rgba(255,255,255,.09);--dur:180ms;--ease:ease}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
.stage{display:flex;align-items:center;justify-content:center;padding:16px;background:#0b0b0d}
- /* A window this short gives the stage 260px, less than the six cards need: the stage gives up some padding, the cards keep their size */
+ /* A window this short gives the stage 260 to 290px, less than the six cards need: the stage gives up some padding, the cards keep their size */
@media(min-width:601px) and (max-height:620px){.stage{padding:10px}}
.hgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%}
.hcard{background:var(--ui-bg);border:1px solid var(--ui-border);border-radius:8px;padding:14px 12px;cursor:pointer;min-height:72px;display:flex;flex-direction:column;justify-content:center;position:relative;overflow:hidden;-webkit-user-select:none;user-select:none}
diff --git a/docs/superpowers/plans/2026-09-29-micro-content-part1.md b/docs/superpowers/plans/2026-09-29-micro-content-part1.md
index 524b54c7..42cd5bc1 100644
--- a/docs/superpowers/plans/2026-09-29-micro-content-part1.md
+++ b/docs/superpowers/plans/2026-09-29-micro-content-part1.md
@@ -362,7 +362,7 @@ None: leave out the `details.hb-options` block.
- [Click / Tap Ripple](../click-ripple/) — a ripple spreads from the spot you press
- [Hover State Animation](../hover-state/) — items react before they are clicked
- [Checkmark Draw](../checkmark-draw/) — a tick draws itself once the task is done
-- **README How it works:** the JS snippet's `pointerdown` handler also captures the pointer, `e => { press(); btn.setPointerCapture(e.pointerId); }`, and the snippet gains `btn.addEventListener('blur', release);` after the key handlers, as the page has them. One sentence after the paragraph on the asymmetric timing says the glow crossfades a resting shadow on `::before` and a pressed shadow on `::after` by opacity, with the same timing as the size, rather than animating `box-shadow`. The rest is unchanged.
+- **README How it works:** the JS snippet's `pointerdown` handler also captures the pointer, `e => { press(); btn.setPointerCapture(e.pointerId); }`, and the snippet gains `btn.addEventListener('blur', release);` beside the key handlers (the page registers it just before them). One sentence after the paragraph on the asymmetric timing says the glow crossfades a resting shadow on `::before` and a pressed shadow on `::after` by opacity, with the same timing as the size, rather than animating `box-shadow`. The rest is unchanged.
- **README Production notes:** the `prefers-reduced-motion` bullet becomes: "**`prefers-reduced-motion`**: switch the transitions off for users who request reduced motion, so the button changes size at once instead of animating; the demo does this." The `pointercancel` bullet gains: "Two more ways to get stuck are covered in the snippet: without `setPointerCapture` the release is missed when the pointer has moved off the button, and without the `blur` listener a key held down while Tab moves the focus away sends its `keyup` to the next element." The rest is unchanged.
- **Category line:** `04.04 · Micro-Interactions`
- **Pager:** Previous: Focus Ring Animation (`../focus-ring/`) · Next: Magnetic Button (`../magnetic-button/`)
@@ -947,7 +947,7 @@ None: leave out the `details.hb-options` block.
- The arrival press is the shared script's, not the visitor's. When the visitor has already pressed Submit (the button is disabled, whether it is still loading or finished), the page ignores an untrusted Show me press (`e=>{if(!e.isTrusted&&btn.disabled)return; ...}`), so the arrival run neither resets nor replaces the visitor's own sequence. The visitor's own Show me press still starts a run from rest.
- **Reset:** calls `stopRun()`, then `reset()`: the finished button stays disabled otherwise, so this is the only way back to Submit besides Show me.
- **Slow motion:** css (the drawing, the spinner, the shake and the button's colour). `later()` triples the drawing (1.4 × Speed), not the holds; the sequence's 900ms loading wait keeps its length.
-- **Reduced motion:** the demo's rule stays and also stops the button's spinner (`.sp{animation:none}` joins it). The spinner shows still, and the circle and tick, or the X, appear at once, with no shake. Show me still shows the spinner, then the finished result.
+- **Reduced motion:** the demo's rule stays and also stops the button's spinner (`.sp{animation:none!important}` joins it). The spinner shows still, and the circle and tick, or the X, appear at once, with no shake. Show me still shows the spinner, then the finished result.
- **Stage font:** site font. `.submit-btn` gets `font-family:inherit` in place of `var(--mono)`.
- **Stage:** the button and the icon stay. The state label under the icon (`#state-label`) goes; it described each step. `.submit-btn`'s transition keeps only `background`, because its `width` never changes. `hb-dots`: yes. Measured: 230px on phones and laptops.
diff --git a/docs/superpowers/plans/2026-09-29-micro-content-part2.md b/docs/superpowers/plans/2026-09-29-micro-content-part2.md
index d7e2119f..666f04c8 100644
--- a/docs/superpowers/plans/2026-09-29-micro-content-part2.md
+++ b/docs/superpowers/plans/2026-09-29-micro-content-part2.md
@@ -1105,14 +1105,14 @@ None: leave out the `details.hb-options` block.
- `later(release, 0, 850)`: `release()` marks the refresh as the run's (`demoRefresh=true`) and calls `startRefresh()`, as a release past the line does. It spins for Refresh time, adds the new item at the top and springs back; the list is back up about 2.4 s after the press at the defaults;
- when that refresh ends, `finishRefresh()` clears `demoRefresh` and runs `later(toRest, 0, 1500)`: the new item shows for 1.5 s, then `toRest()` puts the list back to its six first items, so the run ends at rest, as the preamble says of every run. The step is scheduled as the item arrives, not at the release, so a Refresh time changed during the refresh is counted and the item always shows its full 1.5 s. About 3.6 s after the press at the defaults (3.1 s at Short, 4.4 s at Long). The browser check needs this step: it compares the stage before and after a run, and under reduced motion nothing has run before it, so a run that leaves a seventh item could never match.
- A run's refresh is silent, as the preamble says of every run (it never announces anything that did not really happen): while `demoRefresh` is set, `startRefresh()` leaves the status line alone, and `finishRefresh()` schedules the clean-up and returns before it writes "Updated — 1 new item added.". The Refresh button, a real drag and a refresh the visitor has taken over (`stopRun()` clears `demoRefresh`, and the new item stays) announce as before.
+ A run's refresh is silent, as the preamble says of every run (it never announces anything that did not really happen): while `demoRefresh` is set, `startRefresh()` leaves the status line alone, and `finishRefresh()` schedules the clean-up and returns before it writes "Updated — 1 new item added.". The Refresh button, a real drag announce as before; a refresh the visitor has taken over (`stopRun()` clears `demoRefresh`, and the new item stays) announces only "Updated — 1 new item added.", since it began as Show me's and skipped "Refreshing…".
`running()` is also true from the release until the new item arrives (`demoRefresh`); the clean-up after it is a run timer, so `running()` stays true until that has run. `stopRun()` also clears `demoRefresh`. On `hb:input`: `stopRun()`, so no clean-up follows. During the pull the list then springs back, `pull=0; setY(0,true); drawSpin()`, and the visitor's own drag takes over. Once the refresh has started, it finishes as usual and its new item stays (no spring back is drawn while `refreshing`).
- **Reset:** puts the list back to its six first items (the new ones go, `n` returns to 0) and scrolls it to the top, after `stopRun()`. A refresh under way ends at once: `startRefresh()` keeps its timer in `refreshTimer`, which Reset clears; then the spinner stops, `refreshing` becomes false and the list is set back to 0 without a transition.
- **Slow motion:** none.
- **Reduced motion:** the demo's rules stay: the list snaps back without its tween, and new items appear without sliding in.
- **Touch:** already Pointer Events, claimed only at the top of the list, with `touchmove` blocked once the pull is claimed. The list still scrolls normally.
-- **Pull curve:** today's `resist()` moved the list at 1/Resistance of the finger from the first pixel, and the line was 1.83 × Pull distance × Resistance of finger travel away: 235px at Medium/Medium, about the whole height of the feed (201px on the 260px stage, 241px on phones, 268 to 381px on the others). At the defaults a drag that stayed inside the stage refreshed only where the feed is tall: 1280×800, 1440×900, 1024×768 and 768×1024. The curve becomes `function resist(dy){const max=threshold*(1+2.4/resistance);return max*dy/(dy+max)}`: the list follows the finger 1:1 at first and stiffens as the drag grows, and Resistance only sets how fast. Pull distance is still the pull after the curve, and the line is `threshold × (1 + resistance / 2.4)` of finger travel away. For Short · Medium · Long that is 68 · 91 · 113px at Low, 88 · 117 · 147px at Medium and 108 · 144 · 180px at High (checked in Chrome: 3px less springs back, 3px more refreshes). A drag from the middle of the first card to 4px above the stage's bottom edge (about 160px of room on the 260px stages, 170px at 1024×600, 200px on phones, 227px at 1366×657, 280px at 1280×800) therefore refreshes at the defaults on every stage, with a mouse and with a finger, and a 60px drag still springs back. Every combination refreshes inside the stage except Long/High (180px) on the 260px stages (1280×590, 1366×560, 667×375, 812×375) and at 1024×600 (feed 211px): that is the "long drag" the README names. Show me sets `pull` itself, so it does not change.
+- **Pull curve:** today's `resist()` moved the list at 1/Resistance of the finger from the first pixel, and the line was 1.83 × Pull distance × Resistance of finger travel away: 235px at Medium/Medium, about the whole height of the feed (201px on the 260px stage, 241px on phones, 268 to 381px on the others). At the defaults a drag that stayed inside the stage refreshed only where the feed is tall, for example 1280×800, 1440×900, 1024×768, 768×1024, 1366×768, 1280×720 and 1920×1080. The curve becomes `function resist(dy){const max=threshold*(1+2.4/resistance);return max*dy/(dy+max)}`: the list follows the finger 1:1 at first and stiffens as the drag grows, and Resistance only sets how fast. Pull distance is still the pull after the curve, and the line is `threshold × (1 + resistance / 2.4)` of finger travel away. For Short · Medium · Long that is 68 · 91 · 113px at Low, 88 · 117 · 147px at Medium and 108 · 144 · 180px at High (checked in Chrome: 3px less springs back, 3px more refreshes). A drag from the middle of the first card to 4px above the stage's bottom edge (about 160px of room on the 260px stages, 170px at 1024×600, 200px on phones, 227px at 1366×657, 280px at 1280×800) therefore refreshes at the defaults on every stage, with a mouse and with a finger, and a 60px drag still springs back. Every combination refreshes inside the stage except Long/High (180px) on the 260px stages (1280×590, 1366×560, 667×375, 812×375) and at 1024×600 (feed 211px): that is the "long drag" the README names. Show me sets `pull` itself, so it does not change.
- **Stage font:** site font. The new Refresh button gets `font-family:inherit`. `.indicator` and `.meta .s` go up to 11px (were 10px).
- **Stage:** the list scrolls inside its own box. The stage's own rule keeps `position:relative;overflow:hidden` and adds `display:flex;flex-direction:column`.
- The stage becomes a small app screen. At the top is a header bar with the title "Updates" and, at its right, a Refresh button: a ↻ icon, `aria-label="Refresh"`, 44×44px, calling `startRefresh()`. It is today's "↻ Refresh now" moved from the old panel onto the stage; the README calls it the keyboard way to refresh.