Build a Click-to-Launch Fireworks Celebration Animation in One HTML File

A prompt that produces a single HTML page where clicks, taps or keys launch fireworks with gravity, fading trails, soft synthesized pops and a mute toggle.

You getone complete HTML file in a single code block, then 3 short ideas to extend it.

The prompt

Prompt
Act as a senior creative front-end developer who specializes in canvas animation and Web Audio.

Build "Night Bloom", a fireworks celebration page with a deep indigo night sky. Clicking or tapping anywhere launches a rocket from the bottom of the screen. The rocket climbs to the pointer position and bursts into glowing sparks that follow simple physics: initial velocity, air drag, gravity and a fade over their lifetime. Each frame lays a translucent dark fill over the canvas so sparks leave soft fading trails.

Rules:
1. Controls: pointer down launches at that spot. Space or Enter launches at a random spot, F fires a 12-rocket finale, A toggles an auto show and M toggles sound. Also show visible Mute, Auto show and Finale buttons with aria-pressed states.
2. Offer four burst styles chosen at random: peony sphere, ring, golden willow with long drooping trails, and crackle with flickering sparks. Use six warm and cool hue families.
3. Sound: use the Web Audio API only. Create the AudioContext on the first interaction. Play a filtered-noise whoosh on launch and a soft pop made of a low sine thump plus a noise burst. Pan each pop by its screen position and keep the master volume low.
4. Layout: use a full-window canvas sized for devicePixelRatio that redraws on resize. Show the title, a one-line instruction and a burst counter. Make it readable from 360 to 1280px wide.
5. With prefers-reduced-motion, use fewer sparks, no trails, flashes or flicker, and no auto show.

Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.

Example output

One HTML file. Save it and open it in any browser.Open full screen

Example: Night Bloom, a click-to-launch fireworks sky.

Click or tap anywhere and a rocket climbs to that spot, then blooms into sparks that slow down, fall under gravity and fade into trails. Each burst is a peony, ring, golden willow or crackle. Press Space for a random launch, F for a finale and A for an auto show. Use the Sound button or M to mute the soft pops. Try tapping fast in one spot to stack bursts.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Spelling out drag, gravity and a translucent trail fill gives a convincing particle look without any library or tricky math.
  • Creating the AudioContext on the first click avoids browser autoplay blocks, so sound works on the first try.
  • Exact keys, buttons and reduced-motion behavior leave the model nothing to guess, so the file runs as is.

Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as night-bloom.html and open it in any modern browser, or run it in the chat's preview or canvas panel. Click once to enable sound.

Common edits

  • Swap the hue families and sky color for a theme, such as gold and white for a wedding or team colors for a match win.
  • Raise the spark counts or gravity to tune the look, or drop rule 3 for a silent version.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Animations & Effects