Organic & Nature
Fractal Tree
A recursive 7-level fractal tree grows from the base with a wind sway animation; green blossoms appear at tips; pointer horizontal position bends the tree.
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
Nature or organic-themed hero backgrounds, generative art sections, ambient screensaver-style displays.
When not to
Layouts requiring text legibility over the canvas — dark background is hardcoded and branches fill the viewport.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change branch depth to 9, set blossom color to pink (change 100 to 320 in the hsla leaf fillStyle), and slow wind sway by setting t*1.2 to t*0.6. 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
- branch depth (depth=7 in branch() call)
- base trunk length (Math.min(W,H)*0.21)
- branch spread angle (0.42)
- blossom hue base (100 in hsla)
- sway wind amplitude (0.05 multiplier)
- grow-in cycle duration (t*0.25 modulo 6)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- visibilitychange cancelAnimationFrame guard
- DPR-aware canvas sizing
- prefers-reduced-motion t increment guard
- IIFE-equivalent top-level scoping via const
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
Known limitations
- Recursive branch() redraws every branch every frame — depth 8+ noticeably expensive on mobile
- Light re-theme via the [data-theme=light] token block; catalog bg/accent describe the dark default
- grow-in animation restarts on a 6-second cycle indefinitely
More Organic & Nature components
- Growing VineA sinuous green vine grows upward sprouting 14 alternating leaves and a pale bud tip, then retracts in a seamless loop on a dark forest background.
- Flickering FireAdditive-blended ember particles rise from a glowing orange base, flickering like a real flame; cursor pans left/right to fan the fire sideways.
- Water RippleConcentric ripple rings expand across a deep teal water surface with shimmering caustic bands; tap anywhere to drop a new ripple. Auto-drops periodically.
- Lightning BoltJagged lightning bolts with branching forks strike randomly down a dark storm-sky canvas; screen flashes rust-white on each strike. Tap to trigger instantly.
- Falling SnowUp to 110 depth-layered snowflakes drift and sway down a dark blue gradient; pointer movement shifts a wind force that nudges the entire flurry sideways.
- Drifting CloudsPuffy white clouds with radial-gradient puffs and soft blue undersides drift across a layered sky gradient; pointer nudges them forward.