No.187 · 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): Frost: pale frost-blue isobars (#b9cce4) on near-black (#07080c); labels in the same frost at 60% opacity. 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: 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 behavior: Grid scales with the container; cell size and level count are props for tuning density vs. cost. Touch: No cursor bump on touch; the map still drifts. 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
- 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.