StealThis .dev

Dot Grid Ripple

A DPR-aware canvas grid of dots that breathe with a continuous idle wave, brighten and swell under the cursor, and burst into expanding ripples on click. Every dot interpolates its own scale, brightness and hue toward a target driven by distance fields, so the surface feels fluid and alive. Includes live controls for spacing, wave speed, cursor radius and color mode, plus reduced-motion support and a crisp resize-aware render loop.

Open in Lab
canvas vanilla-js
Targets: JS HTML

Code

Dot Grid Ripple is an ambient background surface built on the Canvas 2D API. A regular lattice of dots is rendered every frame, and each dot computes a target scale and brightness from three overlapping fields: a slow continuous sine wave that keeps the grid gently breathing, a soft radial falloff around the pointer, and any number of expanding click ripples. The values ease toward their targets so motion always looks smooth rather than snapping.

Interactions are immediate. Move the pointer to push a glowing halo across the grid, click (or tap) anywhere to launch a ripple that races outward and fades, and use the control panel to change dot spacing, wave speed, cursor radius and the color mode (monochrome accent, dual-tone, or a hue that shifts with wave phase). A stats readout reports the live dot count and frame rate.

The demo showcases device-pixel-ratio-aware canvas rendering: the backing store is scaled by devicePixelRatio and re-provisioned on resize via ResizeObserver, keeping dots pin-sharp on retina displays. It also respects prefers-reduced-motion, freezing the idle wave and disabling auto-ripples for users who opt out, while keeping the surface fully interactive.