Confetti animation as a web component
yarn add lit-confetti
First, import the module in your page.
<script type="module" src="https://unpkg.com/lit-confetti/dist/esm/index.js"></script>
Then, add the element to the page.
<lit-confetti
gravity=1
count=40
></lit-confetti>
Attribute | Type | Description |
---|---|---|
gravity |
number |
How fast the confetti papers fall |
count |
number |
Limit for the max amount of confetti papers to create at once |
gradient |
boolean |
Confetti papers will have a gradient between 2 colors set |
colors |
string[] #RRGGBB color format |
Possible colors to choose from when generating a confetti paper. By default rainbow colors are used. |
- add tests
- check if it's worth it to Schedule updates to occur just before the next frame.