Create Celebration Fireworks/Confetti Animations With DOM-Particles Library

Category: Animation , Javascript | March 31, 2023
Author:Gigabyte5671
Views Total:1,098 views
Official Page:Go to website
Last Update:March 31, 2023
License:MIT

Preview:

Create Celebration Fireworks/Confetti Animations With DOM-Particles Library

Description:

DOM-Particles is a simple and lightweight JavaScript particle library that applies a configurable animated fireworks/confetti animation to DOM elements when clicked.

Great for special events or milestones, creating interactive buttons or call-to-action elements.

How to use it:

1. Create an empty DIV container for the DOM-Particles.

<div id="particle_container">
</div>

2. Load the DOM-Particles Library’s files in the HTML document.

<link rel="stylesheet" href="dom-particles.css">
<script src="dom-particles.js" defer></script>

3. Trigger the animation on click.

<div onclick="createEmitter(event)">
  ...
</div>

4. Change the color of the particles.

changeColour('341DEC')

You Might Be Interested In:


Leave a Reply