canvas-confetti icon indicating copy to clipboard operation
canvas-confetti copied to clipboard

Permanent collecting confetti

Open MatthewTrout opened this issue 5 years ago • 3 comments

Discovering this library has made my day! :confetti_ball: Could it be possible to have the confetti optionally collect at the edge of the screen / canvas where the gravity is pulling towards (i.e. the bottom)?

MatthewTrout avatar Aug 25 '20 15:08 MatthewTrout

Thanks for reaching out. This is a pretty neat idea!

I'm not sure if I'll have the time for this any time soon. But since Hacktoberfest is coming up, here are my initial thoughts:

  • Drawing accumulated confetti on the same canvas would be a performance issue. We probably want to add a second canvas to the page to hold the accumulated confetti while the first canvas draws the animation.
  • There are some questions to consider about destroying the confetti. Should destroying clear everything (probably)? Should there be a different method to stop the current animation (maybe)? Should there be a different method to clear out the accumulated confetti (probably)?
  • There are some things to figure out for the API to use a custom canvas. Does that API need to take multiple canvases now?
  • There is a non-trivial amount of work to make confetti stack and for the accumulated pile to grow larger realistically.

catdad avatar Aug 27 '20 22:08 catdad

Thanks for responding, this all makes sense. Just building on this and equally dumping my thoughts:

  • Either as an option or as part of the feature, the confetti could have a timeout to aid with performance. After which it could fade out and be removed, meaning that the accumulated confetti pile would conceivably have a maximum volume at any one time. It would still give the impression of a permanence, without being overbearing.

MatthewTrout avatar Sep 19 '20 10:09 MatthewTrout