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 SVG Path Animation's fill at once under reduced motion, and let a slow-motion loop rest filled for its full hold
matin3417680262ff
diff --git a/animations/06-3d-advanced/svg-path-animation/README.md b/animations/06-3d-advanced/svg-path-animation/README.mdindex 54246197..b5270f71 100644--- a/animations/06-3d-advanced/svg-path-animation/README.md+++ b/animations/06-3d-advanced/svg-path-animation/README.md@@ -44,9 +44,10 @@ paths.forEach((path, i) => {});```-**Fill at end** — trigger a fill reveal after the stroke draw completes:+**Fill at end** — trigger a fill reveal after the stroke draw completes. The path has to start with `fill: transparent`, not `fill: none`: a fill can only fade from a colour, and from `none` it would snap on.```js+path.style.fill = 'transparent'; // not 'none'path.addEventListener('transitionend', () => {path.style.transition = 'fill 400ms ease';path.style.fill = 'rgba(88, 166, 255, 0.15)';diff --git a/animations/06-3d-advanced/svg-path-animation/index.html b/animations/06-3d-advanced/svg-path-animation/index.htmlindex 1dd8505f..1b621589 100644--- a/animations/06-3d-advanced/svg-path-animation/index.html+++ b/animations/06-3d-advanced/svg-path-animation/index.html@@ -223,11 +223,13 @@});}// One play rebuilds the paths hidden and draws them one after another, each starting a little after the- // one before. While Loop is on, the finished drawing holds 1200ms; whether it then vanishes and draws again- // is decided right after that hold, from Loop's value at that moment, so switching Loop off during the hold- // leaves the drawing shown. Slow motion stretches the draws and the waits for them, not the hold.+ // one before. While Loop is on, the finished drawing (filled, if Fills is on) holds 1200ms; whether it then vanishes and draws+ // again is decided right after that hold, from Loop's value at that moment, so switching Loop off during the hold leaves the+ // drawing shown. Slow motion stretches the draws, the fill's fade and the waits for them, not the hold. Under reduced motion the+ // lines are already complete (a CSS rule), so the fill comes at once instead of after the time the lines would have taken.function cycle(){- vars.setProperty('--fill-dur',slowTog.checked?'1200ms':'400ms');+ const fillMs=slowTog.checked?1200:400;+ vars.setProperty('--fill-dur',fillMs+'ms');const paths=buildPaths(),ms=speed(),gap=ms*0.3,rev=revTog.checked;paths.forEach(path=>{const len=path.getTotalLength();@@ -243,8 +245,8 @@later(()=>{if(fillTog.checked)paths.forEach(path=>{path.style.transition='';path.classList.add('fill-done')});if(!loopTog.checked||!motionOk)return;- later(()=>{if(loopTog.checked)cycle()},1200);- },20+(paths.length-1)*gap+ms+50);+ later(()=>{if(loopTog.checked)cycle()},1200+(fillTog.checked?fillMs:0));+ },motionOk?20+(paths.length-1)*gap+ms+50:0);}function play(){timers.forEach(clearTimeout);timers=[];cycle()}diff --git a/docs/superpowers/plans/2026-09-29-3d-content.md b/docs/superpowers/plans/2026-09-29-3d-content.mdindex 53a6dc02..1072f7e9 100644--- a/docs/superpowers/plans/2026-09-29-3d-content.md+++ b/docs/superpowers/plans/2026-09-29-3d-content.md@@ -767,10 +767,10 @@ None: leave out the `details.hb-options` block.- **Watch it help line:** default- **Player bar:** Replay · Loop · Slow motion- **Sequence:** every play rebuilds the paths hidden (`buildPaths()`, then each path's dash set to its length, or to minus its length with Starts from the other end, with the transition off). Path i starts 20 + i × (Speed × 0.3) ms after the play starts: a forced reflow (`path.getBoundingClientRect()`, as today), then its offset slides to 0 over Speed with Feel. 50ms after the last path finishes, the shapes fill when Fills in at the end is on (`fill-done`).- - While Loop is on, the drawing then holds 1200ms, and Loop is checked at that moment: on, the next play starts (the drawing vanishes at once and draws again); off, it stays drawn.+ - While Loop is on, the drawing then holds 1200ms, counted from the end of the last movement: with Fills in at the end on, from the end of the fill's fade (400ms, or 1200ms in slow motion), so the hold is 1200ms of a finished, filled drawing. Loop is checked at the end of the hold: on, the next play starts (the drawing vanishes at once and draws again); off, it stays drawn.- Timers use the pruning `later()`, and every play clears them all (Rotate In's `play()`/`cycle()`). Today's `animating` flag, `run` counter and `loopTimer` go.-- **Slow motion:** multiplies Speed (each path's transition), the delay between paths (Speed × 0.3) and the timer that waits for the last path by 3. The fill's fade becomes `transition:fill var(--fill-dur) ease`: 400ms, or 1200ms while Slow motion is on. The 20ms and 50ms steps and the 1200ms hold stay.-- **Reduced motion:** the demo's rule `.draw-path{stroke-dashoffset:0!important;transition:none!important}` stays, so the drawing shows complete at once. As on Rotate In, Replay plays once.+- **Slow motion:** multiplies Speed (each path's transition), the delay between paths (Speed × 0.3) and the timer that waits for the last path by 3. The fill's fade becomes `transition:fill var(--fill-dur) ease`: 400ms, or 1200ms while Slow motion is on (`fillMs`, which the page also adds to the timer that waits before Loop starts the next play). The 20ms and 50ms steps and the 1200ms hold stay: the hold is 1200ms after the fade ends, whatever the fade's length.+- **Reduced motion:** the demo's rule `.draw-path{stroke-dashoffset:0!important;transition:none!important}` stays, so the drawing shows complete at once, and with Fills in at the end on the fill appears at once too: its timer waits 0ms in place of the time the lines would have taken (`motionOk?20+(paths.length-1)*gap+ms+50:0`), and the rule's `transition:none` makes it instant. As on Rotate In, Replay plays once.- **Stage font:** no text on the stage.- **Stage:** only the drawing.- The three preset tabs on the stage move to Try it as Drawing. The label under the drawing and the Path length readout go.