Your code was a bit incomplete since the actual update in the animation loop was missing. Try it with the below code.
Updated demo: https://paper-steep-winter.glitch.me/
Since the link to glitch will expire at some point, I’m referring to the following code section which was missing in your app: