By · Updated

Fireworks Screensaver

Virtual Fireworks Display You Launch on Click or Let Run on Its Own

No ratings yet

Press Play to start

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Fireworks works

This fireworks screensaver runs full screen in a browser. Press Play and rockets climb from the bottom of the screen, slow, and burst into a ball of coloured sparks that drift and fade. Click anywhere on the canvas to launch one where you want it. Turn the launch rate up for a finale, make the bursts bigger, lengthen the trails, and put it fullscreen on a screen you are not using.

Fireworks screensaver: getting a good result

Fireworks are the classic first example of a particle system, the technique behind almost every spark, splash, flame and smoke effect in games and film. The term comes from William Reeves at Lucasfilm, who used it in 1983 to describe the wall of fire in the Genesis sequence of Star Trek II. The idea is simple: instead of animating one complicated object, you spawn many tiny ones, give each a position, a velocity and a lifetime, and apply the same few rules to all of them every frame. This fireworks simulator needs only two kinds of particle, rockets and sparks, and a handful of lines of physics.

How the fireworks simulator works

A rocket starts at the bottom of the canvas with a strong upward speed, scaled to the height of the screen so bursts land in the upper part on any display, plus a small random sideways drift. Gravity slows it every frame. When its upward speed has almost gone, at the top of its arc, it is replaced by a burst: a ring of sparks at that point, each given a random direction and a random speed.

Sparks feel gravity too, but more gently, and they lose 2 % of their speed every frame to air drag. That drag is why a burst flies out fast, slows, hangs for a moment and then droops, which is exactly the shape of a real peony shell. Each spark lives for roughly one to two seconds and fades as it ages, so the outer edge of a burst dims first.

Colour works like a real shell. Each rocket picks a hue at launch, and its sparks inherit it with a small random spread, so a burst reads as one colour with some variation rather than a rainbow. The rocket itself is drawn pale so it stays visible without competing with the burst.

The three sliders

Slider Range What it changes
Launch rate 0 to 20 The chance of an automatic launch each frame
Burst size 2 to 12 Sparks per burst, 12 per step, and how fast they fly
Trail length 1 to 10 How slowly the previous frames fade out

At 60 frames a second, a launch rate of 4 averages between two and three rockets a second, a steady display. At 20 it is about twelve a second, a finale. At 0 nothing launches on its own and the sky is yours: click anywhere on the canvas to fire a rocket from that point along the bottom, at any rate setting.

Burst size runs from 24 sparks at 2 to 144 at 12. Large bursts fly faster and fill more of the screen, and take longer to fall.

Trails are a painter's trick rather than extra particles. The canvas is never fully cleared. Instead, every frame is covered by a translucent near-black layer, so everything already drawn dims a step and the trail behind each spark is the ghost of earlier frames. At 1 the layer is almost opaque and you see only the current positions. At 10 it is thin, so streaks linger and a heavy volley builds up a glowing haze.

Reading the result

The panel refreshes about twice a second with two counts:

If the animation stutters on an older phone, watch the Sparks count as you lower the burst size or launch rate. Smoothness returns once it drops, because the work per frame grows with the number of live particles.

Where real fireworks get their colours

The simulator picks hues at random, but a pyrotechnician is limited by chemistry. Each colour comes from a metal salt that glows at a characteristic wavelength when heated:

Tips

FAQ

Why do the rockets sometimes burst at different heights?

Each rocket gets a slightly different launch speed, so it runs out of upward momentum at a different height. A real display does the same, and a uniform row of bursts at exactly one height looks mechanical, so the variation is deliberate.

Can I set the launch rate to zero and only click?

Yes. With the rate at zero nothing launches on its own and each click sends one rocket up from the bottom at that position. This is the mode to use if you want to fire a particular pattern or time bursts to music playing elsewhere.

Why does it slow down with a very high rate and burst size?

Every spark is drawn individually, and a finale with big bursts can put several thousand sparks on screen at once. Most computers handle that at full frame rate, but on an old laptop or a very large fullscreen display it can start to stutter; bring the burst size down a notch and it recovers.

Does it have sound?

No. The display is silent by design, since people usually run it as a backdrop with their own music or in a quiet room. Sound would also need to be loaded from somewhere, and this page loads nothing but its own script.

See also: all Simulations & Screensavers tools, Images, Audio, Video & Screen, PDF, SVG, Generative Art, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.

Related tools