Setting up a canvas-based aquarium engine. Let me install lucide-react for icons first.
Now I'll create the aquarium engine. Starting with math/color utilities and the day/night lighting system.
Now the fish module — species definitions, the swimming AI (wander, schooling, food-seeking, pointer curiosity), and procedural fish rendering with undulating spines and flowing fins.
Now the environment module — swaying plants, bubble systems, the treasure chest, aerator, sand, light rays, and atmosphere.
Quick fix for the unused import:
Now the procedural ambient sound module (WebAudio — water bed, bubble bloops, soft pad):
Now the main App component that orchestrates the canvas engine, day/night cycle, interaction, and the glassy UI overlay:
Now the styles (fonts, base theme) and the HTML shell with title and font links:
Before building, I need to fix an interaction bug: the feed-on-click listener is on window, so clicking UI buttons would also drop food. It should only fire on the canvas itself.
Now let's build to verify everything compiles:
The build passes. Now let me polish a few visual issues I can spot in the code: the treasure chest lid animation (needs a proper side hinge to read as "opening"), the render order (moon/plankton glow should sit above the night color grade), and pointer deactivation for touch. First, the chest rewrite:
Now soften the night grade slightly and fix the render order + pointer handling in App:
Rebuilding to verify all edits:
The build is clean. Let me do a final review of the fish rendering code to catch any geometry issues, since it's the most intricate part:
The geometry checks out. Final touch — an inline SVG favicon and theme-color in the HTML:
The aquarium is complete and builds cleanly. Here's what I created:
Azura — A Slow Living Aquarium
A fully procedural, canvas-rendered fish tank that starts the moment the page loads.
Swimming fish AI (src/aquarium/fish.ts)
- 5 species with distinct behaviors: a schooling group of 9 neon tetras (boids-style cohesion/alignment with a shared drifting target), curious guppies that approach your cursor, two graceful angelfish, one slow majestic betta, and two corydoras that hug the sand and occasionally dart
- Wander/steering AI with soft wall repulsion, depth preferences, smooth heading interpolation (fish never flip upside-down), and tail-beat frequency tied to swim speed
- Bodies rendered procedurally: undulating spine, species-specific silhouettes, flowing veil/fan/fork/ribbon tails, dorsal/pectoral fins, angel stripes and filaments, guppy tail spots, cory barbels — and neon tetra stripes that glow after dark
- Feeding AI: click the water (or the Feed button) to drop pellets — fish smell, chase, and nibble them
Environment (src/aquarium/environment.ts)
- Bubbling aerator stone with a continuous wobbling stream that pops into surface ripples
- Treasure chest that creaks open on its own cycle, revealing glowing gold with sparkle glints and a burst of big bubbles
- Three depth layers of swaying plants (ribbon, broad-leaf, bushy stem, fern — some red) driven by a global water current, plus occasional "pearling" oxygen bubbles off leaf tips
- Sand bed with bumps, pebbles, river rocks, and animated caustic light shimmer; marine-snow motes; mouse-parallax between layers
Day/night cycle (src/aquarium/lighting.ts)
- A full day every ~95 seconds: dawn → midday → golden hour → twilight → deep night, with interpolated water gradients, god rays, warm overlays, moonlight, and twinkling bioluminescent plankton at night
- Modes: Auto cycle / Day / Night (transitions smoothly tween), plus a live time-of-day chip
Extras — optional procedural WebAudio ambience (brown-noise water bed, randomized stereo bubble bloops, soft drifting pad chords), glass glare streaks, vignette, cursor aura, and an add-a-fish button.
Files built: src/aquarium/utils.ts, src/aquarium/lighting.ts, src/aquarium/fish.ts, src/aquarium/environment.ts, src/aquarium/sound.ts, src/App.tsx, src/index.css, index.html