Skip to content

Commit

Permalink
Merge branch 'master' into #81-emoji-confetti
Browse files Browse the repository at this point in the history
  • Loading branch information
catdad committed Oct 3, 2023
2 parents 5274299 + 320072e commit f81322b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ You can then `require('canvas-confetti');` to use it in your project build. _Not
You can also include this library in your HTML page directly from a CDN:

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

_Note: you should use the latest version at the time that you include your project. You can see all versions [on the releases page](https://github.com/catdad/canvas-confetti/releases)._
Expand Down
11 changes: 6 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,11 @@ <h2><a href="#custom-canvas" id="custom-canvas" class="anchor">Custom Canvas</a>
};

function fire(particleRatio, opts) {
confetti(Object.assign({}, defaults, opts, {
confetti({
...defaults,
...opts,
particleCount: Math.floor(count * particleRatio)
}));
});
}

fire(0.25, {
Expand Down Expand Up @@ -724,8 +726,8 @@ <h2><a href="#custom-canvas" id="custom-canvas" class="anchor">Custom Canvas</a>

var particleCount = 50 * (timeLeft / duration);
// since particles fall down, start a bit higher than random
confetti(Object.assign({}, defaults, { particleCount, origin: { x: randomInRange(0.1, 0.3), y: Math.random() - 0.2 } }));
confetti(Object.assign({}, defaults, { particleCount, origin: { x: randomInRange(0.7, 0.9), y: Math.random() - 0.2 } }));
confetti({ ...defaults, particleCount, origin: { x: randomInRange(0.1, 0.3), y: Math.random() - 0.2 } });
confetti({ ...defaults, particleCount, origin: { x: randomInRange(0.7, 0.9), y: Math.random() - 0.2 } });
}, 250);
},
snow: function snow() {
Expand Down Expand Up @@ -770,7 +772,6 @@ <h2><a href="#custom-canvas" id="custom-canvas" class="anchor">Custom Canvas</a>
gravity: 0,
decay: 0.94,
startVelocity: 30,
shapes: ['star'],
colors: ['FFE400', 'FFBD00', 'E89400', 'FFCA6C', 'FDFFB8']
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "canvas-confetti",
"version": "1.7.0",
"version": "1.8.0",
"description": "performant confetti animation in the browser",
"main": "src/confetti.js",
"module": "dist/confetti.module.mjs",
Expand Down

0 comments on commit f81322b

Please sign in to comment.