-
Notifications
You must be signed in to change notification settings - Fork 3
/
html-controller.js
114 lines (112 loc) · 3.81 KB
/
html-controller.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
function left(){
waiter = 'left';
}
function up(){
waiter = 'up';
}
function down(){
waiter = 'down';
}
function right(){
waiter = 'right';
}
function togglemusic(){
if (audioElement.paused){
audioElement.play();
let audiobtn = document.getElementById("audiobtn");
audiobtn.textContent = "Pause Music";
} else {
audioElement.pause();
let audiobtn = document.getElementById("audiobtn");
audiobtn.textContent = "Play Music";
}
}
function maketheme(id,clr){
let ab = document.getElementById(id);
ab.style.color = clr;
}
function clrbtn(id,clr){
let ab = document.getElementById(id);
ab.style.backgroundColor = clr;
ab.style.borderColor = clr;
}
function clrbtn1(id,clr){
let ab = document.getElementById(id);
ab.style.borderColor = clr;
}
function toggleautopilot(){
if (autopilot){
localStorage.setItem('autopilot',"false");
location.reload();
} else {
localStorage.setItem('autopilot',"true");
location.reload();
}
}
function toggletheme(){
if (theme == "black" || theme == "rgb(0,0,0)"){
(async () => {
let a = 0;
while (a <= 255){
document.body.style.backgroundColor = 'rgb('+a+','+a+','+a+')';
theme = 'rgb('+a+','+a+','+a+')';
let setclr = 'rgb('+(255-a)+','+(255-a)+','+(255-a)+')';
maketheme('score',setclr);
maketheme('best',setclr);
maketheme('time',setclr);
maketheme('display',setclr);
maketheme('ap notif',setclr);
maketheme('namedisplay',setclr);
maketheme('header',setclr);
maketheme('header1',setclr);
maketheme('header2',setclr);
maketheme('header3',setclr);
maketheme('gc',setclr);
maketheme('themedisp',setclr);
maketheme('settings',setclr);
clrbtn('playbtn1',theme);
clrbtn('playbtn2',setclr);
clrbtn('playbtn3',theme);
clrbtn('playbtn4',setclr);
clrbtn('playbtn5',setclr);
clrbtn('playbtn6',setclr);
a += 3;
await sleep(2);
}
})();
let aa = document.getElementById('themedisp');
aa.innerHTML = "Theme: Light"
} else {
(async () => {
let a = 255;
while (a >= 0){
document.body.style.backgroundColor = 'rgb('+a+','+a+','+a+')';
theme = 'rgb('+a+','+a+','+a+')';
let setclr = 'rgb('+(255-a)+','+(255-a)+','+(255-a)+')';
maketheme('score',setclr);
maketheme('best',setclr);
maketheme('time',setclr);
maketheme('display',setclr);
maketheme('ap notif',setclr);
maketheme('namedisplay',setclr);
maketheme('header',setclr);
maketheme('header1',setclr);
maketheme('header2',setclr);
maketheme('header3',setclr);
maketheme('gc',setclr);
maketheme('themedisp',setclr);
maketheme('settings',setclr);
clrbtn('playbtn1',theme);
clrbtn1('playbtn2',setclr);
clrbtn('playbtn3',theme);
clrbtn1('playbtn4',setclr);
clrbtn1('playbtn5',setclr);
clrbtn1('playbtn6',setclr);
a -= 3;
await sleep(2);
}
})();
let aa = document.getElementById('themedisp');
aa.innerHTML = "Theme: Dark"
}
}