Maybe I am asking the wrong question completely. I have read quite a bit and seen quite a bit of HTML 5 capabilities; however, I have not yet had time to sit down and really start utilizing any of it yet :(, but hope to soon.
Anyway, I was curious if I could do the following with HTML5 and how to begin to implement it. Or, if this does not work, then how can I make it work?
I have a popcorn image (1 piece of popped popcorn that is).
I wanted to create a canvas and on a button click, start a chain of this image being randomly “popped” onto the canvas, slowly at first then gaining speed until such time there should be a stopping point.
Anyone who has popped popcorn can understand what I am looking to do here.
Is this possible to do easily?
I’ve popped popcorn and, yep, you can do this. Load the popcorn image by creating an
Imageobject and setting itssrcattribute. Use the image’sonloadproperty to start the animation. Given the animation’s duration k, use a sine curve,sin(x/(k/π)), to calculate the number of kernels to show per frame.Here’s one way of doing it, demo here: http://jsfiddle.net/uyk63/8/