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: keep Notification Badge Pulse's halo from catching clicks around the icon
matindf0d41325522
diff --git a/animations/04-micro-interactions/badge-pulse/README.md b/animations/04-micro-interactions/badge-pulse/README.mdindex 581e3639..ddbbbc64 100644--- a/animations/04-micro-interactions/badge-pulse/README.md+++ b/animations/04-micro-interactions/badge-pulse/README.md@@ -47,6 +47,7 @@ The halo variant adds a radiating ring that expands and fades. The ring is drawnposition: absolute;inset: -4px;z-index: -1;+ pointer-events: none;border-radius: 50%;background: var(--badge-color);opacity: 0.4;@@ -59,7 +60,9 @@ The halo variant adds a radiating ring that expands and fades. The ring is drawn}```-Stopping after three pulses takes two more declarations on the animated parts, `animation-iteration-count: 3` and `animation-fill-mode: forwards`. Without the fill mode the badge would fall back to the halo's resting style, a faint ring, when the last pulse ends; with it the run stays on its last keyframes, the badge at scale 1 and the halo invisible.+The ring grows to 2.2 times the badge, well past the icon's corner, and it catches the pointer even when it has faded out. So it has `pointer-events: none`; without that, a click on the empty space beside the icon would land on the ring and count as a click on the badge.++Stopping after three pulses takes two more declarations on the animated parts, `animation-iteration-count: 3` and `animation-fill-mode: forwards`. Without the fill mode the halo would fall back to its resting style, a faint ring around the badge, when the last pulse ends; with it the run stays on its last keyframes, the badge at scale 1 and the halo invisible.## Key parameters| Parameter | Default | Effect |diff --git a/animations/04-micro-interactions/badge-pulse/index.html b/animations/04-micro-interactions/badge-pulse/index.htmlindex df30830a..b543c8af 100644--- a/animations/04-micro-interactions/badge-pulse/index.html+++ b/animations/04-micro-interactions/badge-pulse/index.html@@ -46,6 +46,8 @@.pulse-both .badge,.pulse-both .dot-badge{animation:badge-scale var(--pulse-dur) ease-in-out infinite}.pulse-both .badge::after,.pulse-both .dot-badge::after{content:'';position:absolute;inset:-4px;border-radius:50%;background:var(--badge-color);opacity:.4;animation:halo-grow var(--pulse-dur) ease-out infinite}.badge::after{z-index:-1}+ /* The halo grows to 2.2 times the badge and would catch clicks around the icon's corner, even when it has faded out */+ .badge::after,.dot-badge::after{pointer-events:none}/* Stops after three pulses: the last pulse ends on its last keyframes (badge at scale 1, halo invisible) and stays there */.fade-mode .badge,.fade-mode .dot-badge,.fade-mode .badge::after,.fade-mode .dot-badge::after{animation-iteration-count:3!important;animation-fill-mode:forwards!important}/* Status dot (online) */diff --git a/docs/superpowers/plans/2026-09-29-micro-content-part1.md b/docs/superpowers/plans/2026-09-29-micro-content-part1.mdindex f9f199cf..2756c031 100644--- a/docs/superpowers/plans/2026-09-29-micro-content-part1.md+++ b/docs/superpowers/plans/2026-09-29-micro-content-part1.md@@ -1075,6 +1075,7 @@ How far it rises and Size when raised move the underlined fields' labels; the bo- **Stage font:** site font. `.icon-label` becomes 11px, keeping its `--ui-muted` grey; the number in the badge becomes 11px and dark (`#0b0b0d`), not white: white on the five badge colors is 3.35 to 1.94:1 and the dark number 5.87 to 10.15:1 (text needs 4.5:1).- **Stage:** the three icons stay. Their two-line labels become one word each: "Number", "Dot" and "Online" (were "Bell numbered", "Inbox dot" and "Avatar online"). The avatar's inline style moves into a class. `hb-dots`: yes. Measured: 90px of content (the badges stick out 8px above it), centred; it fits every stage, the 260px one included.- **Halo layering:** the halo (`::after`) is drawn over the badge's color and under its number: `.badge{isolation:isolate}` makes the badge a stacking context and `.badge::after{z-index:-1}` puts the halo inside it, below the text. A halo painted over the number took it below 4.5:1 (2.66:1 on Red at the start of every Ring or Both pulse, 3.27 to 4.15:1 at rest); with the halo under it the number measures 5.86:1 or better in every state.+- **Halo and clicks:** the halo takes no pointer: `.badge::after,.dot-badge::after{pointer-events:none}` (a change of the final wave). It grows to 2.2 times the badge and, faded out or not, covered the empty stage around the icon's corner, so a click there reached the icon's handler and cleared the badge (up to 100 of 529 points sampled around the bell's badge, and 44 around the inbox dot, were such clicks). Now only the icon and the badge itself take a click.**Main settings**@@ -1123,7 +1124,7 @@ White stays left out (it was left out when the number was white; the number is d- [Tooltip Reveal](../tooltip-reveal/) — pointing at an icon shows a short note- [Loading Spinner](../loading-spinner/) — another sign that something is going on- [Hover State Animation](../hover-state/) — items react when the pointer is over them-- **README How it works:** the halo snippet gains `.badge{isolation:isolate}` and `z-index:-1` on `.badge::after`, with a sentence saying the ring is drawn under the number, and a sentence after it says the three-pulse run uses `animation-iteration-count:3` and `animation-fill-mode:forwards`. The rest is unchanged.+- **README How it works:** the halo snippet gains `.badge{isolation:isolate}`, and `z-index:-1` and `pointer-events:none` on `.badge::after`, with a sentence saying the ring is drawn under the number. After the snippet, one sentence says why the ring takes no pointer (it grows to 2.2 times the badge, past the icon's corner, and catches clicks there even when faded out), and the next says the three-pulse run uses `animation-iteration-count:3` and `animation-fill-mode:forwards`; without the fill mode "the halo would fall back to its resting style, a faint ring around the badge". The rest is unchanged.- **README Production notes:** the `prefers-reduced-motion` bullet becomes: "**`prefers-reduced-motion`**: under reduced motion the demo starts paused, so the badges stay still until the visitor presses Play. In production, turn the pulse off: the badge stays visible, just without motion." The rest is unchanged.- **Category line:** `04.15 · Micro-Interactions`- **Pager:** Previous: Form Field Morph (`../form-field-morph/`) · Next: Tooltip Reveal (`../tooltip-reveal/`)