Fractals & Automata
Sierpinski
Sierpinski triangle accretes from 26,000 chaos-game points, glowing red on near-black; recent points flash white-hot before cooling.
canvasmedium complexitymoderate motion
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 showcases, screensaver-style ambient displays with a mathematical aesthetic.
When not to
Light-background UIs (background hardcoded near-black). Contexts needing immediate full image — triangle builds over many frames before settling.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change palette to cyan/teal: set COLD=abgr(80,200,200,255), WARM=abgr(160,240,240,255), HOT=abgr(230,255,255,255) and update pip background to #a0f0f0. 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
- point count cap (MAXPTS=26000)
- points per frame (PER_FRAME=260)
- color palette (COLD/WARM/HOT abgr values)
- vertex positions (ax/ay percentages)
- pip CSS color (#c8beff)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- Uint32 direct pixel write (allocation-free loop)
- IIFE wrapper
- visibilitychange pause/resume
- drawStatic reduced-motion fallback with seeded RNG
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Animation auto-stops when MAXPTS reached — resize resets and restarts
- Background color hardcoded in both CSS and JS buffer fill — must change both
- No interactivity; pointer position has no effect on the chaos game
More Fractals & Automata components
- Mandelbrot ZoomEscape-time Mandelbrot set zooms slowly into a filigree boundary seam, rendered in smooth red-to-gold color bands on a near-black background.
- Julia MorphJulia set fractal whose complex constant traces a slow Lissajous loop, morphing green filaments between connected and dendritic forms over ~70 seconds.
- Game of LifeConway's Game of Life with glowing magenta cells aging through three color tiers; field reseeds automatically when population collapses.
- LeniaLenia smooth-life automaton: glowing teal-to-cyan blobs drift and pulse on a dark field via a typed-array convolution sim scaled up with CSS.
- L-System FernA fractal fern draws itself branch by branch via an L-system grammar, coloring segments brown-to-gold by depth; it holds then restarts.
- Domain WarpSlowly flowing domain-warped fractal noise rendered in green, sage, and ink tones; layered fbm warp passes produce marbled smoke patterns.