Start with a lattice
A regular grid gives each mark a predictable home. Keep sample positions stable and vary the radius to suggest tone. A dark area is simply a collection of larger dots.
Measure the disturbance
Subtract the pointer position from each sample, then measure the length of that vector. Using distance as the phase of a sine wave produces concentric rings.
const distance = Math.hypot(x - pointerX, y - pointerY);
const radius = 2 + Math.sin(distance * 0.05) * 1.5;Keep the page responsive
Use a ResizeObserver to match the drawing buffer to its display size. Cap the pixel ratio so a high-density phone does not quadruple the work unnecessarily.