JavaScript Confetti Library is an amazingly simple yet powerful tool, that you can add to any website for just 3.2kB br compressed.

All you need to add to your <head> is the below script.

PortableText [components.type] is missing "code"

CSS

This is all just for visuals of the text, the JavaScript for JS Confetti does all the work.

PortableText [components.type] is missing "code"

JavaScript

We added to the id title an animation using the CSS animation:animateText 2s infinite; this will run continuously. Now you can get the animationiteration event, which is triggered for every iteration of this animation.

The only line that we need for the actual confetti is below. This is adding a mix of colors

PortableText [components.type] is missing "code"
PortableText [components.type] is missing "code"
Draft off Turn on