ConfettiSwiftUI icon indicating copy to clipboard operation
ConfettiSwiftUI copied to clipboard

Possibility to have a layover that just lets rain down a continuous stream of confetti across the with of a view

Open peterscmdt opened this issue 2 years ago • 2 comments

Is there a possibility to have a layover that just lets rain down a continuous stream of confetti across the with of a view? (As opposed to letting the confetti originate from an object on screen like a button or so.)

peterscmdt avatar Jul 26 '23 12:07 peterscmdt

You could create a full screen overlay in a Zstack as one of your most outer views and pass down the state variable to the desired child view.

simibac avatar Jul 28 '23 05:07 simibac

Hi, thanks for your comment! Still, I would have the issue that the confetti originates from one specific point inside my view, right? What I meant was the option to basically generate confetti particles that randomly originate from the the top of a view, across its whole width, if that makes sense. Similar to what you can see on the attached picture. Screenshot 2023-07-31 at 18 25 41

peterscmdt avatar Jul 31 '23 16:07 peterscmdt

This can be achieved by offsetting the trigger point of the explosion to the top of the screen. To adjust the visual, I suggest you play around with the openingAngleand closingAngle.

simibac avatar Jan 13 '25 00:01 simibac