Aquarium breach · claude-opus-5
Create a large glass aquarium whose side panel develops a visible crack and then bursts. The simulation must include: - Water escaping through the opening with flow strength based on water depth and decreasing as the tank drains - A curved water jet affected by gravity - A spreading puddle that collides with the room boundaries - Fish, rocks, plants, and a floating toy reacting differently according to density, buoyancy, drag, and current - Objects transitioning correctly from underwater motion to airborne motion and then to floor collisions - Fish attempting to swim against the current before being swept through the breach - Glass fragments with angular velocity, collisions, and water resistance - A visible waterline that lowers continuously rather than disappearing all at once Let the user drag the crack vertically before triggering the failure. A lower crack should initially produce a stronger jet than a higher crack. Give me 1 html file
transcript · 6 messages
Create a large glass aquarium whose side panel develops a visible crack and then bursts. The simulation must include: - Water escaping through the opening with flow strength based on water depth and decreasing as the tank drains - A curved water jet affected by gravity - A spreading puddle that collides with the room boundaries - Fish, rocks, plants, and a floating toy reacting differently according to density, buoyancy, drag, and current - Objects transitioning correctly from underwater motion to airborne motion and then to floor collisions - Fish attempting to swim against the current before being swept through the breach - Glass fragments with angular velocity, collisions, and water resistance - A visible waterline that lowers continuously rather than disappearing all at once Let the user drag the crack vertically before triggering the failure. A lower crack should initially produce a stronger jet than a higher crack. Give me 1 html file
I'll build this as a single self-contained HTML file with a custom physics simulation.
{"command":"ls -la /tmp/ws"}total 0 drwxr-sr-x. 2 node node 6 Aug 3 00:22 . drwxrwsrwx. 3 root node 16 Aug 3 00:22 ..
thinking
I'm planning a canvas-based simulation with a room containing a water tank. The tank will have a draggable crack marker on its right panel that can be positioned vertically, and clicking a "Burst" button will trigger the breach. For the physics, I'm using Torricelli's equation to calculate the water jet velocity based on the depth difference between the water level and the breach point, then computing the flow rate to gradually lower the water level as it leaks out. The water particles will spawn at the breach with horizontal velocity from the jet and minimal vertical velocity, then fall under gravity to hit the floor and contribute to a puddle. The puddle itself will be a 1D height field across the room floor that spreads via diffusion and shallow water dynamics, colliding with walls as it accumulates. I'm also modeling various objects with different densities—fish that actively swim and can be swept by the current toward the breach, rocks that sink, plants that sway while anchored, and toys that float. The current field will simulate flow toward the breach with magnitude decreasing by distance squared, like a sink effect. When fish reach the breach, they'll exit into the air with gravity and air drag, then bounce and flop on the floor. Glass fragments from the burst will be polygons with angular velocity and realistic collision physics including restitution and friction. The waterline will be drawn as an animated wavy line that continuously lowers as the tank empties. Now I'm setting up the coordinate system and tank geometry—canvas is 1000x640 pixels, the room floor sits at y=600 with walls from x=20 to x=980, and the tank occupies x=180 to x=820 with a top at y=140 and bottom at y=580. The breach is on the right panel at x=820, positioned vertically at crackY which can be dragged between the top and bottom edges. I'm using Torricelli's law to calculate outflow velocity based on water depth, then computing the rate at which the water level drops based on flow rate and tank cross-section. Particles spawn proportional to the flow rate with velocity from the jet plus jitter, and when they hit the floor they add to the puddle height field which has 200 cells across the room width. For the puddle spreading, I'm using a shallow water relaxation approach where adjacent cells exchange volume based on height differences and slope, with walls blocking flux at boundaries. The puddle spreads across the entire room floor behind the tank, and once the water level inside the tank drops below the crack, the flow stops but the remaining water stays inside—realistic behavior. Eventually the panel could burst or the opening could grow, but for now I'm keeping it simple. When the panel does burst, the opening expands from the crack point with its half-height growing over time, and I'm calculating the drain flow using Torricelli's law integrated over the submerged portion of the opening. This gives a continuous drain that tapers as the water level drops until it reaches the bottom of the opening. For the jet dynamics, I'm weighting particle spawn positions by depth within the submerged opening and giving each particle a velocity based on the pressure at that depth. Near the breach, I'm modeling a point sink current that pulls nearby objects inward, and fish respond by swimming against this current up to their maximum swim speed—if the current's too strong, they get pulled toward the opening anyway. Once an object passes through the opening region, it transitions to a free state outside the tank where gravity, air drag, and the jet stream all apply. I'm treating all objects uniformly with a circular body, density, and type-specific behavior—plants can uproot and become debris if the current's strong enough, and glass fragments are handled as polygon shapes. For collisions, I'll handle fragment-to-floor, fragment-to-walls, and circle-based fragment-to-fragment interactions. The rendering will include glass with a nice gradient, water with caustics and bubbles, and a wet floor with puddle reflections. The UI needs instructions, a draggable slider for the crack, and buttons for burst, reset, and refill. I'm using a fixed timestep of 1/120 with up to 4 substeps per frame to keep the simulation stable. Writing the implementation... Writing the simulation code... Buoyancy calculation accounts for object density relative to water—rocks sink, toys float strongly, fish stay nearly neutral. I'm approximating the submerged fraction for circular objects based on surface intersection. Now adding bubbles to both the tank and jet, plus glass shards that radiate outward from the burst panel region, and I need to draw the crack pattern before the burst happens. For the crack mechanics, I'm implementing a phase system: intact → cracking (with spreading visuals and sound over 0.9 seconds) → burst. The crack itself is a static jagged pattern centered at the impact point, and stress can build automatically when the user presses space. For the puddle physics, I'm setting up shallow-water simulation with momentum and diffusion—water piles up against room boundaries using a flux calculation based on height differences, with inertia to create realistic spreading behavior. The tank won't block the puddle—water flows around it, so I'll just draw the puddle after the tank to make it appear in front. Now I'm setting up the scene with 7 fish, 5 rocks, 4 plants, and a rubber duck toy. For fish exiting, they need to pass through the opening on the right panel; objects stay inside the interior walls except where the opening allows them to escape, and I'm tracking which objects are in the tank to handle collisions properly. Writing the code...
/tmp/ws/index.html (51234 bytes)Successfully wrote 51234 bytes to /tmp/ws/index.html
TAKE IT TO CODE
A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.
RUN
EVALUATION
Fish tank crack simulation; space/arrows trigger tank breach with water jetting out and fish/water draining, looks polished.
Vision grade · anthropic/claude-sonnet-5
MEASUREMENTS
Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.