Skip to content

Commit 4715bef

Browse files
Added Day 74
1 parent a8d46d3 commit 4715bef

File tree

2 files changed

+934
-0
lines changed

2 files changed

+934
-0
lines changed

public/74/index.html

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

0 commit comments

Comments
 (0)