Live data from Hacker News

A useful front-end confetti animation library

github.com

61–70 of 125 posts

Re: A useful front-end confetti animation library

#62

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

OP script feels way more performant on mobile.

OP is more performant on desktop Windows as well. The other one visibly lags when animating even a single cannon of confetti.

Re: A useful front-end confetti animation library

#63
post #38

Earlier quoted context omitted.

Did it work? Did she say yes?

She said no - but we went on to be great friends still to this day, so I'd say it did work. We joke about it still.

That's nice :)

I'm curious though - did you use tabs or spaces?

Re: A useful front-end confetti animation library

#64
post #15

Earlier quoted context omitted.

Hard to get much more obvious than that. How else did you think this was implemented as a front-end library?

If someone told me it was pure CSS, I'd believe them. I'm not a frontend dev, so I'm always impressed by what you can now do without having to import a whole JS library.

a whole JS library gasp

libraries are in every language.

Re: A useful front-end confetti animation library

#65
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.

The strange thing is this can be used effectively. I don't know about full-screen like this, but we were visiting a client recently who used a certain project management software and when you closed an item out, the button changed to green and had this effect on it.

It was subtle, but noticeable enough that after the meeting another developer and I both said "that was a pretty neat effect". It conveyed the sense of "yay, progress!".

Just make it optional.

Re: A useful front-end confetti animation library

#66
post #40
post #30

So the trick for performant animation here is to draw on canvas and put the canvas in front of all other elements but disable pointer events on canvas so that you can still interact with the page.

Correct! Disable Pointer Events has surprising utility!

What if you wanted to add the requirement that the user had to click on 1 specific piece of confetti?

Re: A useful front-end confetti animation library

#68
post #11

Just fyi, confetti are candies in italy. Not bits of paper.

Interesting. It's also cognate with "confection". https://www.etymonline.com/search?q=confetti

> 1815, "small pellets made of lime or soft plaster, used in Italy during carnival by the revelers for pelting one another in the streets," [...] the custom was adopted in England by early 19c. for weddings and other occasions, with symbolic tossing of little bits of paper (which are called confetti by 1846).

Re: A useful front-end confetti animation library

#69
post #38

Earlier quoted context omitted.

Did it work? Did she say yes?

She said no - but we went on to be great friends still to this day, so I'd say it did work. We joke about it still.

I knew someone that made a PowerPoint presentation for their partner for Valentine's Day. So you're doing great in comparison

Re: A useful front-end confetti animation library

#70
post #57

Earlier quoted context omitted.

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.

> what is up with people who believe JS should not exist on the web

They said it: privacy

Post reply on HN