-
Notifications
You must be signed in to change notification settings - Fork 0
/
colors.js
43 lines (42 loc) · 1.04 KB
/
colors.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
var Body = {
setColor: function (color) {
document.querySelector("body").style.color = color;
},
setBackgroundColor: function (color) {
document.querySelector("body").style.backgroundColor = color;
},
};
var Links = {
setColor: function (color) {
// var alist = document.querySelectorAll("a");
// var i = 0;
// while (i < alist.length) {
// alist[i].style.color = color;
// i++;
// }
$("a").css("color", color);
},
};
var Menu = {
setColor: function (color) {
$("#SelMenu").css("color", color);
},
};
function menuColor(color) {
$("#SelMenu").css("color", color);
}
function nightDayHandler(self) {
if (self.value === "night mode") {
Body.setBackgroundColor("black");
Body.setColor("white");
Links.setColor("yellow");
Menu.setColor("red");
self.value = "day mode";
} else {
Body.setBackgroundColor("white");
Body.setColor("black");
Links.setColor("black");
Menu.setColor("blue");
self.value = "night mode";
}
}