Skip to content

No.103 · Backgrounds

Gravity Grid

A hairline grid that bends around the content placed on it — headlines and cards act as masses and dent the field, so the background frames what matters.

The prompt

Written for the variant you picked above: Frost

Build a background whose field responds to the layout placed on it, not to decoration. Render a hairline grid (30px) on a 2D canvas behind the content. Every descendant with a data-mass attribute is measured (ResizeObserver on the wrapper and each mass, re-measured after fonts load) and treated as a rectangular mass. For each grid sample (every 6px along each line) find the nearest point on each mass rectangle (expanded 10px). Pull the sample toward it by min(0.82·d, m·strength·(14 + 0.09·√area)·e^(−d/σ)), with σ = 40 + 0.22·√area — so lines bow in toward content, strongest near it, never crossing into it. Lines brighten from 7.5% to ~28% alpha as they bend ('heat'), fade out entirely within 18px of a mass and inside it, so text always sits on clean ground. Grid intersections near a mass get tiny 1.5px dots. The pointer adds a small point mass (0.35) eased with a lerp; the canvas only animates while that mass is moving and otherwise is completely still. Cap DPR at 2. Under reduced motion the pointer is ignored — the layout-driven bend remains. Selected variant — Frost: Grid colour #b9cce4 (frost blue) on #0a0c10; content ink #eef2f7, muted #8b95a3; eyebrow in the grid colour.

Notes

Interaction
The field is shaped by the content itself; moving the pointer adds a light, slow dimple that follows it.
Motion
None at rest. Redraws on layout change; pointer mass eases with a 0.08 lerp and the loop stops when settled.
Accessibility
Decorative canvas (aria-hidden) under real content; lines are removed beneath text for contrast. Reduced motion disables the pointer mass.
Responsive
Re-measures on any size change of the wrapper or of any mass, so it adapts to every breakpoint automatically.
On touch
Without a hover pointer the grid simply frames the content; a drag moves the dimple.

Featured

301 components