Generative Geometry
Sierpinski Zoom
A Sierpinski triangle fractal endlessly zooms into itself with rainbow-cycling hues in a seamless self-similar loop. Tap to burst the zoom speed.
canvasmedium complexityintense 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, math/generative-art showcases, screensaver-style displays needing perpetual motion.
When not to
Light backgrounds (hardcoded dark brown canvas). Contexts where constant high-motion competes with readable content.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change the zoom period to 4000 for faster cycling, set depth from 6 to 7 for finer detail, and shift base hue by adding 120 to the hue calculation so colors start in the green range. 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
- zoom period (period=6000)
- fractal recursion depth (depth=6)
- base triangle size (s*0.62)
- hue formula (t*0.03+size*0.5+depth*40)
- slow rotation amplitude (Math.sin*0.05)
- background color (#120c06)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- seamless scale wrap (Math.pow(2,z) with modulo period)
- IIFE wrapper
- visibilitychange pause
- prefers-reduced-motion guard with static fallback
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Recursive canvas fill calls — depth>7 may stutter on low-end devices
- Background color is hardcoded in both CSS and JS fillRect — must change both
- No aria label on canvas element
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.