Generative Geometry
Perlin Flow-Field
100 peach-gold particles stream along a value-noise flow field on dark charcoal; cursor deflects nearby particles within a 120px radius.
canvasmedium complexitymoderate motionpointer
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-mode hero backgrounds, generative art demos, ambient looping canvases where subtle interactivity rewards exploration.
When not to
Light backgrounds (hardcoded dark charcoal). Contexts requiring legible text overlays — trails accumulate over content.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change particle count from N=100 to 200, shift hue range from 350–410 to warm amber (30–60), and increase deflection radius from 120 to 180. 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
- particle count (N=100)
- hue range (h: Math.random()*60+350)
- trail fade opacity (rgba(6,10,18,0.06))
- flow speed (1.6 multiplier)
- cursor deflection radius (120)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- DPR-aware canvas sizing
- visibilitychange pause
- reduced-motion static pre-render fallback (60 frames)
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Value-noise function is a sine approximation — lacks true Perlin coherence at large scales
- Background color hardcoded in both CSS and canvas fill — must update both to change theme
- No touch pointer support beyond pointermove (works but no explicit touch handler)
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.