Skip to content

No.200 · Backgrounds

Wave Mesh

A perspective field of dots rolling to the horizon like a slow sea. The pointer lifts a soft hill wherever it points on the ground, and a click sends a ring travelling out across the field.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Night

Build a canvas 2D background of a dot terrain in perspective, with no 3D library. Lay out a grid of world points: x across, z (depth) from 0.35 to 3.4 spaced geometrically (so rows sit roughly evenly on screen), with the ground's half-width chosen from the far edge so the field always fills the frame. Project each with a pinhole camera 0.62 above the ground: sx = W/2 + x/z·f, sy = horizon + (camera − y)/z·f, horizon at 30% of the height. Height is three summed sines in x, z and time, a Gaussian hill under the pointer, and click rings. The pointer maps back to the ground by inverting the projection for y = 0 (z = camera·f / (sy − horizon)), eased at 10% per frame; the hill grows in and fades as it enters and leaves. A click adds a ring at that ground point: a Gaussian band at distance age × 1.15 that decays with age and is dropped after 5s. Draw rows far to near; each row shares a dot size (2.3/z, 0.8–3.2px) and a fog alpha, so a row is one fillStyle and many fillRects. Optionally draw the highest crests in an accent colour in a second pass. Stop requesting frames offscreen or in hidden tabs; draw one frame under reduced motion. Colours are a prop [background, dots, accent]. Selected variant — Night (night): Colours [#06070a, #c9d6ea, #f0b37a], crests off: pale blue-white dots on black; overlay text white. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: A hill follows the pointer across the ground; click or tap to send a ring outward from that spot. Motion: The surface rolls continuously; the pointer hill eases at 10% per frame; rings travel at 1.15 units/s and fade over ~4s. Accessibility: The canvas is aria-hidden and decorative. Reduced motion draws one still frame. Responsive behavior: Grid density follows the container (56–150 columns, 48–90 rows); the focal length adapts so the horizon stays put. Touch: No hill on touch; tap to send a ring. Runs at ~33fps. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
A hill follows the pointer across the ground; click or tap to send a ring outward from that spot.
Motion
The surface rolls continuously; the pointer hill eases at 10% per frame; rings travel at 1.15 units/s and fade over ~4s.
Accessibility
The canvas is aria-hidden and decorative. Reduced motion draws one still frame.
Responsive
Grid density follows the container (56–150 columns, 48–90 rows); the focal length adapts so the horizon stays put.
On touch
No hill on touch; tap to send a ring. Runs at ~33fps.