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