Fractals & Automata
L-System Fern
A fractal fern draws itself branch by branch via an L-system grammar, coloring segments brown-to-gold by depth; it holds then restarts.
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
Nature-themed hero backgrounds, generative art showcases, algorithmic illustration demos.
When not to
Contexts needing instant full visuals — 3.4s draw cycle means content appears progressively. Avoid on light backgrounds (hardcoded dark theme).
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change the palette to warm amber/orange tones by replacing PAL with ['#7a2f0a','#b84b1a','#e06530','#ff9b5b','#ffcba0','#ffe0c7','#fff0e8','#ffffff'] and slow growth to 5 seconds by changing GROW_PER_SEC to SEGN/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
- recursion depth (DEPTH=5)
- branch angle (ANG = 23 * Math.PI/180)
- palette array (PAL)
- grow duration (GROW_PER_SEC=SEGN/3.4)
- hold pause (holdUntil=t+2200)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- pre-computed typed Float32Array segments (critical for perf)
- IIFE wrapper
- visibilitychange pause/resume
- reduced-motion static fallback (drawTo(SEGN) + return)
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- DEPTH=5 is near the cap of 9000 segments; increasing to 6+ will silently truncate at the hard cap
- Light re-theme via the [data-theme=light] token block; catalog bg/accent describe the dark default
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.
- Domain WarpSlowly flowing domain-warped fractal noise rendered in green, sage, and ink tones; layered fbm warp passes produce marbled smoke patterns.
- SierpinskiSierpinski triangle accretes from 26,000 chaos-game points, glowing red on near-black; recent points flash white-hot before cooling.