|
7 | 7 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
8 | 8 | <title>Graduation Countdown</title> |
9 | 9 | <style> |
10 | | - * { |
| 10 | +* { |
11 | 11 | margin: 0; |
12 | 12 | padding: 0; |
13 | 13 | box-sizing: border-box; |
|
23 | 23 | overflow: hidden; |
24 | 24 | } |
25 | 25 |
|
26 | | - /* scales by width for consistent proportions */ |
27 | 26 | #countdown-container { |
28 | 27 | position: relative; |
29 | 28 | width: min(90vw, 700px); |
|
44 | 43 | position: absolute; |
45 | 44 | top: 37%; |
46 | 45 | left: 50%; |
47 | | - transform: translate(-50%, -50%); |
48 | | - color: white; |
49 | | - text-align: center; |
| 46 | + transform: translate(-50%, -60%); |
50 | 47 | display: flex; |
51 | | - gap: clamp(1rem, 4vw, 4rem); |
| 48 | + align-items: flex-start; |
| 49 | + justify-content: center; |
| 50 | + gap: clamp(0.5rem, 1.8vw, 1.8rem); |
| 51 | + text-align: center; |
| 52 | + color: white; |
52 | 53 | pointer-events: none; |
53 | 54 | } |
54 | 55 |
|
55 | | - /* each column for day/hour/min */ |
56 | 56 | .time-group { |
57 | 57 | display: flex; |
58 | 58 | flex-direction: column; |
|
62 | 62 | .time-value { |
63 | 63 | font-size: clamp(1.4rem, 4vw, 3rem); |
64 | 64 | font-weight: 700; |
| 65 | + line-height: 1.1; |
| 66 | + } |
| 67 | + |
| 68 | + .time-colon { |
| 69 | + font-size: clamp(1.4rem, 4vw, 3rem); |
| 70 | + font-weight: 700; |
| 71 | + line-height: 1.1; |
| 72 | + transform: translateY(-0.07em); |
65 | 73 | } |
66 | 74 |
|
67 | 75 | .time-label { |
68 | 76 | font-size: clamp(0.7rem, 1.2vw, 1.1rem); |
69 | 77 | font-weight: 600; |
70 | | - color: white; |
71 | 78 | margin-top: 0.3em; |
| 79 | + line-height: 1; |
72 | 80 | } |
73 | 81 |
|
74 | 82 | #label { |
|
94 | 102 | </g> |
95 | 103 | </svg> |
96 | 104 |
|
97 | | - <!-- centered timer columns --> |
| 105 | + <!-- timer --> |
98 | 106 | <div id="timer"> |
99 | 107 | <div class="time-group"> |
100 | 108 | <div class="time-value" id="days">--</div> |
101 | 109 | <div class="time-label">DAYS</div> |
102 | 110 | </div> |
| 111 | + |
| 112 | + <div class="time-group"> |
| 113 | + <div class="time-colon">:</div> |
| 114 | + <div class="time-label"> </div> |
| 115 | + </div> |
| 116 | + |
103 | 117 | <div class="time-group"> |
104 | 118 | <div class="time-value" id="hours">--</div> |
105 | 119 | <div class="time-label">HOURS</div> |
106 | 120 | </div> |
| 121 | + |
| 122 | + <div class="time-group"> |
| 123 | + <div class="time-colon">:</div> |
| 124 | + <div class="time-label"> </div> |
| 125 | + </div> |
| 126 | + |
107 | 127 | <div class="time-group"> |
108 | 128 | <div class="time-value" id="minutes">--</div> |
109 | 129 | <div class="time-label">MIN</div> |
|
114 | 134 | </div> |
115 | 135 |
|
116 | 136 | <script> |
117 | | - function updateCountdown() { |
| 137 | + function updateCountdown() { |
118 | 138 | const target = new Date("Jun 11, 2026 15:00:00 GMT").getTime(); |
119 | 139 | const now = new Date().getTime(); |
120 | 140 | const diff = target - now; |
|
124 | 144 | document.getElementById("hours").textContent = ""; |
125 | 145 | document.getElementById("minutes").textContent = ""; |
126 | 146 | document.getElementById("label").textContent = "It's Graduation Day!"; |
| 147 | + document.querySelectorAll(".time-colon").forEach(c => c.style.display = "none"); |
127 | 148 | return; |
128 | 149 | } |
129 | 150 |
|
|
0 commit comments