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

yPosition of confetti should be customizable #58

Open
afif-nass opened this issue May 23, 2023 · 0 comments
Open

yPosition of confetti should be customizable #58

afif-nass opened this issue May 23, 2023 · 0 comments

Comments

@afif-nass
Copy link

@loonywizard love the project; thank you for your work.

It looks like rightConfettiPosition and leftConfettiPosition use the following variable to determine the vertical launch location of the confetti:

var yPosition = canvasHeight * 5 / 7;

I don't know why those specific numbers are used, but I'm assuming the intention is to get a position that is a bit above the bottom of the canvas so the confetti effect appears more natural. However, it would be nice to be able to control where the confetti launches vertically.

We should be able to pass a float that gets used to calculate yPosition. Example of potential usage:

// In front-end 

jsConfetti.addConfetti({
    confettiColors: ['#ff0a54', '#ff477e', '#ff7096', '#ff85a1', '#fbb1bd', '#f9bec7'],
    emojiSize: 50,
    confettiNumber: 20,
    yPositionMultiplier: 0.5
});

// In node module

var yPosition = canvasHeight * yPositionMultiplier;
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