-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
39 lines (30 loc) · 928 Bytes
/
app.js
File metadata and controls
39 lines (30 loc) · 928 Bytes
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
34
35
36
37
38
39
let clicks = 0;
document.getElementById("clicks").innerHTML = clicks;
function countClick() {
navigator.vibrate(11);
clicks++;
document.getElementById("clicks").innerHTML = clicks;
}
function resetCounter() {
clicks = 0;
document.getElementById("clicks").innerHTML = clicks;
}
let timerInput = document.getElementById("time"); // Импут
function myTimer() {
alert("Время вышло");
}
//setTimeout(myTimer, yourTimer);
function test1() {
let yourTimer = +timerInput.value; // Значение импута (таймер)
console.log(yourTimer);
}
function test() {
let yourTimer = +timerInput.value*1000; // Значение импута (таймер)
if (yourTimer < 1) {
alert("Задайте время");
console.log(yourTimer);
} else {
resetCounter();
setTimeout(myTimer, yourTimer);
}
}