-
Notifications
You must be signed in to change notification settings - Fork 5
/
clock.html
115 lines (99 loc) · 2.34 KB
/
clock.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html>
<style>
body,
html {
height: 100%;
margin: 0;
}
.bgimg {
background-image: url(lo.jpeg);
height: 100%;
background-position: center;
background-size: cover;
position: relative;
color: white;
font-family: "Courier New", Courier, monospace;
font-size: 25px;
}
.topleft {
position: absolute;
top: 0;
left: 16px;
}
.bottomleft {
position: absolute;
bottom: 0;
left: 16px;
}
.middle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
hr {
margin: auto;
width: 40%;
}
#date {
font-size: 40px;
color: black;
}
#p,
#a {
border: 2px solid black;
font-size: 30px;
width: 80px;
color: black;
background: white;
}
#v {
border: 2px solid black;
font-size: 30px;
width: 100px;
color: #FF1493;
background: white;
text-size-adjust: 60px;
}
.da {
display: inline-flex;
}
</style>
<body onload="startTime()">
<div class="bgimg">
<div class="middle">
<h1>Todays Time</h1>
<hr>
<p id="date"></p>
<div class="da">
<p id="p" style=""></p>
<p hidden>asdf</p>
<p id="a"></p>
<p id="v"></p>
</div>
</div>
</div>
<script>
function startTime() {
var today = new Date();
var h = today.getHours();
var m = today.getMinutes();
var s = today.getSeconds();
m = checkTime(m);
s = checkTime(s);
document.getElementById('p').innerHTML = h;
document.getElementById('a').innerHTML = m;
document.getElementById('v').innerHTML = s;
var t = setTimeout(startTime, 500);
}
function checkTime(i) {
if (i < 10) {
i = "0" + i
};
return i;
}
</script>
</body>
</html>