canvas-confetti
canvas-confetti copied to clipboard
skip drawing particles that are outside the canvas area
Sounds amazing!
Sorry, clicked the wrong button.
To clarify a bit more on this issue: I don't actually know if browsers already automatically don't draw elements that are not within the viewable area. Certainly they are not part of a paint, but I am not sure what costs there are. Since we realistically need to still calculate where a confetti is during the animation, we can only save part of the cost (if it in fact exists in the first place). This one is more of a reminder to do the required research, since it doesn't seem that I can find an easy answer.