Live data from Hacker News

A useful front-end confetti animation library

github.com

51–60 of 125 posts

Re: A useful front-end confetti animation library

#51

You have also Party.js library: https://party.js.org/

Ah, but which one is smaller? 10.4 kB Minified, 4.2kB Minified + Gzipped 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 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 wh…

>Probably doesn't take into account code-splitting or being able to import just what you need

Correct. It doesn't.

Re: A useful front-end confetti animation library

#54

You have also Party.js library: https://party.js.org/

OP script feels way more performant on mobile.

And 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.

Re: A useful front-end confetti animation library

#57

[flagged]

I pressed the power button on my monitor, and now the website is all black.

seriously what is up with people who believe JS should not exist on the web? We are way past that now. It's not gonna happen. Reactive apps are just required for some parts of the modern web.

Re: A useful front-end confetti animation library

#58
Aside from being a cool and useful library, this is a good example of what John Ousterhout calls "deep modules" in Philosophy of Software Design.

It's very easy to use the most basic version of this library (summon confetti) but you can get a lot out of it by exploring the options presented (snow, specific colours, different confetti effects, etc.).

Re: A useful front-end confetti animation library

#60
post #55

This is cool and impressive. At the same time I don't want to see it running on any website that I use. And especially - I wouldn't want to see confetti accompany newsletter popups or adding products to basket.

> https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pref...

You can site your browser to prefer reduced motion. Site owners and library maintainers should be respecting this when implementing things like confetti. This library in particular has a `disableForReducedMotion` option.

Post reply on HN