Skip to content

Commit 0f475a6

Browse files
committed
Added colons to the countdown
1 parent 3d171c0 commit 0f475a6

File tree

1 file changed

+31
-10
lines changed

1 file changed

+31
-10
lines changed

grad-countdown.html

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88
<title>Graduation Countdown</title>
99
<style>
10-
* {
10+
* {
1111
margin: 0;
1212
padding: 0;
1313
box-sizing: border-box;
@@ -23,7 +23,6 @@
2323
overflow: hidden;
2424
}
2525

26-
/* scales by width for consistent proportions */
2726
#countdown-container {
2827
position: relative;
2928
width: min(90vw, 700px);
@@ -44,15 +43,16 @@
4443
position: absolute;
4544
top: 37%;
4645
left: 50%;
47-
transform: translate(-50%, -50%);
48-
color: white;
49-
text-align: center;
46+
transform: translate(-50%, -60%);
5047
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;
5253
pointer-events: none;
5354
}
5455

55-
/* each column for day/hour/min */
5656
.time-group {
5757
display: flex;
5858
flex-direction: column;
@@ -62,13 +62,21 @@
6262
.time-value {
6363
font-size: clamp(1.4rem, 4vw, 3rem);
6464
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);
6573
}
6674

6775
.time-label {
6876
font-size: clamp(0.7rem, 1.2vw, 1.1rem);
6977
font-weight: 600;
70-
color: white;
7178
margin-top: 0.3em;
79+
line-height: 1;
7280
}
7381

7482
#label {
@@ -94,16 +102,28 @@
94102
</g>
95103
</svg>
96104

97-
<!-- centered timer columns -->
105+
<!-- timer -->
98106
<div id="timer">
99107
<div class="time-group">
100108
<div class="time-value" id="days">--</div>
101109
<div class="time-label">DAYS</div>
102110
</div>
111+
112+
<div class="time-group">
113+
<div class="time-colon">:</div>
114+
<div class="time-label">&nbsp;</div>
115+
</div>
116+
103117
<div class="time-group">
104118
<div class="time-value" id="hours">--</div>
105119
<div class="time-label">HOURS</div>
106120
</div>
121+
122+
<div class="time-group">
123+
<div class="time-colon">:</div>
124+
<div class="time-label">&nbsp;</div>
125+
</div>
126+
107127
<div class="time-group">
108128
<div class="time-value" id="minutes">--</div>
109129
<div class="time-label">MIN</div>
@@ -114,7 +134,7 @@
114134
</div>
115135

116136
<script>
117-
function updateCountdown() {
137+
function updateCountdown() {
118138
const target = new Date("Jun 11, 2026 15:00:00 GMT").getTime();
119139
const now = new Date().getTime();
120140
const diff = target - now;
@@ -124,6 +144,7 @@
124144
document.getElementById("hours").textContent = "";
125145
document.getElementById("minutes").textContent = "";
126146
document.getElementById("label").textContent = "It's Graduation Day!";
147+
document.querySelectorAll(".time-colon").forEach(c => c.style.display = "none");
127148
return;
128149
}
129150

0 commit comments

Comments
 (0)