forever components

Generative Geometry

Reaction Diffusion

Gray-Scott reaction-diffusion simulation morphing between coral, spots, and maze patterns on a 128x128 grid; teal-to-bone color ramp on near-black.

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

Ambient generative backgrounds, science/nature themes, creative portfolio hero sections needing organic texture.

When not to

Low-end devices — runs 5-8 simulation steps per frame on a pixel loop. Contexts requiring legible text overlays or bright backgrounds.

Working with an AI agent

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

Change the color ramp stops array to warm amber/orange tones (e.g. replace [57,217,138] with [255,160,50]) and increase GW/GH to 192 for sharper detail. 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

  • grid resolution (GW=128, GH=128)
  • color ramp stops array
  • feed/kill parameter drift (params() function)
  • diffusion rates (DA=0.18, DB=0.09)
  • pointer seed radius (dy/dx loop ±2)
  • steps per frame (iter=5)
  • theme tokens (:root dark defaults + [data-theme=light] overrides)

Keep intact

  • buffer-swap pattern (a/a2, b/b2)
  • visibilitychange pause/resume
  • reduced-motion static fallback (3200 pre-steps then draw)
  • theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)

Known limitations

  • CPU-bound per-pixel loop — heavy at large grid sizes
  • 128x128 grid upscaled via CSS pixelated rendering — sharp but blocky at large viewport
  • No touch-specific pointer handling; pointermove on mobile may feel sluggish

reaction-diffusiongray-scottgenerativecanvassimulationorganicpattern

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.