diff --git a/apps/web/package.json b/apps/web/package.json index b57df46..599def1 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -30,6 +30,7 @@ "@tanstack/react-start": "^1.141.1", "@tanstack/router-plugin": "^1.141.1", "better-auth": "catalog:", + "canvas-confetti": "^1.9.4", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "dotenv": "catalog:", @@ -56,6 +57,7 @@ "@tanstack/react-router-devtools": "^1.141.1", "@testing-library/dom": "^10.4.0", "@testing-library/react": "^16.2.0", + "@types/canvas-confetti": "^1.9.0", "@types/qrcode": "^1.5.6", "@types/react": "19.2.7", "@types/react-dom": "19.2.3", diff --git a/apps/web/src/components/homepage/CountdownBanner.tsx b/apps/web/src/components/homepage/CountdownBanner.tsx new file mode 100644 index 0000000..2152399 --- /dev/null +++ b/apps/web/src/components/homepage/CountdownBanner.tsx @@ -0,0 +1,119 @@ +import confetti from "canvas-confetti"; +import { useEffect, useRef } from "react"; +import { REGISTRATION_OPENS_AT } from "@/lib/opening"; +import { useRegistrationOpen } from "@/lib/useRegistrationOpen"; + +function pad(n: number): string { + return String(n).padStart(2, "0"); +} + +interface UnitBoxProps { + value: string; + label: string; +} + +function UnitBox({ value, label }: UnitBoxProps) { + return ( +
+ Inschrijvingen openen op +
++ {openDate} om {openTime} +
++ Kom snel terug! Zodra de inschrijvingen openen kun je je hier + registreren als toeschouwer of als artiest. +
+Doe je mee of kom je kijken? Kies je rol en vul het formulier in.
- {/* Login nudge — shown only to guests */} - {!isLoggedIn && ( -- - Al een account? - - Log in om je gegevens automatisch in te vullen en je Drinkkaart - direct te activeren na registratie. -
-+ + Al een account? + + Log in om je gegevens automatisch in te vullen en je + Drinkkaart direct te activeren na registratie. +
++ Registratie nog niet open +
++ Accounts aanmaken kan vanaf{" "} + + {REGISTRATION_OPENS_AT.toLocaleDateString("nl-BE", { + weekday: "long", + day: "numeric", + month: "long", + })}{" "} + om{" "} + {REGISTRATION_OPENS_AT.toLocaleTimeString("nl-BE", { + hour: "2-digit", + minute: "2-digit", + })} + + . +
+