Download confetti.js file
Link the confetti.js
file to your html
page
<script src="confetti.js"></script>
Place this code inside <body>
<script>
const start = () => {
setTimeout(function() {
confetti.start()
}, 1000); // 1000 is time that after 1 second start the confetti ( 1000 = 1 sec)
};
// for stopping the confetti
const stop = () => {
setTimeout(function() {
confetti.stop()
}, 30000); // 5000 is time that after 5 second stop the confetti ( 5000 = 5 sec)
};
start();
stop();
</script>
All done! Preview the page now. Should look like this