-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
72 lines (58 loc) · 2.24 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
var timesClicked = 0;
function turnOff() {
timesClicked++;
if (timesClicked % 2 == 1) {
document.getElementById("inner").style.opacity = "0";
document.getElementById("iphone").style.backgroundImage = "none";
document.getElementById("iphone").style.backgroundColor = "#000";
document.getElementById("inner").style.cursor = "pointer";
} else {
document.getElementById("inner").style.opacity = "1";
document.getElementById("iphone").style.backgroundColor = "transparent";
document.getElementById("iphone").style.backgroundImage = "url('Images/Backgrounds/lockscreen.jpeg')";
document.getElementById("inner").style.cursor = "auto";
}
document.getElementById("iphone").addEventListener("click", () => {
document.getElementById("inner").style.opacity = "1";
document.getElementById("iphone").style.backgroundColor = "transparent";
document.getElementById("iphone").style.backgroundImage = "url('Images/Backgrounds/lockscreen.jpeg')";
});
}
function turnOffLock() {
timesClicked++;
if (timesClicked % 2 == 1) {
document.getElementById("inner").style.opacity = "0";
document.getElementById("iphone").style.backgroundImage = "none";
document.getElementById("iphone").style.backgroundColor = "#000";
document.getElementById("inner").style.cursor = "pointer";
} else {
window.location.href = "/index.html";
}
document.getElementById("iphone").addEventListener("click", () => {
window.location.href = "/index.html";
});
}
function changeColorTorch() {
timesClicked++;
if (timesClicked % 2 == 1) {
document.getElementById("torchBtn").style.backgroundColor = "#ffffff";
document.getElementById("torchImg").src = "Images/Icons/torchDark.png";
} else {
document.getElementById("torchBtn").style.backgroundColor = "#1d2145";
document.getElementById("torchImg").src = "Images/Icons/torch.png";
}
}
var passcodeCount = 0;
function addFilledDot() {
passcodeCount++;
document.getElementById("dot" + passcodeCount).style.backgroundColor = "#fff";
if (passcodeCount == 6) {
setTimeout(function(){
window.location.href = "/home.html";
var all = document.getElementsByClassName("dot");
for (var i = 0; i < all.length; i++) {
all[i].style.backgroundColor = "transparent";
}
}, 500);
}
}