Javascript file changed to animate the canvas