2
2
import Button from " ../components/Button.astro" ;
3
3
---
4
4
5
- <!-- Show this one on Day 2 of launch week -->
6
- <!-- <section class="banner week">
5
+ <!-- Show this one on Day 2 of launch week --><!-- <section class="banner week">
7
6
<h3><img src="/img/react-gg-logo-sticker.svg" width="358" height="86" alt="react.gg" /> Launch Week Sale</h3>
8
7
<div class="countdown">
9
8
<div class="number day">
@@ -37,28 +36,36 @@ import Button from "../components/Button.astro";
37
36
<ol class="footnotes">
38
37
<li>Literally the cheapest this course will ever be</li>
39
38
</ol>
40
- </section> -->
41
- <!-- Show this one on Day 1 of launch week -->
39
+ </section> --><!-- Show this one on Day 1 of launch week -->
42
40
<section class =" banner day-one" >
43
- <h3 ><img src =" /img/react-gg-logo-sticker.svg" width =" 358" height =" 86" alt =" react.gg" /> Launch Day Sale</h3 >
41
+ <h3 >
42
+ <img
43
+ src =" /img/react-gg-logo-sticker.svg"
44
+ width =" 358"
45
+ height =" 86"
46
+ alt =" react.gg"
47
+ /> Launch Day Sale
48
+ </h3 >
44
49
<div class =" countdown" >
50
+ <div class =" number day" >
51
+ <span id =" days" class =" time" >--</span >
52
+ <span id =" days-label" class =" unit" >day(s)</span >
53
+ </div >
45
54
<div class =" number hour" >
46
- <span id =" hours" class =" time" >22 </span >
47
- <span class =" unit" >hours </span >
55
+ <span id =" hours" class =" time" >-- </span >
56
+ <span id = " hours-label " class =" unit" >hour(s) </span >
48
57
</div >
49
58
<div class =" number minute" >
50
- <span id =" minutes" class =" time" >47 </span >
51
- <span class =" unit" >minutes </span >
59
+ <span id =" minutes" class =" time" >-- </span >
60
+ <span id = " minutes-label " class =" unit" >minute(s) </span >
52
61
</div >
53
62
<div class =" number second" >
54
- <span id =" seconds" class =" time" >12 </span >
55
- <span class =" unit" >seconds </span >
63
+ <span id =" seconds" class =" time" >-- </span >
64
+ <span id = " seconds-label " class =" unit" >second(s) </span >
56
65
</div >
57
66
</div >
58
67
<p >
59
- Get up to <strong >25% off</strong ><sup >1</sup > the react.gg course, plus a <strong
60
- >FREE</strong
61
- > ui.dev t-shirt<sup >2,3,4</sup > if you buy before this giant clock goes to zero.
68
+ Get up to <strong >25% off</strong > the react.gg course, plus a <strong >FREE</strong > ui.dev t-shirt if you buy before this giant clock goes to zero.
62
69
</p >
63
70
<Button
64
71
type =" link"
@@ -67,12 +74,12 @@ import Button from "../components/Button.astro";
67
74
size =" large"
68
75
text =" Get the course + t-shirt now"
69
76
/>
70
- <ol class =" footnotes" >
77
+ <!-- < ol class="footnotes">
71
78
<li>Literally the cheapest this course will ever be</li>
72
79
<li>Our shirts are very soft</li>
73
80
<li>We’ll probably send you stickers too</li>
74
81
<li>We might lose money on this but wdgaf</li>
75
- </ol >
82
+ </ol> -->
76
83
</section >
77
84
78
85
<style >
@@ -92,7 +99,7 @@ import Button from "../components/Button.astro";
92
99
display: flex;
93
100
justify-content: center;
94
101
align-items: center;
95
- gap: .5rem;
102
+ gap: 0 .5rem;
96
103
background-color: var(--brand-pink);
97
104
border: var(--border-dark);
98
105
border-radius: 0.3rem;
@@ -219,7 +226,7 @@ import Button from "../components/Button.astro";
219
226
const { days, hours, minutes, seconds, hasExpired } = timeUntilTargetPST(
220
227
2023,
221
228
9,
222
- 12
229
+ 7
223
230
);
224
231
225
232
if (hasExpired) {
@@ -233,19 +240,14 @@ import Button from "../components/Button.astro";
233
240
}
234
241
235
242
// Uncomment when we move to the other banner
236
- // document.getElementById("days").textContent = String(days).padStart(2, "0");
237
- document.getElementById("hours").textContent = String(hours).padStart(
238
- 2,
239
- "0"
240
- );
241
- document.getElementById("minutes").textContent = String(minutes).padStart(
242
- 2,
243
- "0"
244
- );
245
- document.getElementById("seconds").textContent = String(seconds).padStart(
246
- 2,
247
- "0"
248
- );
243
+ document.getElementById("days").textContent = days.value;
244
+ document.getElementById("days-label").textContent = days.label;
245
+ document.getElementById("hours").textContent = hours.value;
246
+ document.getElementById("hours-label").textContent = hours.label;
247
+ document.getElementById("minutes").textContent = minutes.value;
248
+ document.getElementById("minutes-label").textContent = minutes.label;
249
+ document.getElementById("seconds").textContent = seconds.value;
250
+ document.getElementById("seconds-label").textContent = seconds.label;
249
251
}
250
252
251
253
function showCountDown() {
@@ -294,10 +296,22 @@ import Button from "../components/Button.astro";
294
296
const seconds = delta % 60;
295
297
296
298
return {
297
- days: String(days).padStart(2, "0"),
298
- hours: String(hours).padStart(2, "0"),
299
- minutes: String(minutes).padStart(2, "0"),
300
- seconds: String(seconds).padStart(2, "0"),
299
+ days: {
300
+ value: String(days).padStart(2, "0"),
301
+ label: days === 1 ? "day" : "days",
302
+ },
303
+ hours: {
304
+ value: String(hours).padStart(2, "0"),
305
+ label: hours === 1 ? "hour" : "hours",
306
+ },
307
+ minutes: {
308
+ value: String(minutes).padStart(2, "0"),
309
+ label: minutes === 1 ? "minute" : "minutes",
310
+ },
311
+ seconds: {
312
+ value: String(seconds).padStart(2, "0"),
313
+ label: seconds === 1 ? "second" : "seconds",
314
+ },
301
315
hasExpired: targetUTC < currentUTC,
302
316
};
303
317
}
0 commit comments