A recreation of a flash animation in javascript