New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

canvas-confetti

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-confetti - npm Package Compare versions

Comparing version

to
1.7.0

35

dist/confetti.browser.js

@@ -1,2 +0,2 @@

// canvas-confetti v1.6.1 built on 2023-09-28T04:21:15.931Z
// canvas-confetti v1.7.0 built on 2023-10-02T13:33:46.734Z
!(function (window, module) {

@@ -310,3 +310,4 @@ // source content

ovalScalar: 0.6,
scalar: opts.scalar
scalar: opts.scalar,
flat: opts.flat
};

@@ -318,11 +319,23 @@ }

fetti.y += Math.sin(fetti.angle2D) * fetti.velocity + fetti.gravity;
fetti.wobble += fetti.wobbleSpeed;
fetti.velocity *= fetti.decay;
fetti.tiltAngle += 0.1;
fetti.tiltSin = Math.sin(fetti.tiltAngle);
fetti.tiltCos = Math.cos(fetti.tiltAngle);
fetti.random = Math.random() + 2;
fetti.wobbleX = fetti.x + ((10 * fetti.scalar) * Math.cos(fetti.wobble));
fetti.wobbleY = fetti.y + ((10 * fetti.scalar) * Math.sin(fetti.wobble));
if (fetti.flat) {
fetti.wobble = 0;
fetti.wobbleX = fetti.x + (10 * fetti.scalar);
fetti.wobbleY = fetti.y + (10 * fetti.scalar);
fetti.tiltSin = 0;
fetti.tiltCos = 0;
fetti.random = 1;
} else {
fetti.wobble += fetti.wobbleSpeed;
fetti.wobbleX = fetti.x + ((10 * fetti.scalar) * Math.cos(fetti.wobble));
fetti.wobbleY = fetti.y + ((10 * fetti.scalar) * Math.sin(fetti.wobble));
fetti.tiltAngle += 0.1;
fetti.tiltSin = Math.sin(fetti.tiltAngle);
fetti.tiltCos = Math.cos(fetti.tiltAngle);
fetti.random = Math.random() + 2;
}
var progress = (fetti.tick++) / fetti.totalTicks;

@@ -464,2 +477,3 @@

var scalar = prop(options, 'scalar');
var flat = !!prop(options, 'flat');
var origin = getOrigin(options);

@@ -487,3 +501,4 @@

drift: drift,
scalar: scalar
scalar: scalar,
flat: flat
})

@@ -490,0 +505,0 @@ );

{
"name": "canvas-confetti",
"version": "1.6.1",
"version": "1.7.0",
"description": "performant confetti animation in the browser",

@@ -5,0 +5,0 @@ "main": "src/confetti.js",

@@ -33,3 +33,3 @@ # [![Canvas Confetti](https://cdn.jsdelivr.net/gh/catdad-experiments/catdad-experiments-org@5ed78b/canvas-confetti/logo.jpg)](https://github.com/catdad/canvas-confetti/)

```html
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.6.1/dist/confetti.browser.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.7.0/dist/confetti.browser.min.js"></script>
```

@@ -70,2 +70,3 @@

- `drift` _Number (default: 0)_: How much to the side the confetti will drift. The default is 0, meaning that they will fall straight down. Use a negative number for left and positive number for right.
- `flat` _Boolean (default: false)_: Optionally turns off the tilt and wobble that three dimensional confetti would have in the real world. Yeah, they look a little sad, but y'all asked for them, so don't blame me.
- `ticks` _Number (default: 200)_: How many times the confetti will move. This is abstract... but play with it if the confetti disappear too quickly for you.

@@ -72,0 +73,0 @@ - `origin` _Object_: Where to start firing confetti from. Feel free to launch off-screen if you'd like.

@@ -307,3 +307,4 @@ (function main(global, module, isWorker, workerSize) {

ovalScalar: 0.6,
scalar: opts.scalar
scalar: opts.scalar,
flat: opts.flat
};

@@ -315,11 +316,23 @@ }

fetti.y += Math.sin(fetti.angle2D) * fetti.velocity + fetti.gravity;
fetti.wobble += fetti.wobbleSpeed;
fetti.velocity *= fetti.decay;
fetti.tiltAngle += 0.1;
fetti.tiltSin = Math.sin(fetti.tiltAngle);
fetti.tiltCos = Math.cos(fetti.tiltAngle);
fetti.random = Math.random() + 2;
fetti.wobbleX = fetti.x + ((10 * fetti.scalar) * Math.cos(fetti.wobble));
fetti.wobbleY = fetti.y + ((10 * fetti.scalar) * Math.sin(fetti.wobble));
if (fetti.flat) {
fetti.wobble = 0;
fetti.wobbleX = fetti.x + (10 * fetti.scalar);
fetti.wobbleY = fetti.y + (10 * fetti.scalar);
fetti.tiltSin = 0;
fetti.tiltCos = 0;
fetti.random = 1;
} else {
fetti.wobble += fetti.wobbleSpeed;
fetti.wobbleX = fetti.x + ((10 * fetti.scalar) * Math.cos(fetti.wobble));
fetti.wobbleY = fetti.y + ((10 * fetti.scalar) * Math.sin(fetti.wobble));
fetti.tiltAngle += 0.1;
fetti.tiltSin = Math.sin(fetti.tiltAngle);
fetti.tiltCos = Math.cos(fetti.tiltAngle);
fetti.random = Math.random() + 2;
}
var progress = (fetti.tick++) / fetti.totalTicks;

@@ -461,2 +474,3 @@

var scalar = prop(options, 'scalar');
var flat = !!prop(options, 'flat');
var origin = getOrigin(options);

@@ -484,3 +498,4 @@

drift: drift,
scalar: scalar
scalar: scalar,
flat: flat
})

@@ -487,0 +502,0 @@ );

Sorry, the diff of this file is not supported yet