A nicely detailed tutorial by Kirupa that gets into how you might provide a UI with persisted options that control whether animations run or not.
The trick is custom properties that control the movement:
Which are used within animations and transitions:
animation: bobble 2s infinite;
transition: transform calc(var(–toggle) * .15s) ease-in-out;
// stop animation
// play animation
… Read article
The post Toggling Animations On and Off appeared first on CSS-Tricks.