Animation script of the beat using mozilla api