A sophisticated interactive web application for composing and visualizing complex generative art through the orchestration of multiple configurable algorithmic modules. Built with HTML5 Canvas and modern JavaScript (ES Modules).
- Modular Architecture: Layer-based composition system.
- Generative Modules:
- Fractal Noise: Perlin/Simplex noise with configurable octaves, persistence, and lacunarity.
- L-Systems: String rewriting and turtle graphics for plant-like structures and fractals.
- Particle Systems: Physics-based particles with forces (gravity, friction) and trails.
- Cellular Automata: Grid-based evolution (e.g., Game of Life) with custom rules.
- Reaction-Diffusion: Gray-Scott model simulation running in a Web Worker for high performance.
- Interactive Control: Real-time parameter adjustment for all modules.
- Animation Timeline: Play, pause, scrub, and speed control. Loop support.
- Layer Management: Add, remove, reorder, and blend layers using standard composition modes.
- Performance: Utilizes OffscreenCanvas (via Worker) and optimized rendering loops.
- Save/Load: Export projects to JSON and import them back.
- Export: Save high-resolution images of your creation.
- Node.js and npm installed.
- Clone the repository.
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open your browser at the URL provided (usually
http://localhost:5173).
- Add Layer: Select a module type (e.g., Fractal Noise) and click "Add Layer".
- Edit Properties: Click on the layer in the list to reveal its parameters in the properties panel. Adjust sliders and colors.
- Layer Management: Use Up/Down buttons to reorder layers. Use the "Remove" button to delete.
- Animation: Click "Play" to start the animation loop. Use the scrubber to jump in time.
- Save/Load: Save your project configuration to a JSON file or load an existing one.
- Export: Click "Export Image" to download a snapshot.
The project follows a modular, component-based architecture:
src/core/: Core engine classes.Renderer: Manages the main canvas and render loop.Layer: Abstract base class for all generative modules.LayerManager: Handles layer composition and ordering.Timeline: Manages animation time and playback state.State: Singleton for global application state.
src/modules/: Generative algorithm implementations.- Each module extends
Layerand implements specificdrawandupdatelogic.
- Each module extends
src/workers/: Web Workers for intensive tasks (Reaction-Diffusion).src/ui/: UI management and event handling.src/utils/: Helper utilities (Storage, Exporter, Math).
- Web Workers: The Reaction-Diffusion module runs its simulation in a separate thread to prevent UI blocking.
- Layer Caching: Each layer draws to its own offscreen canvas (buffer), which is then composited onto the main canvas. This allows expensive layers to update less frequently if needed.
- Efficient Rendering: Utilizes
requestAnimationFramefor smooth 60fps rendering.
- Simplex Noise implementation based on
simplex-noise.js. - Project structure generated and implemented by Jules (AI Software Engineer).