Creating Confetti
Answered
Tonkinese posted this in #help-forum
TonkineseOP
Hey,
How can i create Confetti in NextJS?
How can i create Confetti in NextJS?
Answered by B33fb0n3
np, please mark solution: https://nextjs-forum.com/post/1184602609139581070#message-1184604401436983347
31 Replies
you can use an npm package. I am using this: https://www.npmjs.com/package/confetti-js
you can find a demo here: https://agezao.github.io/confetti-js/ @Tonkinese
TonkineseOP
Okay thank you
np, please mark solution
TonkineseOP
@B33fb0n3 I cant get it working
right click on my message -> apps -> mark solution
if you don't know how 🙂
if you don't know how 🙂
TonkineseOP
No i mean the package i cant get it working 😉
haha lol. There are many confetti packages out there. You might want to test some ^^
here you can find [some](https://www.google.com/search?q=npm+confetti+js&sca_esv=590686989&rlz=1C1CHBF_deDE1030DE1030&sxsrf=AM9HkKkiUqxqP-s-4ZmmDgNMbDEBlS_9yw%3A1702503423501&ei=_yN6Za2FHpqK9u8PobqysAg&ved=0ahUKEwjtgKW-r42DAxUahf0HHSGdDIYQ4dUDCBE&uact=5&oq=npm+confetti+js&gs_lp=Egxnd3Mtd2l6LXNlcnAiD25wbSBjb25mZXR0aSBqczIMECMYgAQYigUYExgnSI8MUIAFWI4HcAF4AZABAJgBQaABgAGqAQEyuAEDyAEA-AEB-AECwgIKEAAYRxjWBBiwA8ICDRAAGIAEGIoFGEMYsAPCAgoQIxiABBiKBRgnwgIQEAAYgAQYFBiHAhixAxiDAcICCxAAGIAEGLEDGIMBwgIIEAAYgAQYsQPCAgoQABiABBgUGIcC4gMEGAAgQYgGAZAGCg&sclient=gws-wiz-serp)
here you can find [some](https://www.google.com/search?q=npm+confetti+js&sca_esv=590686989&rlz=1C1CHBF_deDE1030DE1030&sxsrf=AM9HkKkiUqxqP-s-4ZmmDgNMbDEBlS_9yw%3A1702503423501&ei=_yN6Za2FHpqK9u8PobqysAg&ved=0ahUKEwjtgKW-r42DAxUahf0HHSGdDIYQ4dUDCBE&uact=5&oq=npm+confetti+js&gs_lp=Egxnd3Mtd2l6LXNlcnAiD25wbSBjb25mZXR0aSBqczIMECMYgAQYigUYExgnSI8MUIAFWI4HcAF4AZABAJgBQaABgAGqAQEyuAEDyAEA-AEB-AECwgIKEAAYRxjWBBiwA8ICDRAAGIAEGIoFGEMYsAPCAgoQIxiABBiKBRgnwgIQEAAYgAQYFBiHAhixAxiDAcICCxAAGIAEGLEDGIMBwgIIEAAYgAQYsQPCAgoQABiABBgUGIcC4gMEGAAgQYgGAZAGCg&sclient=gws-wiz-serp)
But the problem is, that it doesnt is over the whole page
I want it to be over the whole page, as other packages
you can update the css to the full VW and full VH. Maybe you want to set the position to absolute and the zindex to 100 or more
TonkineseOP
Yeah i want it to be over all components
so over the whole page
Do i have to make it in the layout?
you added this code to get it working: ^
Now you can change the css of the canva. You should put it somewhere to top or the bottom of the page. Not in the middle
Now you can change the css of the canva. You should put it somewhere to top or the bottom of the page. Not in the middle
TonkineseOP
Yes, i dont know how to place the canvas so that the confetti fits over the whole page
This is my problem you know
TonkineseOP
When it is rendert, it stretches the full page
after you done that, you need to call the javascript code inside the same component: https://nextjs-forum.com/post/1184602609139581070#message-1184611400270749766
TonkineseOP
then you can style your canva inside your css: https://nextjs-forum.com/post/1184602609139581070#message-1184610486457741352
TonkineseOP
I had to do it like that:
@Tonkinese Click to see attachment
that looks better
TonkineseOP
Thank you â¤ï¸
Answer
TonkineseOP
ðŸ‘