-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
55 lines (39 loc) · 1.3 KB
/
scripts.js
File metadata and controls
55 lines (39 loc) · 1.3 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
var power = false;
let powerBtnText = document.getElementById('powerBtn');
powerBtnText.textContent = 'OFF';
powerBtnText.style.backgroundImage = 'radial-gradient(circle, rgb(250, 94, 94), rgb(198, 2, 2))';
var counterDisplay = document.getElementById('counterDisplay');
counterDisplay.style.color='rgb(53, 53, 53)';
const powerBtn =()=>{
if(power){
power = false;
reset();
powerBtnText.textContent = 'OFF';
counterDisplay.style.color='rgb(53, 53, 53)';
powerBtnText.style.backgroundImage = 'radial-gradient(circle, rgb(250, 94, 94), rgb(198, 2, 2))';
}
else{
power = true;
counterDisplay.style.color='white';
powerBtnText.textContent = 'ON';
powerBtnText.style.backgroundImage = 'radial-gradient(circle, rgb(10, 253, 10), rgb(3, 128, 3))';
}
}
let count = 0;
const countDisplay = document.getElementById("counterDisplay");
let decreament = function () {
if (count >= 1 && power) {
count--;
countDisplay.textContent = count;
}
};
let Increament = function () {
if(power){
count++;
countDisplay.textContent = count;
}
};
let reset = () => {
count = 0;
countDisplay.textContent = count;
};