Generative Geometry
Cellular Automaton
1D elementary cellular automaton scrolls downward row-by-row, cycling through rules 30/90/110 and more; oldest rows fade, newest glow at the wavefront.
canvasmedium complexitymoderate motionclick
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
Worth keeping?
Votes steer what gets built next — sign in to cast one, free to read
When to use it
Dark ambient backgrounds, generative/algorithmic art displays, screensaver-style loops, math or science visualizations.
When not to
Light-background layouts (black hardcoded). Contexts needing legible text overlays — the constant vertical motion competes with reading.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change the rule cycle to show only Rule 30 and Rule 110 by setting RULES=[30,110], and slow the scroll to every 5 frames by changing acc%3 to acc%5. 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
- rule list (RULES array)
- scroll speed (acc%3 frame divisor)
- cell pixel size (cell = min(W,H)/120)
- fade range (0.16+age*0.84)
- background and cell color (#000000 / #f2f2f2)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- DPR-aware canvas sizing and setTransform
- visibilitychange pause/start
- prefers-reduced-motion static render branch
- IIFE wrapper
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Background hardcoded to black — must edit CSS and ctx.fillStyle to change theme
- Click jumps to next rule but reseeds immediately, causing a visible flash
- No aria label on the canvas click target
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.