-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsrcipt.js
54 lines (43 loc) · 1.3 KB
/
srcipt.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
var state = false;
function toggle() {
var body = document.getElementById('body');
var clock = document.getElementById('clock');
var mode = document.getElementById('bt');
var center = document.getElementById('center');
var second = document.getElementById('second');
if(state) {
body.style.background="#c1c1c4";
clock.className="clock1";
mode.innerText="Dark mode";
mode.style.background="#111";
mode.style.color="#eee";
center.style.background="#363436";
second.style.background="#1f221e";
state = false;
}
else{
body.style.background="#1c1f1c";
clock.className="clock2";
mode.innerText="Light mode";
mode.style.background="#eee";
mode.style.color="#111";
center.style.background="#cbc";
second.style.background="#e2e1f6";
state = true;
}
}
setInterval(function()
{
var hour = document.getElementById('hour');
var minute = document.getElementById('minute');
d = new Date();
htime=d.getHours();
mtime=d.getMinutes();
stime=d.getSeconds();
hrotation = 30*htime + mtime/2;
mrotation = 6*mtime;
srotation = 6*stime;
hour.style.transform = "rotate("+hrotation+"deg)";
minute.style.transform = "rotate("+mrotation+"deg)";
second.style.transform = "rotate("+srotation+"deg)";
},1000);