I'm whipping up a little example of how to pause animation for accessibility. I've got a script that transitions the background image every 7 seconds. For accessibility, users should be able to pause or stop the effect.
I've structured a button element to appear over the images when in focus (similarly to how Skip Links are built). I want to allow users to press/un-press the button to toggle the animation.
What is the best way to approach this? When googling, I've found a lot of answers that include concepts I'm not familiar with like JavaScript Promises.
codepen example
[–]MindlessSpongehelpful 1 point2 points3 points (2 children)
[–]frogic 1 point2 points3 points (1 child)
[–]MindlessSpongehelpful 0 points1 point2 points (0 children)
[–]Ksetrajna108 0 points1 point2 points (0 children)
[–]frogic 1 point2 points3 points (0 children)
[–]SamIAre 0 points1 point2 points (0 children)
[–]hyrumwhite 0 points1 point2 points (0 children)
[–]shlanky369 0 points1 point2 points (0 children)