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.
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.
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.
Pipedrive CRM also does this when you close a deal, they even previously had a person shooting a hoop or something, that was nice. It's rewarding!
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 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.
Correct. It doesn't.
I love a fun little projects like this that are purely for a good time. That's why I started programming and it's still a driving force.
There are some software engineering costs to this approach, but, as is transparently obvious to all thoughtful observers, the benefits massively outweigh them, so I say go for it.
> 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).
Click the "snow" button enough (https://catdad.github.io/canvas-confetti/) and you'll get a horizontal line separating the pre-slowdown flakes from the post-slowdown flakes. I suppose that's the kind of simulation imperfection that we might look for.
Personally, I don't think we're hacking our way out of this one any time soon, so I'm happy to just call it reality.
Why on earth would they not enable the setting which honours the `prefers-reduces-motion` media flag for users who don't want stuff flying all over their screens?!
This is a Javascript library, but it couldn't have been JS back in those days.
Anyone have an idea how people built stuff like this without JS? I'm curious.
and watch the magic. Really impressive how it doesn't slow down the rest of page.
I have a difficult time believing that there is any utility in a confetti animation library when that confetti is shown over a page in a web browser.
What could the utility of showing confetti over a webpage possibly be?
I don’t know why web devs feel like they need to tell users when they’ve succeeded at something like clicking a button.
People understand when they’ve accomplished something. We don’t need rituals around this, even simple ones like this.
Is that a known phenomenon?
> If you happened to get curious and changed the particle count to 400 or so, you saw something disappointing. An even "flattened cone" look to the confetti, making it look way too perfect and ruining the illusion.
I love it! This kind of attention to detail is rare in this world, and I cherish it wherever I find it - whether it's in statistical visualization, movie props, or website confetti.
(As a solution, I'd probably go for changing the random distribution directly. I'd check of course, but I'm guessing the real-life distribution approximates a gaussian.)
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.).
Maybe they could use some of this better performing code to make it feel lighter.
Other than "fun" sites and sparing usage ... I wouldn't want to see such animations everywhere though.
1. grab the minified js from the CDM, i.e. https://cdn.jsdelivr.net/npm/canvas-confetti@1.9.2/dist/conf...
2. remove the comments at the start and end
3. paste it into the template below
javascript: (async () => { /* paste minified JS here */ ; confetti();})();
4. (optional) customize the confetti()-call5. copy the result and paste it into bookmark
This works on most pages (tested on some tabs I have open), but it does not seem to work on hackernews itself. Here it gives me ContentSecurityPolicy-Error when creating the worker. (at least it does in edge)
It was fun to present it in demos, but it can also be annoying to users.
Thanks!
This library is an awesome chromebook killer. I need to find something more optimized. But it does the trick!