A simple javascript animation using HTML5 Canvas