summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-01-10 11:34:30 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-01-10 11:34:30 +0800
commit0a18ee1c89962cfee6b81b018d9bb7d007d486f7 (patch)
tree613fae6c6f08f408b489424ec2a3850b3a028179 /public
parent409a97f13b17c6a9423a958a2e7c4dd0fd029671 (diff)
globaled mainInterval
Diffstat (limited to 'public')
-rw-r--r--public/js/randomblob.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/public/js/randomblob.js b/public/js/randomblob.js
index 5ea80ed1..a32045f2 100644
--- a/public/js/randomblob.js
+++ b/public/js/randomblob.js
@@ -1,6 +1,7 @@
"use strict";
var isFirstTime = true;
+var mainInterval;
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
@@ -50,9 +51,10 @@ function main() {
resetBlob();
isFirstTime = false;
}
- setTimeout(main, getRandomInt(7500, 30000));
+ mainInterval = setTimeout(main, getRandomInt(7500, 30000));
}
blob.addEventListener('click', function () {
+ clearTimeout(mainInterval);
main(getRandomInt(7500, 30000));
});
main(); \ No newline at end of file