MCPcopy Index your code
hub / github.com/Source-Controller/eCommerce-Fullstack / runConfetti

Function runConfetti

lib/utils.js:3–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import confetti from "canvas-confetti";
2
3export const runConfetti = () => {
4 var count = 200;
5 var defaults = {
6 origin: { y: 0.7 }
7 };
8
9 function fire(particleRatio, opts) {
10 confetti(Object.assign({}, defaults, opts, {
11 particleCount: Math.floor(count * particleRatio)
12 }));
13 }
14
15 fire(0.25, {
16 spread: 26,
17 startVelocity: 55,
18 });
19 fire(0.2, {
20 spread: 60,
21 });
22 fire(0.35, {
23 spread: 100,
24 decay: 0.91,
25 scalar: 0.8
26 });
27 fire(0.1, {
28 spread: 120,
29 startVelocity: 25,
30 decay: 0.92,
31 scalar: 1.2
32 });
33 fire(0.1, {
34 spread: 120,
35 startVelocity: 45,
36 });
37}

Callers 1

successPayFunction · 0.90

Calls 1

fireFunction · 0.85

Tested by

no test coverage detected