![]() |
|
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.
|
![]() |
|
to turn it into a bookmarklet, do this: 1. grab the minified js from the CDM, i.e. https://cdn.jsdelivr.net/npm/[email protected]/dist/conf... 2. remove the comments at the start and end 3. paste it into the template below
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) |
![]() |
|
I think the only "legitimate" use would be something like YouTube's like button, which has a cool animation (and vibrates the device if using the mobile app). Very pleasant UX.
|
![]() |
|
Useful for annoying your visitors? 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?! |
![]() |
|
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). |
![]() |
|
Wouldn't it be crazy if there was a snow storm that had so many flakes, the gravitational constant was reduced because of the extra time it took to render them all?
|
![]() |
|
It's only meaningful to consider that our world is a simulation if it is an imperfect one, otherwise you're just using "simulation" as an awkward synonym for "reality". 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. |
![]() |
|
Hell, they let you edit the code samples. Slap the code in a for(let i = 0; i < 100; i++){ and watch the magic. Really impressive how it doesn't slow down the rest of page. |
![]() |
|
Great job! Nice and realistic.
Did you build Framework integrator like useEffect for React or Directive for Angular?
It could be great to enforce developper adoption.
|
![]() |
|
Same utility as animations in general. Such animation as this one for example fits when a user receives something or solves a challenge and similar
|
![]() |
|
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.
|
![]() |
|
The developer has of course provided a print stylesheet (expect no less from a pro). Just print it, frame it, hang it up on the wall and voilà! A no-JS confetti demo right there in your living room.
|
![]() |
|
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.
|
![]() |
|
I haven't understood this approach. If you're going as far as not using js, do you not use a mobile phone? No loyalty programs? No credit cards? How intense is your approach towards security?
|