No.106 · Backgrounds
Isobar
A living weather map — contour lines traced over a drifting pressure field, with your cursor as a system of its own.
The prompt
Written for the variant you picked above: Frost
Create a background that looks like a surface-analysis weather chart come to life. On a near-black ground, sample a smooth pressure field on a 12px grid: three octaves of value noise, each drifting in a different direction at a slow rate, so the pattern evolves like weather rather than scrolling. Trace 16 evenly spaced contour levels between the field's current minimum and maximum with marching squares (linear-interpolated edge crossings, both saddle cases handled), drawing every segment of a level in one path. Minor isobars are hairlines at 16% opacity; every fifth line is a heavier "index" isobar at 42%, exactly as cartographers do. Mark the current global high and low with small mono "H" and "L" labels. Make the cursor a pressure system: add a soft Gaussian bump centred on the pointer whose strength eases in when the pointer enters and out when it leaves, so the isobars visibly bend and gather around it and the H often migrates to follow your hand. Redraw at ~20fps (weather doesn't need 60), pause when offscreen or the tab is hidden, cap DPR at 2, and draw one still frame under reduced motion. Take the line colour and ground colour as props so the chart can be re-inked. Selected variant — Frost: Frost: pale frost-blue isobars (#b9cce4) on near-black (#07080c); labels in the same frost at 60% opacity.
Notes
- Interaction
- The pointer adds a local high-pressure bump that bends nearby isobars; it fades in and out smoothly.
- Motion
- Field drifts continuously; canvas redraws at ~20fps; cursor influence eases at 8% per frame.
- Accessibility
- Canvas is aria-hidden. Reduced motion renders a single still chart with no cursor tracking.
- Responsive
- Grid scales with the container; cell size and level count are props for tuning density vs. cost.
- On touch
- No cursor bump on touch; the map still drifts.