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: show a cross on Checkmark Draw's Error button and keep an early Submit
matin282f6b1db253
diff --git a/animations/04-micro-interactions/checkmark-draw/index.html b/animations/04-micro-interactions/checkmark-draw/index.htmlindex 5643de99..28fe419f 100644--- a/animations/04-micro-interactions/checkmark-draw/index.html+++ b/animations/04-micro-interactions/checkmark-draw/index.html@@ -213,7 +213,7 @@btnText.style.opacity='0';btnSpin.style.opacity='1';const failed=showError;seqTimer=setTimeout(()=>{- btnSpin.style.opacity='0';btnCheck.style.opacity='1';+ btnCheck.textContent=failed?'✕':'✓';btnSpin.style.opacity='0';btnCheck.style.opacity='1';if(failed){btn.style.background='#f85149';iconWrap.classList.add('error','shake')}else{btn.style.background='#56d364';iconWrap.classList.add('drawn')}},900);@@ -246,7 +246,9 @@}// Submit is pressed after 300ms of rest. Its own 900ms wait follows, then the lines draw over 1.4 x Speed (the circle over Speed,// the tick starting 0.4 x Speed after it) and rest 1.2 s. At the defaults: the tick is complete at 1.9 s, back to Submit at 3.1 s.- document.getElementById('btn-demo').addEventListener('click',()=>{+ // The arrival press is not the visitor's: it leaves alone a Submit the visitor has already pressed.+ document.getElementById('btn-demo').addEventListener('click',e=>{+ if(!e.isTrusted&&btn.disabled)return;stopRun();toRest();later(runSequence,0,300);diff --git a/docs/superpowers/plans/2026-09-29-micro-content-part1.md b/docs/superpowers/plans/2026-09-29-micro-content-part1.mdindex 329440cd..0f17ce22 100644--- a/docs/superpowers/plans/2026-09-29-micro-content-part1.md+++ b/docs/superpowers/plans/2026-09-29-micro-content-part1.md@@ -920,7 +920,7 @@ None: leave out the `details.hb-options` block.- **Player bar:** Show me · Reset · Slow motion (css).- **What the visitor does:** clicking Submit runs today's `runSequence()`.- The label fades and a spinner turns in the button for 900ms.- - Then the button shows ✓ and turns green while the circle and the tick draw. With Result set to Error, it turns red while the X draws and shakes.+ - Then the button shows ✓ and turns green while the circle and the tick draw. With Result set to Error, it shows ✕ (never the success tick) and turns red while the X draws and shakes. `runSequence()` sets the glyph from the run's result, `btnCheck.textContent=failed?'✕':'✓'`, just before it fades the glyph in.- The button then stays finished (disabled) until Reset.- **Show me:** starts from rest: `toRest()` is `reset()` without animating. Then:- `later(runSequence, 0, 300)` presses Submit. The sequence's own 900ms loading wait is a hold: it stays in `runSequence()`'s own timer, which does not go through `later()` and is never tripled.@@ -930,6 +930,7 @@ None: leave out the `details.hb-options` block.- After the reset, the lines draw back out over Speed.- At the defaults: Submit at 300ms, the tick fully drawn by about 1900ms, back to Submit at 3100ms. With Slow motion, back at about 4.5 s, before the lines draw back out.- Stops on `hb:input`: the run's own timers stop, and a sequence already under way still finishes and stays finished until Reset.+ - 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.