diff --git a/configs.js b/configs.js index 317becf..2f54836 100644 --- a/configs.js +++ b/configs.js @@ -3,12 +3,12 @@ const configs = (function () { // settings const enableLimit = true; // true or false - const limit = 10; // integer + const limit = 5; // integer // animation - const scrollSpeed = 30; // milliseconds (DO NOT PUT BELOW 5, COMPUTER MIGHT CRASH) the lower the value, the faster the scroll + const scrollSpeed = 30; // milliseconds const pauseBetweenScrolls = 2000; // milliseconds - const gapBetweenScrolls = "100px"; // px + const gapBetweenScrolls = "50px"; // px // STYLES // task list diff --git a/scripts/taskList.js b/scripts/taskList.js index 5c3db54..08192d4 100644 --- a/scripts/taskList.js +++ b/scripts/taskList.js @@ -857,7 +857,12 @@ async function checkToAnimate() { document.querySelector(".secondary").style.display = "none"; // cancel animations - cancelAnimation(); + if (primaryAnimation) { + primaryAnimation.cancel(); + } + if (secondaryAnimation) { + secondaryAnimation.cancel(); + } scrolling = false; } } @@ -867,10 +872,6 @@ function addAnimationListeners() { primaryAnimation.addEventListener("finish", animationFinished); primaryAnimation.addEventListener("cancel", animationFinished); } - if (secondaryAnimation) { - secondaryAnimation.addEventListener("finish", animationFinished); - secondaryAnimation.addEventListener("cancel", animationFinished); - } } function animationFinished() { @@ -887,6 +888,7 @@ function cancelAnimation() { secondaryAnimation.cancel(); } scrolling = false; + console.log("animation cancelled"); } (function () {