-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathmain.js
54 lines (42 loc) · 1.37 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
let num = 0;
function increment(){
let value = ++num;
console.log(value);
document.querySelector(".output").innerHTML = value;
}
increment()
function decrement(){
let value2 = --num;
console.log(num);
document.querySelector(".output").innerHTML = value2;
}
decrement()
function onglow(){
let glow = document.querySelector(".output");
if (glow) { // Check if the element exists
if (glow.style.webkitBoxShadow === "" || glow.style.webkitBoxShadow === "none") {
// Apply styles if the box shadow is not applied or is set to "none"
glow.style.backgroundColor = "rgba(46,241,255,0.9)";
glow.style.webkitBoxShadow = "0px 0px 105px 45px rgba(46,241,255,0.9)";
glow.style.transition = "ease-in-out .5s";
} else {
glow.style.webkitBoxShadow = "none";
console.log("Stop");
}
console.log("clicked");
}
}
onglow()
function off(){
let glow = document.querySelector(".output");
if (glow) { // Check if the element exists
if (!glow.style.webkitBoxShadow === "" || glow.style.webkitBoxShadow === "none") {
// Apply styles if the box shadow is not applied or is set to "none"
glow.style.webkitBoxShadow = "none";
} else {
glow.style.webkitBoxShadow = "none";
}
console.log("clicked2");
}
}
off()