Remix Library / Art & Animation

Fireworks

Click anywhere to launch a firework. Hundreds of glowing particles, a few lines of physics.

Beginner HTML · CSS · JavaScript
No account needed: you’ll start as a guest.
read-only · remix to edit
Preview

What you'll learn

  • Particle systems
  • Gravity & friction
  • HSL colors
  • Trails with transparency
  • Mouse clicks

Challenges

Remix it, then try these. Each one is a bit harder than the last.

  1. Change how many sparks each firework makes.
  2. Set AUTO_EVERY to 200 for a finale, then make the finale stop after 10 seconds.
  3. Give each firework two colors instead of one.
  4. Make a firework that explodes into a heart or star shape.
  5. Add a crackle: sparks that split into smaller sparks when they fade.