-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
51 lines (42 loc) · 1.59 KB
/
script.js
File metadata and controls
51 lines (42 loc) · 1.59 KB
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
var s = skrollr.init([
smoothScrolling=true
]
);
function currentTime(){
let date = new Date();
let hh = date.getHours();
let mm = date.getMinutes();
let wd = date.getDay();
const weekday = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
hh = (hh<10) ? "0"+hh : hh;
mm = (mm<10) ? "0"+mm : mm;
document.getElementById("hour").innerText = hh;
document.getElementById("min").innerText = mm;
document.getElementById("weekday").innerText = weekday[wd];
let t = setTimeout(function(){currentTime()}, 1000);
}
function windowColor(){
let date = new Date();
let hh = date.getHours();
if (hh > 6 && hh < 18){
if (document.getElementById("window").style.backgroundColor != "#91CEFF"){
document.getElementById("window").style.transition = "background-color 3s linear";
document.getElementById("window").style.backgroundColor = "#91CEFF";
}
}
else if (hh > 18 && hh < 19){
if (document.getElementById("window").style.backgroundColor != "#FEC051"){
document.getElementById("window").style.transition = "background-color 3s linear";
document.getElementById("window").style.backgroundColor = "#FEC051";
}
}
else{
if (document.getElementById("window").style.backgroundColor != "#090254"){
document.getElementById("window").style.transition = "background-color 3s linear";
document.getElementById("window").style.backgroundColor = "#090254";
}
}
let t = setTimeout(function(){windowColor()} , 1000);
}
currentTime();
windowColor();