HTML
<button id="confetti">¡Libera el confetti! </button>
<canvas id="custom_canvas"> </canvas>
<script src="https://cdn.jsdelivr.net/npm/js-confetti@latest/dist/js-confetti.browser.js"></script>
<script src="./script.js"> </script>
JS
const button = document.getElementById('confetti')
const canvas = document.getElementById('custom_canvas')
const jsConfetti = new JSConfetti({ canvas })
setTimeout(() => {
jsConfetti.addConfetti()
}, 500)
button.addEventListener('click', () => {
jsConfetti.addConfetti()
})