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: Click / Tap Ripple (04.02): Enter or Space on a button starts the ripple from its center, as the click they make has no pointer position
matin5b2bfc97ea34
diff --git a/animations/04-micro-interactions/click-ripple/README.md b/animations/04-micro-interactions/click-ripple/README.mdindex 42c84b24..9d576ec9 100644--- a/animations/04-micro-interactions/click-ripple/README.md+++ b/animations/04-micro-interactions/click-ripple/README.md@@ -43,6 +43,8 @@ function spawnRipple(btn, e) {The button needs `position: relative; overflow: hidden` to contain the ripple.+A press from the keyboard has no position: Enter or Space fires a `click` whose `detail` is 0, and that click starts the ripple from the button's center.+## Key parameters| Parameter | Default | Effect ||-----------|---------|--------|diff --git a/animations/04-micro-interactions/click-ripple/index.html b/animations/04-micro-interactions/click-ripple/index.htmlindex 456fe097..480e89f9 100644--- a/animations/04-micro-interactions/click-ripple/index.html+++ b/animations/04-micro-interactions/click-ripple/index.html@@ -182,6 +182,13 @@el.addEventListener('animationend',()=>el.remove(),{once:true});}btns.forEach(btn=>btn.addEventListener('pointerdown',e=>spawnRipple(btn,e)));+ // Enter or Space clicks a button with no pointer, so the click's detail is 0 (as when assistive technology presses it): the+ // ripple starts from the button's center. A pointer's click (detail 1 or more) adds none, its pointerdown made one already.+ btns.forEach(btn=>btn.addEventListener('click',e=>{+ if(e.detail!==0)return;+ const r=btn.getBoundingClientRect();+ spawnRipple(btn,{clientX:r.left+r.width/2,clientY:r.top+r.height/2});+ }));// Show me: one run at a time. Every timer of the run goes through later(); stopRun() cancels the whole run.// later(fn, move, hold) waits move*(slow?3:1) + hold ms: Slow motion triples the movement, never the hold.