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
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
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 like this
Build a Confetti and Fireworks Celebration Effect in a Single HTML File
A ready-to-paste prompt that builds a reusable canvas confetti and fireworks layer with color theme presets, burst size control, Web Audio pops and automatic particle cleanup.
Build an Animated Beating Heart Diagram With Blood Flow in One HTML File
A ready-to-paste prompt that builds an animated heart cross-section with color-coded blood flow, opening and closing valves, a heart rate slider and a soft synthesized lub-dub.
Build an Animated Dawn-to-Night Landscape Scene in a Single HTML File
You get one HTML file that draws a canvas valley village whose sky, sun, moon, stars, clouds and window lights all follow a single time-of-day scrubber with autoplay.
Build an Interactive Particle Network Background With Mouse and Touch Controls
A single HTML file with a full-screen canvas particle network that links nearby dots, reacts to mouse and touch, and has density, color and low-power controls.
Build a Parallax Starfield Night Sky Hero Section on Canvas in One HTML File
A prompt that produces a single HTML hero section with a three-layer canvas starfield, pointer and tilt parallax, shooting stars, a density slider and a calm mode.
Build an Interactive Particle Network Background with Live Controls in HTML
A prompt that produces one HTML file with a cursor-reactive canvas particle network and live sliders for density, link distance, color and speed.