-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclock.html
More file actions
68 lines (65 loc) · 1.91 KB
/
clock.html
File metadata and controls
68 lines (65 loc) · 1.91 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>DCUMPS Broadcast Clock</title>
<style>
@font-face {
font-family: "MPSFont";
/* src: url('./GaretHeavy.ttf') format('truetype'); */
src: url("https://raw.githubusercontent.com/DCUMPS/clock/main/GaretHeavy.ttf")
format("truetype");
/* src: url('./IntroRust-Base.ttf') format('opentype'); */
}
#output {
display: flex;
justify-content: center;
align-items: center;
font-family: "MPSFont", monospace;
font-size: 120px;
text-align: right;
color: white;
width: 750px;
height: 160px;
border-radius: 30px;
padding: 10px;
/* background-color: rgba(151, 145, 255, 1); */
box-sizing: border-box;
text-align: center;
}
</style>
</head>
<body translate="no">
<div id="output"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
<script>
var urlParams;
(function () {
var match,
pl = /\+/g,
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) {
return decodeURIComponent(s.replace(pl, " "));
},
query = window.location.search.substring(1);
urlParams = {};
while ((match = search.exec(query)))
urlParams[decode(match[1])] = decode(match[2]);
})();
var output = document.getElementById("output");
if (urlParams["style"]) output.setAttribute("style", urlParams["style"]);
if (urlParams["bodyStyle"])
document.body.setAttribute("style", urlParams["bodyStyle"]);
var c;
setInterval(
(c = function () {
output.innerText = moment().format(
urlParams["format"] || "hh:mm:ssA",
);
}),
1000,
);
c();
</script>
</body>
</html>