A JavaScript library to brighten up your user's site experience with visual effects!
npm install party-js
Installation •
Usage •
Contributing
The library is written in TypeScript and compiled to an UMD module to allow integration into different environments.
You can grab the latest version from jsdelivr.
``html`
The library instance is loaded into the global party object.
If you are using a package-managed environment, you can also install the latest version via [npm].
`bash`
npm install party-jsor
yarn add party-js
To use it, simply require or import it.
`ts`
import party from "party-js";
// or
const party = require("party-js");
The library essentially offers a fully customizeable particle-system implementation into HTML documents. Users of the library have the ability to create and fine-tune effects to their individual liking. The library offers a few simple effects right out-of-the-box, so you don't have to waste time re-creating simple effects.
`js`
document.querySelector(".button").addEventListener("click", function (e) {
party.confetti(this, {
count: party.variation.range(20, 40),
});
});
If you want to learn more, check out the quick start guide!
- _"The particles are getting cut off inside the screen!"_
When creating the particle container, the library calculates the document
's size _once_. If your document size changes during the lifetime of your application you can either: 1. Remove the
#party-js-container`. This forces the library to re-initialize the container and will re-calculate the size. All particles will remain in memory, so nothing will be lost.First of all, thank you so much for wanting to contribute to the project! ❤
Please refer to the contribution guidelines when opening issues or creating pull requests.
[npm]: https://www.npmjs.com/package/party-js