StealThis .dev

Generative Blob Background

A living canvas metaball background where several soft blobs drift, merge and split into organic gooey shapes, following your cursor and swappable between hand-picked color palettes.

Open in Lab
canvas vanilla-js
Targets: JS HTML

Code

Generative Blob Background

A full-bleed animated background built on the HTML5 Canvas 2D API. Several blobs orbit the viewport, each drawn as a soft radial gradient. A gooey filter (blur + contrast threshold) fuses overlapping blobs into a single fluid metaball surface, so they appear to melt into and pull apart from one another like lava-lamp fluid. Every frame is driven by requestAnimationFrame and the whole scene rescales cleanly with devicePixelRatio for crisp rendering on high-density displays.

The scene is interactive: move your pointer and a dedicated cursor blob eases toward it, letting you smear and reshape the fluid in real time. A floating control panel lets you switch between curated palettes (Aurora, Ember, Lagoon, Neon), change the blob count, tune the animation speed, and toggle the gooey threshold to reveal the underlying gradient circles. All controls are keyboard accessible with visible focus states, and the demo respects prefers-reduced-motion by pausing the drift while keeping the composition intact.

This resource demonstrates layered Canvas compositing, SVG-filter-based thresholding for the metaball effect, pointer tracking with eased interpolation, and HiDPI-aware resize handling — a compact, dependency-free recipe for organic generative backgrounds.