|
| 1 | +"use client"; |
| 2 | +import { useContext, useEffect } from "react"; |
| 3 | +import { LanguageContext } from "contexts/con/LanguageContext"; |
| 4 | +import SectionTitle from "components/con/common/typography/SectionTitle"; |
| 5 | +import SectionSubTitle from "components/con/common/typography/SectionSubtitle"; |
| 6 | +import Script from "next/script"; |
| 7 | +import prices from "data/con/2026/prices"; |
| 8 | +import { Offer } from "types/con"; |
| 9 | +import dayjs from "dayjs"; |
| 10 | +import classNames from "classnames"; |
| 11 | +import { toLocaleDate } from "utils/con"; |
| 12 | + |
| 13 | +export default function RegisterPage() { |
| 14 | + const { t, Translate, getLocaleDictionary } = useContext(LanguageContext); |
| 15 | + const timelinePrices = prices |
| 16 | + .find((p) => p.id === 1) |
| 17 | + ?.offers.filter((o) => o.type); |
| 18 | + |
| 19 | + const isActiveOffer = (offer: Offer) => { |
| 20 | + if (offer.limitDate && dayjs(offer.limitDate).isBefore(dayjs(), "day")) |
| 21 | + return false; |
| 22 | + if (offer.startDate && dayjs(offer.startDate).isAfter(dayjs(), "day")) |
| 23 | + return false; |
| 24 | + return true; |
| 25 | + }; |
| 26 | + |
| 27 | + const isPastOffer = (offer: Offer) => { |
| 28 | + if (isActiveOffer(offer)) return false; |
| 29 | + if (offer.startDate && dayjs(offer.startDate).isBefore(dayjs(), "day")) |
| 30 | + return true; |
| 31 | + if (!offer.startDate) return true; |
| 32 | + return false; |
| 33 | + }; |
| 34 | + |
| 35 | + const expectations = |
| 36 | + getLocaleDictionary?.()[2026].tickets.expect.points || []; |
| 37 | + |
| 38 | + useEffect(() => { |
| 39 | + const iframe = document.getElementById( |
| 40 | + "yurplan-widget-141690" |
| 41 | + ) as HTMLIFrameElement | null; |
| 42 | + if (!iframe) return; |
| 43 | + const handleLoad = () => { |
| 44 | + const loader = document.getElementById("loader"); |
| 45 | + loader?.classList.add("hidden"); |
| 46 | + }; |
| 47 | + iframe.addEventListener("load", handleLoad, true); |
| 48 | + }, []); |
| 49 | + |
| 50 | + return ( |
| 51 | + <> |
| 52 | + <div className="container max-w-5xl flex flex-col items-center py-12 relative z-10"> |
| 53 | + <SectionTitle small h1 dark lined> |
| 54 | + <Translate translationKey="2026.tickets.title" /> |
| 55 | + </SectionTitle> |
| 56 | + <SectionSubTitle dark>{t("2026.tickets.subtitle")}</SectionSubTitle> |
| 57 | + </div> |
| 58 | + <div className=""> |
| 59 | + <div className="container max-w-6xl relative z-10"> |
| 60 | + <div className="flex flex-col lg:flex-row w-full max-w-6xl items-center lg:items-start"> |
| 61 | + <div className="translate-y-12 relative z-10 w-4/5 lg:w-2/5 max-w-md before:absolute before:w-full before:h-full before:bg-blue before:-translate-x-3 before:-translate-y-3 before:left-0 before:top-0"> |
| 62 | + <img |
| 63 | + className="relative" |
| 64 | + src="/images/con/2025/review/pic-01.jpg" |
| 65 | + alt="" |
| 66 | + /> |
| 67 | + </div> |
| 68 | + <div className="flex-1 relative bg-white shadow-floating dotted-corner p-12 pt-24 lg:pt-12 lg:pl-24 lg:-translate-x-12 leading-relaxed font-light"> |
| 69 | + <Translate translationKey="2026.tickets.description" /> |
| 70 | + <p className="mt-4 text-lg font-bold"> |
| 71 | + {t("2026.tickets.description2")} |
| 72 | + </p> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + </div> |
| 76 | + </div> |
| 77 | + <div className=""> |
| 78 | + <div className="container relative z-10 max-w-4xl py-12"> |
| 79 | + <SectionTitle dark small lined> |
| 80 | + <strong>{t("2026.tickets.buy")}</strong> |
| 81 | + </SectionTitle> |
| 82 | + <div className="hidden relative w-full gap-0 md:grid grid-cols-3 py-12 mb-12 overflow-hidden"> |
| 83 | + <div className="absolute w-1.5 h-full left-4 -translate-x-1/2 md:-translate-x-0 top-0 md:h-1.5 md:w-full md:top-1/2 md:left-0 md:-translate-y-1/2 bg-white/30"></div> |
| 84 | + {timelinePrices?.map((p) => ( |
| 85 | + <div |
| 86 | + key={p.type} |
| 87 | + className="relative flex flex-col items-center gap-2" |
| 88 | + > |
| 89 | + <div className="ml-8 md:ml-0 whitespace-nowrap absolute left-full md:left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2"> |
| 90 | + <div |
| 91 | + className={classNames( |
| 92 | + "font-bold uppercase md:mb-12 text-left md:text-center", |
| 93 | + isActiveOffer(p) |
| 94 | + ? "text-blue md:mb-12" |
| 95 | + : isPastOffer(p) |
| 96 | + ? "text-white/30 md:mb-4" |
| 97 | + : "text-white md:mb-4" |
| 98 | + )} |
| 99 | + > |
| 100 | + {p.type} |
| 101 | + </div> |
| 102 | + <p |
| 103 | + className={classNames( |
| 104 | + isActiveOffer(p) |
| 105 | + ? "text-blue" |
| 106 | + : isPastOffer(p) |
| 107 | + ? "text-white/30" |
| 108 | + : "text-white" |
| 109 | + )} |
| 110 | + > |
| 111 | + {t("2026.tickets.until_date", { |
| 112 | + date: toLocaleDate(p.limitDate as string), |
| 113 | + })} |
| 114 | + </p> |
| 115 | + </div> |
| 116 | + <div |
| 117 | + className={classNames( |
| 118 | + "relative rounded-full border-4 size-8", |
| 119 | + isActiveOffer(p) |
| 120 | + ? "border-blue bg-blue before:h-screen before:w-1.5 before:md:w-screen before:absolute before:md:h-1.5 before:bottom-full before:-translate-x-1/2 before:md:-translate-x-0 before:md:right-full before:bg-blue before:left-1/2 before:md:left-auto before:md:top-1/2 before:md:-translate-y-1/2" |
| 121 | + : "hidden" |
| 122 | + )} |
| 123 | + /> |
| 124 | + </div> |
| 125 | + ))} |
| 126 | + </div> |
| 127 | + <a |
| 128 | + title="Vente de billets en ligne" |
| 129 | + href="https://www.billetweb.fr/shop.php?event=api-platform-conference-2026" |
| 130 | + className="shop_frame" |
| 131 | + target="_blank" |
| 132 | + data-src="https://www.billetweb.fr/shop.php?event=api-platform-conference-2026" |
| 133 | + data-max-width="100%" |
| 134 | + data-initial-height="600" |
| 135 | + data-scrolling="no" |
| 136 | + data-id="api-platform-conference-2026" |
| 137 | + data-resize="1" |
| 138 | + > |
| 139 | + Vente de billets en ligne |
| 140 | + </a> |
| 141 | + <Script |
| 142 | + src="https://www.billetweb.fr/js/export.js" |
| 143 | + strategy="afterInteractive" |
| 144 | + /> |
| 145 | + </div> |
| 146 | + </div> |
| 147 | + <div className="bg-white pt-12 pb-48"> |
| 148 | + <div className="container max-w-6xl -mt-12"> |
| 149 | + <SectionTitle small lined> |
| 150 | + <Translate translationKey="2026.tickets.expect.title" /> |
| 151 | + </SectionTitle> |
| 152 | + <div className="mx-auto max-w-64 sm:max-w-xl grid grid-cols-1 sm:grid-cols-2 xl:max-w-none xl:grid-cols-4 gap-8 text-white"> |
| 153 | + {expectations.map((e, i) => ( |
| 154 | + <div |
| 155 | + key={i} |
| 156 | + className={classNames( |
| 157 | + "p-8 aspect-square flex flex-col justify-center", |
| 158 | + i === 0 && "bg-blue-dark", |
| 159 | + i === 1 && "bg-blue-black/80", |
| 160 | + i === 2 && "bg-blue-darkest", |
| 161 | + i === 3 && "bg-blue-dark" |
| 162 | + )} |
| 163 | + > |
| 164 | + <p className="uppercase font-bold text-xl">{e.title}</p> |
| 165 | + <p>{e.text}</p> |
| 166 | + </div> |
| 167 | + ))} |
| 168 | + </div> |
| 169 | + </div> |
| 170 | + </div> |
| 171 | + </> |
| 172 | + ); |
| 173 | +} |
0 commit comments