Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to "unrandomize" the physics of a fetti instance. #236

Open
nzayatz14 opened this issue Sep 27, 2024 · 0 comments
Open

Add a way to "unrandomize" the physics of a fetti instance. #236

nzayatz14 opened this issue Sep 27, 2024 · 0 comments

Comments

@nzayatz14
Copy link

Hi there!

I am currently adding confetti on a button click that shoots up behind the button. I have 2 separate instances of confetti that I am showing on click of the button.

  1. A single text message "Thanks!" that goes straight up and down.
  2. A confetti of smiley face emojis.

Here is what I have currently:

Screen.Recording.2024-09-27.at.10.55.05.AM.mov

And here is a version without the smiley faces:

Screen.Recording.2024-09-27.at.10.43.08.AM.mov

I would like to make it so the "Thanks!" text pops up to the exact same height every time, but with the existing code structure it does not look like I can do that currently (I'm guessing by looking at the randomPhysics() function: https://github.com/catdad/canvas-confetti/blob/320381b361231b4eb51c4068ad73d125efad3121/src/confetti.js#L338C12-L338C25)

Would be it possible to add some sort of config item (or items?) that allow for disabling the randomness of the initial shot height?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant