refactor: hide countdown after deadline
This commit is contained in:
parent
279d824772
commit
21be5e9622
@ -94,14 +94,17 @@
|
||||
|
||||
<div style="margin:50px 0;"></div>
|
||||
|
||||
<div id="usa-countdown" class="container">
|
||||
<div class="row">
|
||||
<div class="col-3 usa-countdown-element" id="usa-countdown-days">00</div>
|
||||
<div class="col-3 usa-countdown-element" id="usa-countdown-hours">00</div>
|
||||
<div class="col-3 usa-countdown-element" id="usa-countdown-minutes">00</div>
|
||||
<div class="col-3 usa-countdown-element" id="usa-countdown-seconds">00</div>
|
||||
@if (DateTimeOffset.UtcNow < new DateTime(2024, 03, 08))
|
||||
{
|
||||
<div id="usa-countdown" class="container">
|
||||
<div class="row">
|
||||
<div class="col-3 usa-countdown-element" id="usa-countdown-days">00</div>
|
||||
<div class="col-3 usa-countdown-element" id="usa-countdown-hours">00</div>
|
||||
<div class="col-3 usa-countdown-element" id="usa-countdown-minutes">00</div>
|
||||
<div class="col-3 usa-countdown-element" id="usa-countdown-seconds">00</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div style="margin:50px 0;"></div>
|
||||
|
||||
|
@ -99,7 +99,9 @@ declare const Prism: any;
|
||||
UI.updateUI();
|
||||
|
||||
const usaCountdown = document.getElementById("usa-countdown");
|
||||
usaCountdown.addEventListener("click", () => window.location.href = "/blog/2024/02/19/the-american");
|
||||
UI.updateUsaCountdown(usaCountdown);
|
||||
setInterval(() => UI.updateUsaCountdown(usaCountdown), 1000);
|
||||
if (usaCountdown) {
|
||||
usaCountdown.addEventListener("click", () => window.location.href = "/blog/2024/02/19/the-american");
|
||||
UI.updateUsaCountdown(usaCountdown);
|
||||
setInterval(() => UI.updateUsaCountdown(usaCountdown), 1000);
|
||||
}
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user