Pixel bloom
A card fills with twinkling pixels while it is pointed at or focused, rippling out from where the pointer came in, and drains away when it leaves.
- enhancer
- card
- pixels
- hover
- focus
- grid
- since 0.2
Background Studio: tune it below, then copy the code
Your system asks for reduced motion: the demo shows its final state and nothing moves.
Live demo
Pixel bloom example
Code
It follows the controls above: change an option and the code changes with it.
<script src="https://search.axi0.io/axi0/motion/motion.js" defer></script>
<div class="m-pxb-row"><a class="m-pxb-card" href="#pixel-bloom" data-motion="pixel-bloom"><b>Warm start</b><span>Pixels bloom from where the pointer comes in.</span></a><a class="m-pxb-card" href="#pixel-bloom" data-motion="pixel-bloom" data-motion-colors="#8a7dff,#3fd7ff,#c9c2ff,#5f8bff" data-motion-from="center"><b>Cool center</b><span>This one blooms from the middle out.</span></a><a class="m-pxb-card" href="#pixel-bloom" data-motion="pixel-bloom" data-motion-colors="#3fdc9b,#b8f27c,#2fb8a6" data-motion-gap="8"><b>Big pixels</b><span>A wider grid of greens.</span></a></div>
import { PixelBloom } from "./motion/react/PixelBloom";
<PixelBloom>Your content</PixelBloom>
<script setup lang="ts">
import PixelBloom from "./motion/vue/PixelBloom.vue";
</script>
<template>
<PixelBloom>Your content</PixelBloom>
</template>
const el = document.querySelector("#title");
el.dataset.motion = "pixel-bloom";
The wrappers: PixelBloom.tsx (React, TypeScript) and PixelBloom.vue (Vue). Both render the same attributes as the HTML; the loader does the rest.
Options
| Attribute | Default | What it does |
|---|---|---|
data-motion-colors | auto | Pixel colors, comma separated (empty: silver with a little orange on dark pages, ink with orange on light ones) |
data-motion-gap | 5 | Pixel grid pitch |
data-motion-speed | 1 | How fast the pixels twinkle |
data-motion-from | pointer | Where the ripple starts |
data-motion-always | false | Keep the pixels on without a pointer |
Accessibility
The pixels are an aria-hidden canvas behind the card's content, with no pointer events; the card keeps its own role, link and text. Keyboard focus inside the card starts the bloom from the center. Touch: a tap blooms it for a moment. Reduced motion shows the pixels still, without the ripple or the twinkle. Only transform, opacity and paint change, so nothing around it moves. Frames run through the shared loop, which stops off screen, in hidden tabs and under reduced motion; reduced motion shows the final state with no movement.
Size
pixel-bloom.js is 2.2 KB gzip. A page loads the loader (2.9 KB) and core.js (1.4 KB) once, whatever it uses.