Spacetime Grid

new

A field of tiles with idle waves, a gravity well under the cursor and ripples on click.

Backgrounds@abhiramkrishna/spacetime-grid

Read the guide

Move your cursor over the grid and click.

Customize

Changes show live, update the code and the page URL.

Loading controls…

Installation

three is a peer dependency, so your app ships a single copy.

pnpm add @abhiramkrishna/spacetime-grid three

Props

Same names in every wrapper. Vue and the Web Component take them in kebab-case.

Grid
colsnumber · 8–160 · rebuildsDefault64Number of tile columns.
rowsnumber · 8–160 · rebuildsDefault60Number of tile rows.
cellSizenumber · 0.1–1 · rebuildsDefault0.34Distance between tile centres, in world units.
fillnumber · 0.1–1 · rebuildsDefault0.72How much of each cell a tile covers (1 = no gap).
tileOpacitynumber · 0–1Default0.55Opacity of every tile.
Waves
waveAmplitudenumber · 0–0.4Default0.09Height of the idle waves.
waveSpeednumber · 0–4Default1Speed multiplier for the idle waves.
swaynumber · 0–0.2Default0.03How far the whole grid rocks from side to side, in radians.
Gravity well
cursorWellbooleanDefaulttrueSink the tiles under the mouse cursor.
wellRadiusnumber · 0.2–6Default2.2Radius of the cursor well, in world units.
wellDepthnumber · 0–2Default0.55How deep the cursor well sinks the tiles.
wellEasenumber · 0.01–1Default0.1How quickly tiles follow the well each frame (1 = instantly).
Ripples
ripplesbooleanDefaulttrueSend an energy ring across the grid on click or tap.
rippleSpeednumber · 0.2–8Default2.4How fast a ripple ring spreads, in world units per second.
rippleWidthnumber · 0.05–2Default0.55Thickness of the ripple ring.
rippleHeightnumber · 0–2Default0.55How high the ripple ring lifts the tiles.
rippleLifetimenumber · 0.2–8Default2.4Seconds before a ripple fades out.
Colours
theme: { base }colorDefault"#0c1f33"Resting tile colour.
theme: { hover }colorDefault"#43d9ad"Colour of tiles in a well, ripple or data glow.
theme: { fog }colorDefault"#011627"Fog colour; match it to the page background.
theme: { fresnel }colorDefault"#bfe9ff"Fresnel rim colour on tiles seen at a grazing angle.
Fog
fogNearnumber · 0–30Default5Distance where the fog begins.
fogFarnumber · 1–60Default12Distance where tiles fully fade into the fog.
Camera
fovnumber · 20–100Default50Vertical field of view, in degrees.
cameraEasenumber · 0.01–1Default0.06How quickly the camera moves toward its target each frame.
Rendering
maxPixelRationumber · 0.5–3Default2Upper limit on the device pixel ratio; lower is faster.
compactBreakpointnumber · 0–2000Default1024Below this canvas width (px) the grid drops lower and shrinks, for phones.
reducedMotion"auto" | "always" | "never"Default"auto"auto follows prefers-reduced-motion; always renders a still frame; never always animates.