mirror of
https://github.com/ivabus/gui
synced 2025-06-07 15:50:27 +03:00
confetti colors (#665)
This commit is contained in:
parent
fa590e7985
commit
e9b5253e3e
1 changed files with 9 additions and 1 deletions
|
@ -12,6 +12,8 @@
|
||||||
|
|
||||||
$: isAnimating = false;
|
$: isAnimating = false;
|
||||||
|
|
||||||
|
const colors = ["#00FFD0", "#2675F5", "#8000FF"];
|
||||||
|
|
||||||
const playConfetti = async () => {
|
const playConfetti = async () => {
|
||||||
if (isAnimating) {
|
if (isAnimating) {
|
||||||
return;
|
return;
|
||||||
|
@ -27,7 +29,13 @@
|
||||||
root.appendChild(canvas);
|
root.appendChild(canvas);
|
||||||
|
|
||||||
const myConfetti = confetti.create(canvas, { resize: true });
|
const myConfetti = confetti.create(canvas, { resize: true });
|
||||||
await myConfetti({ particleCount: 500, spread: 360, startVelocity: 20, gravity: 0.5 });
|
await myConfetti({
|
||||||
|
particleCount: 500,
|
||||||
|
spread: 360,
|
||||||
|
startVelocity: 20,
|
||||||
|
gravity: 0.5,
|
||||||
|
colors
|
||||||
|
});
|
||||||
|
|
||||||
root?.removeChild(canvas);
|
root?.removeChild(canvas);
|
||||||
isAnimating = false;
|
isAnimating = false;
|
||||||
|
|
Loading…
Reference in a new issue