How to make confetti when button is pressed (JavaScript)

I have been trying to achieve this now for a few hours and can not get it to work, even asked ChatGPT for help but no luck… anyone that can guide me in the right direction?

Are you using any specific JS and CSS to accomplish this? Are you using Toolbox?

If it’s taken more than a few hours it may be more efficient to buy a plugin that does this exact process for 5-10$. There are some decent ones.

Yes im using Toolbox and no, no specific JS just trying a few! I have been looking at the plugins but i’m more doing this to learn and understand :slight_smile:

Edit: Just got it to work… always after i make a post hahah

Good stuff. Perseverance pays off.

1 Like

Solution:

Create a HTML block on the page and paste the following:
<script src="https://cdn.jsdelivr.net/npm/tsparticles-confetti@2.9.3/tsparticles.confetti.bundle.min.js"></script>

Create a JavaScript Workflow when the button is clicked:
confetti({
particleCount: 100,
spread: 70,
origin: { y: 0.6 },
});

4 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.