Skip to content

Commit a8d46d3

Browse files
Added Day 73
1 parent e014455 commit a8d46d3

File tree

2 files changed

+1255
-0
lines changed

2 files changed

+1255
-0
lines changed

public/73/index.html

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link rel="icon" href="/assets/icon.png" />
7+
<script src="/lib/figlet.js"></script>
8+
<title>Day 73/100</title>
9+
</head>
10+
<body>
11+
<main>
12+
<div id="ascii-art">
13+
<div class="ascii-line" id="ascii-line-1"></div>
14+
<div class="ascii-line" id="ascii-line-2"></div>
15+
<div class="ascii-line" id="ascii-line-3"></div>
16+
<div class="ascii-line" id="ascii-line-4"></div>
17+
<div class="ascii-line" id="ascii-line-5"></div>
18+
<div class="ascii-line" id="ascii-line-6"></div>
19+
<div class="ascii-line" id="ascii-line-7"></div>
20+
<div class="ascii-line" id="ascii-line-8"></div>
21+
</div>
22+
</main>
23+
24+
<style>
25+
@font-face {
26+
font-family: "SFMono";
27+
src: url("/assets/SFMono-Bold.woff2") format("woff2");
28+
font-weight: 700;
29+
}
30+
31+
@font-face {
32+
font-family: "SFMono";
33+
src: url("/assets/SFMono-Medium.woff2") format("woff2");
34+
font-weight: 500;
35+
}
36+
37+
@font-face {
38+
font-family: "SFMono";
39+
src: url("/assets/SFMono-Regular.woff2") format("woff2");
40+
font-weight: 400;
41+
}
42+
43+
body {
44+
background-color: #fff;
45+
overflow: hidden;
46+
display: flex;
47+
justify-content: center;
48+
align-items: center;
49+
min-height: 100vh;
50+
margin: 0;
51+
}
52+
53+
#ascii-art {
54+
text-align: center;
55+
}
56+
57+
.ascii-line {
58+
font-size: min(1.2vw, 16px);
59+
line-height: 1.2;
60+
font-family: "SFMono", monospace;
61+
font-weight: 700;
62+
white-space: pre;
63+
margin: 0;
64+
padding: 0;
65+
color: #000;
66+
}
67+
</style>
68+
69+
<script>
70+
figlet.defaults({ fontPath: "/assets/" });
71+
72+
function updateASCIITime(time) {
73+
figlet.text(
74+
time,
75+
{
76+
font: "colossal",
77+
},
78+
function (err, data) {
79+
if (err) {
80+
console.error(err);
81+
} else {
82+
const lines = data.split("\n");
83+
document.getElementById("ascii-line-1").textContent = lines[0];
84+
document.getElementById("ascii-line-2").textContent = lines[1];
85+
document.getElementById("ascii-line-3").textContent = lines[2];
86+
document.getElementById("ascii-line-4").textContent = lines[3];
87+
document.getElementById("ascii-line-5").textContent = lines[4];
88+
document.getElementById("ascii-line-6").textContent = lines[5];
89+
document.getElementById("ascii-line-7").textContent = lines[6];
90+
document.getElementById("ascii-line-8").textContent = lines[7];
91+
}
92+
}
93+
);
94+
}
95+
96+
function updateClock() {
97+
const now = new Date();
98+
let milliseconds = now.getMilliseconds();
99+
let seconds = now.getSeconds();
100+
let minutes = now.getMinutes();
101+
let hours = now.getHours();
102+
103+
if (hours > 12) {
104+
hours -= 12;
105+
}
106+
107+
const time = `${hours.toString().padStart(2, "0")}:${minutes
108+
.toString()
109+
.padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
110+
updateASCIITime(time);
111+
112+
const millisecondsToNextSecond = 1000 - now.getMilliseconds();
113+
setTimeout(updateClock, millisecondsToNextSecond);
114+
}
115+
116+
updateClock();
117+
</script>
118+
</body>
119+
</html>

0 commit comments

Comments
 (0)