A lightweight, dependency-free and responsive javascript plugin for particle backgrounds.
To install particles.js you can download the latest version, install it via npm:
or use the CDN:
Include the minified JS file in your HTML (right before the closing body tag):
Add a canvas element to your markup (it should be the last element):
Add a few styles to your css:
And Initialize the plugin on DOM ready:
Method | Description |
---|---|
pauseAnimation | Pauses/stops the particle animation |
resumeAnimation | Continues the particle animation |