-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolors.js
More file actions
35 lines (32 loc) · 865 Bytes
/
colors.js
File metadata and controls
35 lines (32 loc) · 865 Bytes
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
var Body = {
bodycolor:function (color){
document.querySelector('body').style.color = color;
},
backcolor:function (color){
document.querySelector('body').style.backgroundColor = color;
}
}
var Links = {
linkcolor: function (color){
var alist = document.querySelectorAll('a');
var i = 0;
while(i < alist.length){
alist[i].style.color = color;
i = i+1;
}
}
}
function nightdayhandler(self){
var target = document.querySelector('body');
if(self.value === 'night') {
Body.backcolor('black');
Body.bodycolor('white');
self.value='day';
Links.linkcolor('powderblue');
} else {
Body.backcolor('white');
Body.bodycolor('black');
self.value='night';
Links.linkcolor('blue');
}
}