oneshotlm
Compare all models on this prompt →

Fireworks · glm-4.7

Create a fireworks display on a full-screen canvas where clicks launch shells that explode into gravity-affected, fading particle bursts.

⛨ sandboxed Open in new tab ↗
transcript · 4 messages
user

Create a fireworks display on a full-screen canvas where clicks launch shells that explode into gravity-affected, fading particle bursts.

assistant
thinking
The user wants a full-screen fireworks display with the following features:
1. Full-screen canvas
2. Clicks launch shells that explode
3. Particles are affected by gravity
4. Particles fade over time

I need to create a single index.html file with:
- HTML5 canvas element
- CSS for full-screen styling
- JavaScript for:
  - Canvas setup and resizing
  - Firework/Shell class that launches upward
  - Particle class for explosion effects
  - Gravity physics
  - Fading/fading out particles
  - Click event handling
  - Animation loop

Let me create this complete, self-contained file.

I'll create a full-screen fireworks display with click-to-launch shells, gravity-affected particles, and fading effects. Let me build this complete single-page app.

write /workspace/index.html (10689 bytes)
toolResult

Successfully wrote 10689 bytes to /workspace/index.html

assistant
thinking
I've created a complete fireworks display in a single index.html file. The app includes:

1. Full-screen canvas with a dark gradient background
2. Star field with twinkling effect
3. Shell class that launches rockets upward with trailing effect
4. Particle class for explosion effects with:
   - Gravity physics (particles fall down over time)
   - Fading/alpha decay
   - Trail effects
   - Air resistance
5. Click/touch handling to launch fireworks at target location
6. Auto-launch feature for demo purposes
7. All CSS and JS inline, no external dependencies

The fireworks will:
- Launch from bottom of screen when clicked
- Travel to the click position
- Explode into colorful particles
- Particles are affected by gravity and fade out over time
- Each explosion has 80-150 particles plus sparkle particles
- Colors are randomly selected from a vibrantpalette

I've created a complete fireworks display in a single `index.html` file. Here's what it includes: **Features:** - **Full-screen canvas** with a dark night sky gradient background - **Twinkling stars** in the background for atmosphere - **Click-to-launch** - click anywhere to launch a firework shell to that position - **Touch support** for mobile devices **Physics & Effects:** - **Shells** launch upward with trailing sparks, slowing down as they rise - **Explosions** create 80-150 colorful particles per burst, plus white sparkles - **Gravity** pulls particles downward naturally - **Air resistance** gradually slows particle movement - **Fading** particles smoothly fade out over time - **Trails** each particle leaves a fading trail behind it **Colors:** - 11 vibrant firework colors randomly selected (red, green, blue, yellow, magenta, cyan, orange, pink, lime, white, purple) **Demo:** - Auto-launch feature occasionally fires random fireworks for demonstration Just open the file in a browser and click anywhere on the screen to launch fireworks!

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

modelglm-4.7
vendorZ.ai · GLM
harnesspi-agent
generated2026-07-22

EVALUATION

4/5 working

Fireworks launch and explode with colorful gravity-affected particle bursts on click, wheel, and even key presses; drag alone barely triggers anything.

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.

idle motion0.5%
on click1.5%
on drag1.1%
on wheel4.5%
on enter + space1.4%
on arrow keys5.3%
on w/a/s/d7.4%
frame spread13.4 / 255
console errors0
js errors none

METRICS

runtime111.9s
tokens in2.5k
tokens out2.9k
cached2.9k
cost / run$0.0062