-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
38 lines (30 loc) · 946 Bytes
/
script.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
let hr = document.getElementById('hour');
let min = document.getElementById('min');
let sec = document.getElementById('sec');
function time()
{
let date = new Date();
let hh = date.getHours();
let mm = date.getMinutes();
let ss = date.getSeconds();
let hRotation = 30*hh + mm/2;
let mRotation = 6*mm;
let sRotation = 6*ss;
hr.style.transform = `rotate(${hRotation}deg)`;
min.style.transform = `rotate(${mRotation}deg)`;
sec.style.transform = `rotate(${sRotation}deg)`;
}
setInterval(time, 1);
let arrow_l = document.getElementById('arrow_l')
let arrow_r = document.getElementById('arrow_r')
let text = document.getElementById('text')
arrow_l.addEventListener('click',function()
{
document.body.style.background = '#171717';
text.style.color = '#F2F2F2';
});
arrow_r.addEventListener('click',function()
{
document.body.style.background = '#F2F2F2';
text.style.color = '#171717';
});