Removing RSVP possibility and changing text on main page
This commit is contained in:
parent
8a2e2b4ca8
commit
30a7c537a6
2 changed files with 2 additions and 44 deletions
|
|
@ -8,20 +8,10 @@
|
||||||
<body>
|
<body>
|
||||||
<h1 class="title fontXL textCenter backgroundLightGreen colorWhite">Collin and Lucy's Wedding</h1>
|
<h1 class="title fontXL textCenter backgroundLightGreen colorWhite">Collin and Lucy's Wedding</h1>
|
||||||
<div class="contents fontM">
|
<div class="contents fontM">
|
||||||
<a class="rsvpButton backgroundLightGreen hidden" href="/rsvp">
|
|
||||||
<div class="textCenter">
|
|
||||||
<p class="colorWhite">
|
|
||||||
RSVP
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
<div>
|
<div>
|
||||||
<h2 class="textLeft fontL colorLightGreen">When?</h2>
|
<h2 class="textLeft fontL colorLightGreen">When?</h2>
|
||||||
<p>Saturday 16th of May 2026</p>
|
<p>Saturday 16th of May 2026</p>
|
||||||
<b>
|
<p>Thanks for coming! Photos coming soon</p>
|
||||||
<p id="countdown"></p>
|
|
||||||
</b>
|
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<h3 class="colorLightGreen fontM">Agenda</h3>
|
<h3 class="colorLightGreen fontM">Agenda</h3>
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,2 @@
|
||||||
const COOKIE_NAME = "hasRsvped";
|
|
||||||
|
|
||||||
function hasRsvped() {
|
|
||||||
const cookies = Object.fromEntries(
|
|
||||||
document.cookie.split(";").map((x) => x.trim().split("="))
|
|
||||||
);
|
|
||||||
|
|
||||||
return cookies[COOKIE_NAME] === "true";
|
|
||||||
}
|
|
||||||
|
|
||||||
function padTime(t) {
|
|
||||||
return `${t}`.padStart(2, '0');
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateCountdown() {
|
|
||||||
const countdownDate = new Date("2026-05-16T14:30:00.000+02:00");
|
|
||||||
const now = new Date();
|
|
||||||
const msRemaining = countdownDate.getTime() - now.getTime();
|
|
||||||
const daysRemaining = Math.floor(msRemaining / (1000 * 60 * 60 * 24));
|
|
||||||
const hoursRemaining = Math.floor(msRemaining / (1000 * 60 * 60)) % 24;
|
|
||||||
const minutesRemaining = Math.floor(msRemaining / (1000 * 60)) % 60;
|
|
||||||
const secondsRemaining = Math.floor(msRemaining / 1000) % 60;
|
|
||||||
const countdownNode = document.getElementById("countdown");
|
|
||||||
countdownNode.innerText = `${daysRemaining} days ${padTime(hoursRemaining)}:${padTime(minutesRemaining)}:${padTime(secondsRemaining)}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
if (!hasRsvped()) {
|
|
||||||
const rsvpButton = document.querySelector(".rsvpButton");
|
|
||||||
rsvpButton.classList.remove("hidden");
|
|
||||||
}
|
|
||||||
updateCountdown();
|
|
||||||
window.setInterval(updateCountdown, 500);
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue