-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
32 lines (25 loc) · 778 Bytes
/
main.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
const timer = document.querySelector("#timer")
const itens = document.querySelectorAll(".radioOption")
const play = document.querySelector("#btnjogar")
//
function modificabtn(interruptor){
play.remove()
if(interruptor){
const btnreplay = document.querySelector("#espaco")
btnreplay.innerHTML = "<button id='btnreplay' class='botoes'>Replay</button>"
btnreplay.addEventListener("click", ()=>{
window.location.reload()
})
}
}
var tempo;
play.addEventListener("click", () => {
itens.forEach(element => {
if(element.checked){
tempo = element.attributes.value.value
modificabtn(false)
chamaCronometro(tempo, timer)
delayTrocaCores(tempo)
}
});
})