-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Birthday confetti on ambassador card #87
Conversation
Thats looking quite nice. Thanks for working on this. alveus-confetti.movSome pointers:
|
There should be a party hat that shows on the card too? That's been a feature for quite a while. |
Yeah this was a spontaneous PR, i will resolve the existing issues
No problem I can play around with those parameters post some examples.
I will also change the config to a static json file. Should I add this config to the data repo? I will also put all the other Items you named on list.
Idea: See something like a party mode done with this |
The data repo is generally for shared data between the site and the extension. I think it'd be best to keep it in this repo. I notice it takes a URL currently, but I wonder if there's a way to just pass an object directly in for the config? A file feels like an unnecessary extra step? |
Yes that is possible, the Partical component has a prop "options" which takes a json object. |
👋 Hey @jontok, just wanted to check in here to see how things were going, and if you need any help from us to get this across the line? |
Hey @MattIPv4 , thanks for asking.
|
This feels like it's because the particle emission starts before its figured out the size of the container -- can we delay the particles for a few milliseconds to give it time to figure things out?
It seems like the particles always fill the screen -- I'm not sure this is how I'd expect it to happen. Can we not have them always emit from the card itself, so they are always positioned relative to the card? For example, center the emitter at the center of the card, and then put it behind the card maybe? |
I have now played around with the delay. If the card is already rendered the particles don't have the scaling issue. But changing the delay does not change anything.
No the emitters always have an absolute position. We can change the size and position of the canvas but then the particles are only on a small part off the screen and will not overflow the parent element. |
Right, that works with what I am saying -- have the canvas still be the full size of the screen, that's fine, but compute the emitter position based on the card, so that the particles are emitted from the center of the card. And, we can position the canvas behind the card, so that the particles appear to be coming out of the card.
Perhaps at the same time as computing the position of the emitter, we can also compute the width/height of the canvas and set that on the particles component, so it doesn't have to compute that itself, which might be the source of the scaling issue? |
I'm going to close this out as there hasn't been any movement in quite a while and there are some conflicts. Feel free to re-open or create a new PR if you intend to continue working on this! |
Resolves #72
Added a confetti effect via the react-particles package and tsparticles.
Effect was tested on desktop (Firefox, Chromium) and with a running stream.
The confetti.json URL can be changed to either a static config.json file or to a different particle config URL.