Controlling CSS Animations and Transitions with JavaScript