Generation Prompt
Page: L-Systems & Fractals
Slogan: "Where simple rules unfold into infinite complexity"
Structure:
- Widget before:title -> h1 + p.slogan centered
- Main -> Canvas in .card.full.ratio-16-9 (HD via devicePixelRatio)
- Widget after:algorithm -> L-System explanation (axiom, rules, turtle)
- Widget modal:claude -> Documentation
Presets:
- Koch Snowflake: F -> F+F--F+F, angle 60, axiom F--F--F
- Sierpinski Triangle: F -> F-G+F+G-F, G -> GG, angle 120
- Dragon Curve: F -> F+G, G -> F-G, angle 90
- Binary Tree: F -> FF, X -> F[+X][-X], angle 45
- Fern: X -> F+[[X]-X]-F[-FX]+X, F -> FF, angle 25
Controls (right widget):
- Preset dropdown
- Iterations slider (1-7)
- Animate toggle
- Reset button
Features:
- Turtle graphics interpreter: F/G (forward), +/- (turn), [/] (push/pop)
- Color gradient by recursion depth (hue shift)
- Step-by-step animation showing growth
- Auto-fit and center fractal in canvas
- HD rendering via devicePixelRatio
Animation:
- Draw segments progressively (requestAnimationFrame)
- Configurable speed
- Pause/resume capability