-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
33 lines (31 loc) · 1.06 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
let score = 0;
const talks = ["メッセージはでないはずだよ", "ありがとう!", "ありがとう!!", "救われました", "すき!", "感謝", "圧倒的感謝", "幸せ", "やったーーーー", ":happy:"]
const countUp = function() {
score++;
const scoreElement = document.getElementById("score");
const talkElement = document.getElementById("talk");
scoreElement.innerText = score;
if (score <= 9) {
talkElement.innerText = talks[score];
} else {
const boostElement = document.getElementById("boost");
boostElement.style.display = "";
}
}
let isboost = false;
let interv = undefined;
const boost = function() {
if (isboost) {
clearInterval(interv);
isboost = false;
return;
}
isboost = true;
const talkElement = document.getElementById("talk");
talkElement.innerText = "ぐおーーー";
interv = setInterval(function(){
score++;
const scoreElement = document.getElementById("score");
scoreElement.innerText = score;
}, 16);
}