forever components

Generative Geometry

Wave Interference

Four orbiting sources emit ripples drawn as glowing blue marching-squares contour lines on near-black. Pointer adds a fifth interactive wave source.

canvasheavy complexitymoderate motionpointer

Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited

Live demo — the real component, running in a sandbox. One self-contained HTML file, zero dependencies. Open it on the canvas →
Worth keeping? Votes steer what gets built next — sign in to cast one, free to read

When to use it

Science/physics-themed hero backgrounds, generative art displays, dark ambient UI backdrops needing mathematical elegance.

When not to

Light backgrounds (hardcoded dark navy), low-end mobile (marching-squares grid is CPU-bound), or contexts needing legible foreground text.

Working with an AI agent

Every component ships agent-ready metadata. An example instruction for this one:

Change accent color from powder blue to green by replacing 'rgba(176,212,221' with 'rgba(100,255,160', increase grid resolution by changing cell to Math.max(5,m/80), and add a fifth source to the SRC array. Theme: dark tokens live in :root, the light variant in :root[data-theme="light"]; ?theme=light or a {type:'forever:theme'} postMessage switches at runtime.

Safe to edit

  • contour levels array (LV)
  • source orbit params (ox/oy/or/os/k per SRC entry)
  • cell resolution (Math.max(7,m/64))
  • accent color (rgb(176,212,221))
  • time step (t+=0.012)
  • theme tokens (:root dark defaults + [data-theme=light] overrides)

Keep intact

  • IIFE wrapper
  • prefers-reduced-motion guard + static draw fallback
  • visibilitychange pause/start
  • DPR-aware canvas sizing
  • theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)

Known limitations

  • Marching-squares loop over the full grid runs every frame — heavy on low-end devices
  • Background color hardcoded in CSS (#191B1D) and fillRect — must change both to retheme
  • Pointer nudge fades (nudge*=0.95) but never fully zeroes — minor residual effect persists

waveinterferencemarching-squarescontourgenerativephysicscanvas

More Generative Geometry components

  • Voronoi Shatter14 drifting sites partition the canvas into cool-blue Voronoi mosaic cells; moving the pointer nudges the nearest site toward the cursor.
  • Auto-MazeDepth-first maze carves itself wall by wall on a dark grid with shifting hue; a bright dot marks the active cell. Resets with a new color on completion.
  • Truchet Tiles8x8 grid of rainbow quarter-arc Truchet tiles that flip orientation in slow sine waves, weaving shifting interlocked curves across a dark background.
  • SpirographA hypotrochoid spirograph traced progressively on canvas with a shifting hue; each cycle completes then resets with new random radii and color.
  • L-System PlantAn L-system fractal plant grows branch by branch from the canvas bottom, swaying gently; clicking triggers a wobble and regrows a randomized plant.
  • Rotating Mandala12-fold mandala of 5 nested polygon rings that counter-spin, breathe in scale, and cycle through lilac-gold hues. Tap adds a spin impulse.