Timetable added & updated

This commit is contained in:
2026-08-21 22:40:10 +03:00
parent a981000d3c
commit bb88339939
10 changed files with 754 additions and 91 deletions

View File

@@ -1,27 +1,198 @@
import { vipnagorgialla } from "@/components/Vipnagorgialla";
import { getTranslations, setRequestLocale } from "next-intl/server";
"use client";
export default async function Timetable({
params,
}: {
params: Promise<{ locale: string }>;
}) {
const { locale } = await params;
setRequestLocale(locale);
const t = await getTranslations({ locale });
import { useState } from "react";
import { useSearchParams } from "next/navigation";
import { vipnagorgialla } from "@/components/Vipnagorgialla";
import { scheduleData, type ScheduleItem } from "@/data/timetable";
import { useTranslations, useLocale } from "next-intl";
const tabs = Object.keys(scheduleData);
// Map of filter shorthand to location key suffixes
const FILTER_MAP: Record<string, string[]> = {
aula: ['auditorium'],
auditorium: ['auditorium'],
tudengimaja: ['studentHouse'],
studenthouse: ['studentHouse'],
fuajee: ['lobbyAndLanArea'],
foyer: ['lobbyAndLanArea'],
lan: ['lobbyAndLanArea'],
lanarea: ['lobbyAndLanArea'],
lobby: ['lobbyAndLanArea'],
};
function matchesFilter(item: ScheduleItem, filter: string): boolean {
const normalizedFilter = filter.toLowerCase();
const locationKeys = Array.isArray(item.locationKey) ? item.locationKey : [item.locationKey];
// Get the matching location suffixes from the filter map, or use the filter directly
const filterSuffixes = FILTER_MAP[normalizedFilter] || [normalizedFilter];
// Check if any of the item's location keys contain any of the filter suffixes
return locationKeys.some(key =>
filterSuffixes.some(suffix =>
key.toLowerCase().includes(suffix.toLowerCase())
)
);
}
function formatLocationKeys(keys: string[], t: (key: string) => string, locale: string): string {
const translated = keys.map(k => t(k));
if (translated.length === 1) return translated[0];
const isEstonian = locale === 'et';
const and = isEstonian ? ' ja ' : ' and ';
if (translated.length === 2) {
return translated.join(and);
}
if (isEstonian) {
return translated.slice(0, -1).join(', ') + and + translated[translated.length - 1];
}
return translated.slice(0, -1).join(', ') + ', and ' + translated[translated.length - 1];
}
export default function Timetable() {
const searchParams = useSearchParams();
const filter = searchParams.get('filter') || '';
const [activeTab, setActiveTab] = useState(tabs[0]);
const schedule = scheduleData[activeTab];
const t = useTranslations();
const locale = useLocale();
// Filter schedule items based on the filter parameter
const filteredSchedule = filter
? schedule.filter(item => matchesFilter(item, filter))
: schedule;
return (
<div className="bg-[#0E0F19] min-h-screen flex flex-col items-center justify-center">
<h1
className={`${vipnagorgialla.className} font-bold italic text-[clamp(1.75rem,5vw,3rem)] text-[#EEE5E5] uppercase mb-4 text-center`}
>
{t("schedule.title")}
</h1>
<p
className={`${vipnagorgialla.className} font-bold italic text-[clamp(2rem,8vw,4.5rem)] text-[#EEE5E5] uppercase text-center`}
>
{t("schedule.comingSoon")}
</p>
<div>
<div className="flex flex-col min-h-[90vh] m-6 mt-16 md:m-16">
<h1
className={`text-4xl md:text-5xl lg:text-6xl ${vipnagorgialla.className} font-bold italic uppercase text-[#2A2C3F] dark:text-[#EEE5E5] mt-8 md:mt-16 mb-8`}
>
{t("schedule.title")}
</h1>
{/* Tab menu */}
<div className="flex gap-4 mb-8 flex-wrap">
{tabs.map((tab) => (
<button
key={tab}
onClick={() => setActiveTab(tab)}
className={`${vipnagorgialla.className} group font-bold cursor-pointer italic leading-none text-lg uppercase px-4 py-2 border-4 border-[#00A3E0] transition ${
activeTab === tab
? "bg-[#00A3E0] text-black cursor-default pointer-events-none"
: "bg-[#1F5673] text-[#EEE5E5] hover:bg-[#00A3E0] hover:text-black"
}`}
>
{t(`schedule.${tab}`)}
</button>
))}
</div>
{/* Filter buttons */}
<div className="mb-2">
<h2 className={`${vipnagorgialla.className} text-2xl md:text-3xl italic font-bold uppercase text-[#2A2C3F] dark:text-[#EEE5E5]`}>
{t("schedule.location")}
</h2>
</div>
<div className="flex gap-4 mb-8 flex-wrap">
<button
onClick={() => {
const url = new URL(window.location.href);
url.searchParams.delete('filter');
window.history.pushState({}, '', url.toString());
}}
className={`${vipnagorgialla.className} font-bold italic leading-none text-lg uppercase px-4 py-2 border-4 border-[#00A3E0] transition cursor-pointer ${
!filter
? "bg-[#00A3E0] text-black cursor-default pointer-events-none"
: "bg-[#1F5673] text-[#EEE5E5] hover:bg-[#00A3E0] hover:text-black"
}`}
>
{t("common.all")}
</button>
<button
onClick={() => {
const url = new URL(window.location.href);
url.searchParams.set('filter', 'aula');
window.history.pushState({}, '', url.toString());
}}
className={`${vipnagorgialla.className} font-bold italic leading-none text-lg uppercase px-4 py-2 border-4 border-[#00A3E0] transition cursor-pointer ${
filter === 'aula'
? "bg-[#00A3E0] text-black cursor-default pointer-events-none"
: "bg-[#1F5673] text-[#EEE5E5] hover:bg-[#00A3E0] hover:text-black"
}`}
>
{t("schedule.locations.auditorium")}
</button>
<button
onClick={() => {
const url = new URL(window.location.href);
url.searchParams.set('filter', 'tudengimaja');
window.history.pushState({}, '', url.toString());
}}
className={`${vipnagorgialla.className} font-bold italic leading-none text-lg uppercase px-4 py-2 border-4 border-[#00A3E0] transition cursor-pointer ${
filter === 'tudengimaja'
? "bg-[#00A3E0] text-black cursor-default pointer-events-none"
: "bg-[#1F5673] text-[#EEE5E5] hover:bg-[#00A3E0] hover:text-black"
}`}
>
{t("schedule.locations.studentHouse")}
</button>
<button
onClick={() => {
const url = new URL(window.location.href);
url.searchParams.set('filter', 'lobby');
window.history.pushState({}, '', url.toString());
}}
className={`${vipnagorgialla.className} font-bold italic leading-none text-lg uppercase px-4 py-2 border-4 border-[#00A3E0] transition cursor-pointer ${
filter === 'lobby'
? "bg-[#00A3E0] text-black cursor-default pointer-events-none"
: "bg-[#1F5673] text-[#EEE5E5] hover:bg-[#00A3E0] hover:text-black"
}`}
>
{t("schedule.locations.lobbyAndLanArea")}
</button>
</div>
{/* Schedule entries */}
<div className="space-y-6">
{filteredSchedule.map((item, idx) => (
<div
key={idx}
className="border-l-4 border-[#007CAB] pl-8 flex flex-col sm:flex-row flex-wrap gap-2 sm:gap-5 items-stretch"
>
<div
className={`${vipnagorgialla.className} w-[260px] md:w-[360px] text-[#00A3E0] text-3xl md:text-[2.5rem] font-bold italic flex items-start justify-start sm:pt-3 whitespace-nowrap`}
>
{item.time}
</div>
<div className="flex-1 flex flex-col justify-start pt-3 min-w-0 sm:min-h-24">
<div
className={`${vipnagorgialla.className} text-2xl md:text-3xl italic font-bold text-[#2A2C3F] dark:text-[#EEE5E5] text-balance`}
>
{t(item.titleKey)}
</div>
{item.description && (
<div className="text-xl md:text-2xl text-[#938BA1] dark:text-[#938BA1] text-balance">
{item.description}
</div>
)}
<div className="text-xl md:text-2xl text-[#938BA1] dark:text-[#938BA1] text-balance">
{Array.isArray(item.locationKey)
? formatLocationKeys(item.locationKey, t, locale)
: t(item.locationKey)
}
</div>
</div>
</div>
))}
</div>
<p className="text-xl pt-8 max-w-4xl italic">{t("schedule.transportInfo")}</p>
</div>
</div>
);
}

View File

@@ -32,7 +32,7 @@ export default async function Page({
return (
<div className="bg-[#0E0F19] min-h-screen pt-16 md:pt-20">
<div className="max-w-480 mx-auto px-4 sm:px-6 md:px-12 lg:px-64 py-10 md:py-20">
<div className="grid grid-cols-1 lg:grid-cols-[1fr_250px] lg:gap-30">
<div className="tournament-page-scope grid grid-cols-1 lg:grid-cols-[1fr_300px] gap-8 lg:gap-16">
{/* Main content */}
<div>
{/* Page title */}

View File

@@ -41,7 +41,7 @@ const Header = ({ navItems }: HeaderProps) => {
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
// Header navigation should include all options except homepage and hidden items
const hiddenNavHrefs: NavItem["href"][] = ["/messiala", "/ajakava"];
const hiddenNavHrefs: NavItem["href"][] = ["/messiala"];
const mainNavItems = navItems.filter(
(item) => item.href !== "/" && !hiddenNavHrefs.includes(item.href),
);

View File

@@ -60,7 +60,7 @@ const sponsors: Sponsor[] = [
},
{
href: "https://globalproductions.ee/",
src: "/sponsors/Global-productions.png",
src: "/sponsors/Global-productions.svg",
alt: "Global Productions",
width: 200,
height: 200,

View File

@@ -288,14 +288,14 @@ export default function SwitchableTicketCard({
{/* Chevron buttons on left/right sides */}
<button
onClick={() => setIsA(false)}
className={`${isA ? "flex" : "hidden"} absolute right-0 top-1/2 -translate-y-1/2 w-10 h-10 items-center justify-center bg-[#0E0F19]/50 hover:bg-[#007CAB] text-[#EEE5E5] transition-all duration-300 z-20`}
className={`${isA ? "flex" : "hidden"} absolute right-0 top-1/2 -translate-y-1/2 w-10 h-10 items-center justify-center cursor-pointer bg-[#0E0F19]/50 hover:bg-[#007CAB] text-[#EEE5E5] transition-all duration-300 z-20`}
aria-label={optionB.title}
>
<span className="material-symbols-outlined">chevron_right</span>
</button>
<button
onClick={() => setIsA(true)}
className={`${!isA ? "flex" : "hidden"} absolute left-0 top-1/2 -translate-y-1/2 w-10 h-10 items-center justify-center bg-[#0E0F19]/50 hover:bg-[#007CAB] text-[#EEE5E5] transition-all duration-300 z-20`}
className={`${!isA ? "flex" : "hidden"} absolute left-0 top-1/2 -translate-y-1/2 w-10 h-10 items-center justify-center cursor-pointer bg-[#0E0F19]/50 hover:bg-[#007CAB] text-[#EEE5E5] transition-all duration-300 z-20`}
aria-label={optionA.title}
>
<span className="material-symbols-outlined">chevron_left</span>

View File

@@ -1,112 +1,392 @@
export type ScheduleItem = {
time?: string; // Aeg on ajutine praegu kuna pole 100% kindlalt paigas
titleKey: string;
locationKey: string;
locationKey: string | string[];
description?: string;
};
export const scheduleData: Record<string, ScheduleItem[]> = {
oct24: [
sep11: [
{
titleKey: "schedule.events.doorsOpen",
locationKey: "schedule.locations.registrationSetup",
locationKey: [
"schedule.locations.auditorium",
"schedule.locations.studentHouse",
"schedule.locations.lobbyAndLanArea"
],
time: "17:00",
},
{
titleKey: "schedule.events.gamersSetup",
locationKey: [
"schedule.locations.auditorium",
"schedule.locations.studentHouse"
],
time: "17:00-19:00",
},
{
titleKey: "schedule.events.exploring",
locationKey: [
"schedule.locations.auditorium",
"schedule.locations.studentHouse"
],
time: "17:00-18:00",
},
{
titleKey: "schedule.events.gameDevShowcasing",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "17:00-00:00",
},
{
titleKey: "schedule.events.miniTournaments",
locationKey: "schedule.locations.studentHouse",
time: "18:00",
},
{
titleKey: "schedule.events.smashBrosUltimate",
locationKey: "schedule.locations.studentHouse",
time: "18:30",
titleKey: "schedule.events.lanAreaTournaments",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "18:00-00:00",
},
{
titleKey: "schedule.events.cs2LolTournaments",
titleKey: "schedule.events.minigamesAndTournaments",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "18:00-00:00",
},
{
titleKey: "schedule.events.blueCarpet",
locationKey: [
"schedule.locations.auditorium",
"schedule.locations.studentHouse"
],
time: "19:00",
},
{
titleKey: "schedule.events.day1Begins",
locationKey: [
"schedule.locations.auditorium",
"schedule.locations.studentHouse"
],
time: "19:30",
},
{
titleKey: "schedule.events.cs2SwissR1",
locationKey: "schedule.locations.auditorium",
time: "20:00",
time: "20:00-21:00",
},
{
titleKey: "schedule.events.lolGame1",
locationKey: "schedule.locations.studentHouse",
time: "20:00-21:00",
},
{
titleKey: "schedule.events.cs2SwissR2",
locationKey: "schedule.locations.auditorium",
time: "21:00-22:00",
},
{
titleKey: "schedule.events.lolGame2",
locationKey: "schedule.locations.studentHouse",
time: "21:00-22:00",
},
{
titleKey: "schedule.events.cs2SwissR3",
locationKey: "schedule.locations.auditorium",
time: "22:00-23:00",
},
{
titleKey: "schedule.events.lolGame3",
locationKey: "schedule.locations.studentHouse",
time: "22:00-23:00",
},
{
titleKey: "schedule.events.cs2SwissR4",
locationKey: "schedule.locations.auditorium",
time: "23:00-00:00",
},
{
titleKey: "schedule.events.lolGame4",
locationKey: "schedule.locations.studentHouse",
time: "23:00-00:00",
},
{
titleKey: "schedule.events.cs2SwissR5",
locationKey: "schedule.locations.auditorium",
time: "00:00-01:00",
},
{
titleKey: "schedule.events.lolGame5",
locationKey: "schedule.locations.studentHouse",
time: "00:00-01:00",
},
{
titleKey: "schedule.events.doorsClose",
locationKey: "schedule.locations.auditoriumAndStudentHouse",
locationKey: [
"schedule.locations.auditorium",
"schedule.locations.studentHouse",
"schedule.locations.lobbyAndLanArea"
],
time: "*01:00",
},
],
oct25: [
sep12: [
{
titleKey: "schedule.events.doorsOpenSimple",
locationKey: "schedule.locations.auditorium",
time: "09:30",
locationKey: [
"schedule.locations.auditorium",
"schedule.locations.studentHouse",
"schedule.locations.lobbyAndLanArea"
],
time: "09:00",
},
{
titleKey: "schedule.events.cs2Continue",
titleKey: "schedule.events.gamersSetup",
locationKey: "schedule.locations.auditorium",
time: "11:00",
time: "09:00-10:30",
},
{
titleKey: "schedule.events.lolContinue",
titleKey: "schedule.events.gamersSetup",
locationKey: "schedule.locations.studentHouse",
time: "09:00-11:30",
},
{
titleKey: "schedule.events.mcWbR1",
locationKey: "schedule.locations.auditorium",
time: "12:00",
time: "10:30-13:00",
},
{
titleKey: "schedule.events.scWbR1",
locationKey: "schedule.locations.studentHouse",
time: "10:30-11:30",
},
{
titleKey: "schedule.events.scLbR1",
locationKey: "schedule.locations.studentHouse",
time: "11:30-12:30",
},
{
titleKey: "schedule.events.mcTournamentQuarters",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "11:30-14:30",
},
{
titleKey: "schedule.events.expoOpens",
locationKey: "schedule.locations.entranceHall",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "12:00",
},
{
titleKey: "schedule.events.2xkoTournament",
titleKey: "schedule.events.gamedevExpo",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "12:00-19:00",
},
{
titleKey: "schedule.events.miniTournaments",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "13:00-19:00",
},
{
titleKey: "schedule.events.mcLbR1",
locationKey: "schedule.locations.auditorium",
time: "13:00-14:00",
},
{
titleKey: "schedule.events.scWbR2",
locationKey: "schedule.locations.studentHouse",
time: "13:30",
time: "12:30-13:30",
},
{
titleKey: "schedule.events.lolFinale",
locationKey: "schedule.locations.auditorium",
time: "19:30",
},
{
titleKey: "schedule.events.cs2lbsemifinals",
locationKey: "schedule.locations.auditorium",
time: "19:30",
},
{
titleKey: "schedule.events.cs2lbfinals",
locationKey: "schedule.locations.auditorium",
time: "21:30",
},
{
titleKey: "schedule.events.granTurismoFinale",
titleKey: "schedule.events.scLbR2",
locationKey: "schedule.locations.studentHouse",
time: "20:00",
time: "13:30-14:30",
},
{
titleKey: "schedule.events.mcWbR2",
locationKey: "schedule.locations.auditorium",
time: "14:00-16:00",
},
{
titleKey: "schedule.events.scWbR3",
locationKey: "schedule.locations.studentHouse",
time: "14:30-15:30",
},
{
titleKey: "schedule.events.break",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "14:30-15:00",
},
{
titleKey: "schedule.events.semiFinals",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "15:00-18:00",
},
{
titleKey: "schedule.events.scLbR3",
locationKey: "schedule.locations.studentHouse",
time: "15:45-16:30",
},
{
titleKey: "schedule.events.mcLbR2",
locationKey: "schedule.locations.auditorium",
time: "16:30-17:30",
},
{
titleKey: "schedule.events.scLbR4",
locationKey: "schedule.locations.studentHouse",
time: "16:30-17:30",
},
{
titleKey: "schedule.events.break",
locationKey: "schedule.locations.auditorium",
time: "17:30-19:30",
},
{
titleKey: "schedule.events.break",
locationKey: "schedule.locations.studentHouse",
time: "18:00-19:00",
},
{
titleKey: "schedule.events.avatarLegendsFinal",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "19:00-19:30",
},
{
titleKey: "schedule.events.gamedevAwardCeremony",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "19:00-20:00",
},
{
titleKey: "schedule.events.finalsAndThirdPlace",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "19:00-00:00",
},
{
titleKey: "schedule.events.mcWbR3",
locationKey: "schedule.locations.auditorium",
time: "19:30-22:00",
},
{
titleKey: "schedule.events.scSemiFinal",
locationKey: "schedule.locations.studentHouse",
time: "19:30-20:30",
},
{
titleKey: "schedule.events.tekken8Final",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "19:30-20:00",
},
{
titleKey: "schedule.events.streetFighter6Final",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "20:00-20:30",
},
{
titleKey: "schedule.events.gamedevExpo",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "20:00-00:00",
},
{
titleKey: "schedule.events.twoXkoFinal",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "20:30-21:00",
},
{
titleKey: "schedule.events.scLbR5",
locationKey: "schedule.locations.studentHouse",
time: "20:30-21:30",
},
{
titleKey: "schedule.events.ssbuFinal",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "21:00-21:30",
},
{
titleKey: "schedule.events.scTournamentFinalEnd",
locationKey: "schedule.locations.studentHouse",
time: "21:30-23:30",
},
{
titleKey: "schedule.events.invincibleVsFinal",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "21:30-22:00",
},
{
titleKey: "schedule.events.mcLbR3",
locationKey: "schedule.locations.auditorium",
time: "22:00-23:00",
},
{
titleKey: "schedule.events.miniTournamentsAwardCeremony",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "22:00-22:30",
},
{
titleKey: "schedule.events.mcLbR4",
locationKey: "schedule.locations.auditorium",
time: "23:00-00:00",
},
{
titleKey: "schedule.events.awardCeremony",
locationKey: "schedule.locations.lobbyAndLanArea",
time: "00:00-00:30",
},
{
titleKey: "schedule.events.doorsClose",
locationKey: "schedule.locations.auditoriumAndStudentHouse",
time: "*01:00",
locationKey: "schedule.locations.auditorium",
time: "*01:30",
},
],
oct26: [
sep13: [
{
titleKey: "schedule.events.cs2semifinals",
locationKey: "schedule.locations.auditorium",
time: "11:00",
titleKey: "schedule.events.noEventsScheduled",
locationKey: [
"schedule.locations.studentHouse",
"schedule.locations.lobbyAndLanArea"
],
time: "-",
},
{
titleKey: "schedule.events.Cs2finals",
titleKey: "schedule.events.doorsOpenSimple",
locationKey: "schedule.locations.auditorium",
time: "15:30",
time: "09:00",
},
{
titleKey: "schedule.events.AwardsCeremony",
titleKey: "schedule.events.gamersSetup",
locationKey: "schedule.locations.auditorium",
time: "18:00",
time: "09:30-10:30",
},
{
titleKey: "schedule.events.doorsClose",
titleKey: "schedule.events.cs2WbR4",
locationKey: "schedule.locations.auditorium",
time: "10:30-13:00",
},
{
titleKey: "schedule.events.cs2LbR5",
locationKey: "schedule.locations.auditorium",
time: "13:00-14:00",
},
{
titleKey: "schedule.events.cs2LbR6",
locationKey: "schedule.locations.auditorium",
time: "14:00-16:00",
},
{
titleKey: "schedule.events.cs2GrandFinal",
locationKey: "schedule.locations.auditorium",
time: "16:00-18:00",
},
{
titleKey: "schedule.events.awardCeremony",
locationKey: "schedule.locations.auditorium",
time: "18:30",
},
{
titleKey: "schedule.events.closingCeremony",
locationKey: "schedule.locations.auditorium",
time: "19:00",
},
{
titleKey: "schedule.events.doorsClose",
locationKey: "schedule.locations.auditorium",
time: "19:30",
},
],
};