Commit
Author: isaacthefallenapple [46586828+isaacthefallenapple@users.noreply.github.com]
Committer: GitHub [noreply@github.com] Tue, 30 May 2023 18:02:25 +0000
Hash: 46ebb70f63341c5db841abbec7a73ebe4e9c7ee8
Timestamp: Tue, 30 May 2023 18:02:25 +0000 (1 year ago)

+14 -2 +/-2 browse
fix #375 (#376)
fix #375 (#376)

When cleaning up after an animation has finished, instead of toggling
which button to show, simply always show the play button.
1diff --git a/docsite/js/animations.js b/docsite/js/animations.js
2index 9dc3ae3..55adae7 100644
3--- a/docsite/js/animations.js
4+++ b/docsite/js/animations.js
5 @@ -1,9 +1,9 @@
6- import {toggleIcons} from './easing.js'
7+ import {showPlayIcon} from './easing.js'
8
9 const cleanup = e => {
10 setTimeout(()=> {
11 e.target.style = ''
12- toggleIcons(e.target.querySelector('button'))
13+ showPlayIcon(e.target.querySelector('button'))
14 }, 500)
15 }
16
17 diff --git a/docsite/js/easing.js b/docsite/js/easing.js
18index 2a40170..d718e4a 100644
19--- a/docsite/js/easing.js
20+++ b/docsite/js/easing.js
21 @@ -18,6 +18,18 @@ export const toggleIcons = button => {
22 })
23 }
24
25+ export const showPlayIcon = button => {
26+ button
27+ .querySelectorAll('use')
28+ .forEach(icon => {
29+ if (icon.getAttribute('href') === '#play-icon') {
30+ icon.classList.remove('hidden')
31+ } else {
32+ icon.classList.add('hidden');
33+ }
34+ })
35+ }
36+
37 // play buttons
38 document
39 .querySelectorAll('.play-button')