15 October 2025

Add a Little Joy to your Buttons #JoelKallmanDay


Recently we were sitting outside at a café having a coffee and a slice of apple pie, something we do often. This is nothing remarkable, but when we ordered using our phone the last step had a little surprise when clicking the Pay-button.
Clicking on that button showed a shower of confetti on your screen. Even though the coffee and apple pie were overpriced, it still made me smile (maybe that's why they added it to the order page).
A quick google-action turned up this little Javascript-library (also has a demo of it): https://confettijs.org/
How easy is it to add this to your APEX application? Very easy!

The first step is to download the Javascript from the link above and upload it to your Static Application Files (Shared Components > Static Application Files > Create)
The next step is to include this Javascript in your page:
At Page Level look for "File URL" in the Javascript-section and add the following line

  #APP_FILES#confetti.min.js
  
Also at the Page Level, in the section "Execute when Page Loads" add the following code:
  let confetti = new Confetti('confetti'); // the argument is the static ID of the Button
  // Edit given parameters
  confetti.setCount(75);
  confetti.setSize(2);
  confetti.setPower(25);
  confetti.setFade(false);
  confetti.destroyTarget(false); // Will remove the button if true
  
The last step is to add a Static ID to the button where you want to add joy:


No comments:

Post a Comment