Last active
August 15, 2018 13:58
-
-
Save alexko30/16fbe575ea357f608fcd71326101d122 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const state = document.querySelector('#tweeningState'); | |
document.querySelector('#playPauseButton') | |
.addEventListener('click', toggle()); | |
let between = new Between(0, 400) | |
.time(2000) | |
.on('pause', () => { | |
state.innerText = 'state: paused'; | |
}).on('play', () => { | |
state.innerText = 'state: running'; | |
}); | |
function toggle() { | |
if (between.isPaused) | |
between.play(); | |
else | |
between.pause(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment