-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
51 lines (49 loc) · 1.82 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="description" content="Just a clock.">
<title>Clocky</title>
<link rel="stylesheet" href="style.css">
<link rel="icon" type="image/x-icon" href="resources/logo.ico"/>
<meta property="og:title" content="Clocky">
<meta property="og:image" content="https://clock-y.web.app/resources/short.png">
<meta property="og:description" content="Just a clock.">
<meta property="og:url" content="https://clock-y.web.app/">
</head>
<body>
<header>
<p class="header"><a href="Settings/index.html" class=link rel="noreferrer">Settings</a> - <a href="Stopwatch/index.html" rel="noreferrer">Stopwatch</a></p>
</header>
<main>
<div class="clock">
<div class="hour">
<div class="hr" id="hr"></div>
</div>
<div class="min">
<div class="mn" id="mn"></div>
</div>
<div class="sec">
<div class="sc" id="sc"></div>
</div>
</div>
</main>
<script type="text/javascript">
const deg = 6;
const hr = document.querySelector('#hr');
const mn = document.querySelector('#mn');
const sc = document.querySelector('#sc');
setInterval(() => {
let day = new Date();
let hh = day.getHours() * 30;
let mm = day.getMinutes() * deg;
let ss = day.getSeconds() * deg;
hr.style.transform = `rotateZ(${(hh)+(mm/12)}deg)`;
mn.style.transform = `rotateZ(${mm}deg)`;
sc.style.transform = `rotateZ(${ss}deg)`;
})
</script>
<p class="info">(The time corresponds to the time on your terminal, depending on your terminal the time can be changed.)</p>
</body>
</html>