// create the interval that creates the timer | |
function createTimer() { | |
interval = setInterval(() => { | |
// 1. increment our count | |
count++; | |
// 2. calculate the offset and apply it | |
const offset = height * count; | |
// 3. apply the offset using css transforms | |
numbersArea.style.transform = `translateY(-${offset}px)` | |
// 4. stop the interval at 10 | |
if (count >= 10) { | |
// go to the next episode | |
clearInterval(interval); | |
} | |
}, 1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment