5 ms·
You have also Party.js library: https://party.js.org/ https://party.js.org/
by lovegrenoble 3y ago
You have also Party.js library: https://party.js.org/ https://party.js.org/
- flanbiscuit 3y agoAh, but which one is smaller? 10.4 kB Minified, 4.2kB Minified + Gzipped https://bundlephobia.com/package/canvas-confetti@1.9.2 https://bundlephobia.com/package/canvas-confetti@1.9.2 28.3kB Minified, 7.4kB Minified + Gzipped https://bundlephobia.com/package/party-js@2.2.0 https://bundlephobia.com/package/party-js@2.2.0 caveat: I don't know how bundlephobia works, it might not give the best representation of the final size of the package. Probably doesn't take into account code-splitting or being able to import just what you need. I'm just using it as a quick and general overview. Looks like confetti one beats it by a few KB gzipped so either works depending on which one has the feature you need, unless you're really trying to squeeze those kb.
- scoot 3y ago>Probably doesn't take into account code-splitting or being able to import just what you need Correct. It doesn't.
- taikahessu 3y agoOP script feels way more performant on mobile.
- apocalyptic0n3 3y agoAnd on Firefox for Mac. Noticed dropped frames pretty consistently in party.js. No such problem with Canvas Confetti, even when there are significantly more particles on screen. I had to increase the count to a point where I couldn't see gaps between them before I saw any lag whatsoever.
- baobabKoodaa 3y agoOP is more performant on desktop Windows as well. The other one visibly lags when animating even a single cannon of confetti.
- henriquecm8 3y agoOP's library feels a lot more performant, in my old work computer with 3 click you can notice some lag with Party.js. With canvas-confetti, it only starts to lag when I click non-stop for a few seconds, probably invoking more than 30 instances of confetti and a lot of particles.