From 376e9e7f28c1da920f7e32121f49f1e2a9d80533 Mon Sep 17 00:00:00 2001 From: v4ltages Date: Wed, 6 May 2026 18:14:23 +0300 Subject: [PATCH] Adjustments to fit within Figma design --- public/flags/eng.svg | 6 ++ public/flags/est.svg | 5 + src/app/[locale]/ajakava/page.tsx | 4 +- src/app/[locale]/kodukord/page.tsx | 116 +++++++++++++++--------- src/app/[locale]/messiala/page.tsx | 4 +- src/app/[locale]/page.tsx | 8 +- src/app/[locale]/piletid/page.tsx | 6 +- src/app/[locale]/striim/page.tsx | 16 ++-- src/app/[locale]/turniirid/cs2/page.tsx | 70 ++++++-------- src/app/[locale]/turniirid/lol/page.tsx | 54 +++++------ src/app/globals.css | 4 +- src/components/Footer.tsx | 6 +- src/components/Header.tsx | 14 +-- src/components/LanguageSwitcher.tsx | 22 +++-- src/components/RuleNav.tsx | 17 +++- src/components/RulesContent.tsx | 22 ++--- src/components/TeaserCarousel.tsx | 8 +- src/components/ui/dropdown-menu.tsx | 80 ++++++++-------- translations/en.json | 8 +- translations/et.json | 8 +- 20 files changed, 262 insertions(+), 216 deletions(-) create mode 100644 public/flags/eng.svg create mode 100644 public/flags/est.svg diff --git a/public/flags/eng.svg b/public/flags/eng.svg new file mode 100644 index 0000000..27179be --- /dev/null +++ b/public/flags/eng.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/flags/est.svg b/public/flags/est.svg new file mode 100644 index 0000000..c0d2649 --- /dev/null +++ b/public/flags/est.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/app/[locale]/ajakava/page.tsx b/src/app/[locale]/ajakava/page.tsx index 0fc3bc7..e32f55f 100644 --- a/src/app/[locale]/ajakava/page.tsx +++ b/src/app/[locale]/ajakava/page.tsx @@ -13,12 +13,12 @@ export default async function Timetable({ return (

{t("schedule.title")}

{t("schedule.comingSoon")}

diff --git a/src/app/[locale]/kodukord/page.tsx b/src/app/[locale]/kodukord/page.tsx index 0e78cdf..75a956a 100644 --- a/src/app/[locale]/kodukord/page.tsx +++ b/src/app/[locale]/kodukord/page.tsx @@ -1,10 +1,15 @@ // app/kodukord/page.tsx (App Router) import ReactMarkdown, { Components } from "react-markdown"; import { vipnagorgialla } from "@/components/Vipnagorgialla"; -import SectionDivider from "@/components/SectionDivider"; +import RuleNav from "@/components/RuleNav"; import { getTranslations, setRequestLocale } from "next-intl/server"; import { loadRulesBun } from "@/lib/loadRules"; +const sectionKeys = [ + { id: "reminder", labelKey: "rules.reminder" }, + { id: "code", labelKey: "rules.code" }, +]; + export default async function Page({ params, }: { @@ -15,50 +20,77 @@ export default async function Page({ const t = await getTranslations({ locale }); const content = await loadRulesBun("kodukord", locale as "et" | "en"); - return ( -
-
- {/* Page title (separate from markdown headings) */} -

- {t("rules.houseRules")} -

+ const sections = sectionKeys.map((section) => ({ + id: section.id, + label: t(section.labelKey), + })); -
- ( -

- {props.children} -

- ), - h2: (props) => ( -

- {props.children} -

- ), - ol: (props) => ( -
    - {props.children} -
- ), - ul: (props) => ( -
    - {props.children} -
- ), - p: (props) =>

{props.children}

, - } as Components - } - > - {content} -
+ // Track heading count for ID assignment + let headingCount = 0; + + return ( +
+
+
+ {/* Main content */} +
+ {/* Page title */} +

+ {t("rules.houseRules")} +

+ + { + const id = + sections[headingCount]?.id || `section-${headingCount}`; + headingCount++; + return ( +

+ {props.children} +

+ ); + }, + h2: (props) => ( +

+ {props.children} +

+ ), + ol: (props) => ( +
    + {props.children} +
+ ), + ul: (props) => ( +
    + {props.children} +
+ ), + p: (props) => ( +

{props.children}

+ ), + li: (props) => ( +
  • {props.children}
  • + ), + } as Components + } + > + {content} +
    +
    + + {/* Sidebar navigation */} +
    - -
    ); } diff --git a/src/app/[locale]/messiala/page.tsx b/src/app/[locale]/messiala/page.tsx index a0ea252..5721527 100644 --- a/src/app/[locale]/messiala/page.tsx +++ b/src/app/[locale]/messiala/page.tsx @@ -13,12 +13,12 @@ export default async function Expo({ return (

    {t("expo.title")}

    {t("expo.comingSoon")}

    diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx index 943cac3..cf56c6f 100644 --- a/src/app/[locale]/page.tsx +++ b/src/app/[locale]/page.tsx @@ -29,7 +29,7 @@ export default async function Home({ >
    {t("navigation.tickets")} - + arrow_right_alt
    @@ -55,7 +55,7 @@ export default async function Home({ className="px-8 md:px-12 py-8 flex flex-col justify-center gap-4 group border-[#1F5673] hover:bg-[#007CAB] dark:hover:bg-[#00A3E0] transition" >
    - + rewarded_ads
    @@ -65,7 +65,7 @@ export default async function Home({ > {t("navigation.tournaments")} - + arrow_right_alt
    diff --git a/src/app/[locale]/piletid/page.tsx b/src/app/[locale]/piletid/page.tsx index 9dcefa2..3694244 100644 --- a/src/app/[locale]/piletid/page.tsx +++ b/src/app/[locale]/piletid/page.tsx @@ -28,7 +28,7 @@ function TicketCard({ }: TicketCardProps) { return (
    {backgroundImage && (

    {subtitle}

    @@ -66,7 +66,7 @@ function TicketCard({ ))}

    -
      +
        {features.map((feature, index) => (
      • {t("navigation.schedule")} - + arrow_right_alt
    - + event_note

    @@ -61,7 +61,7 @@ export default async function Home({ src="https://player.twitch.tv/?channel=tipilan_ee&parent=localhost&parent=tipilan.ee" height="100%" width="100%" - className="w-full h-full min-h-[400px]" + className="w-full h-full min-h-100" allow="autoplay; encrypted-media" >

    @@ -78,13 +78,13 @@ export default async function Home({ > {t("navigation.tournaments")} - + arrow_right_alt
    - + trophy

    @@ -102,12 +102,12 @@ export default async function Home({ > {t("navigation.expo")} - + arrow_right_alt

    - + weekend

    @@ -125,7 +125,7 @@ export default async function Home({

    {t("home.sections.reserveSpot")}

    - + arrow_right_alt
    diff --git a/src/app/[locale]/turniirid/cs2/page.tsx b/src/app/[locale]/turniirid/cs2/page.tsx index 4cc4853..b0dc8dc 100644 --- a/src/app/[locale]/turniirid/cs2/page.tsx +++ b/src/app/[locale]/turniirid/cs2/page.tsx @@ -62,21 +62,21 @@ export default async function CS2Tournament({ {/* SISSEJUHATUS */}

    {t("cs2page.intro.title")}

    -

    +

    {t("cs2page.intro.description")}

    {t("cs2page.intro.previousWinners")}

    -

    2025

    -
      +

      2025

      +
      1. RAID (Eesti)
      2. hypewrld (Läti)
      3. CSDIILIT (Soome/Eesti)
      4. @@ -86,29 +86,27 @@ export default async function CS2Tournament({ {/* ÜLDINE INFO */}

        {t("cs2page.info.title")}

        -

        - {t("cs2page.info.description")} -

        +

        {t("cs2page.info.description")}

        {/* AUHINNAFOND */}

        {t("cs2page.prizes.title")}

        {t("cs2page.prizes.mainTitle")}

        -
          +
          • 1. koht - 3000€, 600€ inimese kohta, 50% ehk 1/2 auhinnafondist. @@ -122,16 +120,16 @@ export default async function CS2Tournament({ auhinnafondist.
          -

          +

          {t("cs2page.prizes.mainNote")}

          {t("cs2page.prizes.secondTitle")}

          -
            +
            • 1. koht - 500€, 100€ inimese kohta, 66.6...(6)% ehk 2/3 auhinnafondist. @@ -141,7 +139,7 @@ export default async function CS2Tournament({ auhinnafondist.
            -

            +

            {t("cs2page.prizes.secondNote")}

        @@ -149,45 +147,41 @@ export default async function CS2Tournament({ {/* TURNIIRI FORMAAT */}

        {t("cs2page.format.title")}

        -

        +

        {t("cs2page.format.description")}

        -

        {t("cs2page.format.day1")}

        -

        {t("cs2page.format.day23")}

        +

        {t("cs2page.format.day1")}

        +

        {t("cs2page.format.day23")}

        {/* VRS INFO */}

        {t("cs2page.vrs.title")}

        -

        - {t("cs2page.vrs.description1")} -

        -

        - {t("cs2page.vrs.description2")} -

        +

        {t("cs2page.vrs.description1")}

        +

        {t("cs2page.vrs.description2")}

        {/* FAQ - commented out until content is ready

        {t("cs2page.faq.title")}

        {t("cs2page.faq.q1")}

        -

        +

        {t("cs2page.faq.a1")}

        @@ -196,32 +190,28 @@ export default async function CS2Tournament({ {/* REEGLID */}

        {t("cs2page.rules.title")}

        -

        +

        {t("cs2page.rules.description")}

        -

        - {t("cs2page.rules.contact")} -

        +

        {t("cs2page.rules.contact")}

        {t("cs2page.rules.contactName")}

        -

        - {t("cs2page.rules.contactRole")} -

        -

        +

        {t("cs2page.rules.contactRole")}

        +

        Discord:{" "} hrkruger diff --git a/src/app/[locale]/turniirid/lol/page.tsx b/src/app/[locale]/turniirid/lol/page.tsx index 57ab39c..8c23610 100644 --- a/src/app/[locale]/turniirid/lol/page.tsx +++ b/src/app/[locale]/turniirid/lol/page.tsx @@ -54,21 +54,21 @@ export default async function LoLTournament({ {/* SISSEJUHATUS */}

        {t("lolpage.intro.title")}

        -

        +

        {t("lolpage.intro.description")}

        {t("lolpage.intro.previousWinners")}

        -

        2025

        -
          +

          2025

          +
          1. Ükssilm (Eesti)
          2. Eesti Rästikud (Eesti)
          3. LOMiks (Läti)
          4. @@ -78,34 +78,32 @@ export default async function LoLTournament({ {/* ÜLDINE INFO */}

            {t("lolpage.info.title")}

            -

            - {t("lolpage.info.description")} -

            +

            {t("lolpage.info.description")}

            {/* AUHINNAFOND */}

            {t("lolpage.prizes.title")}

            {t("lolpage.prizes.mainTitle")}

            -
              +
              • {t("lolpage.prizes.place1")}
              • {t("lolpage.prizes.place2")}
              • {t("lolpage.prizes.place3")}
              -

              +

              {t("lolpage.prizes.note")}

            @@ -113,30 +111,30 @@ export default async function LoLTournament({ {/* TURNIIRI FORMAAT */}

            {t("lolpage.format.title")}

            -

            +

            {t("lolpage.format.description")}

            -

            {t("lolpage.format.day1")}

            -

            {t("lolpage.format.day2")}

            +

            {t("lolpage.format.day1")}

            +

            {t("lolpage.format.day2")}

            {/* FAQ - commented out until content is ready

            {t("lolpage.faq.title")}

            {t("lolpage.faq.q1")}

            -

            +

            {t("lolpage.faq.a1")}

            @@ -145,32 +143,28 @@ export default async function LoLTournament({ {/* REEGLID */}

            {t("lolpage.rules.title")}

            -

            +

            {t("lolpage.rules.description")}

            -

            - {t("lolpage.rules.contact")} -

            +

            {t("lolpage.rules.contact")}

            {t("lolpage.rules.contactName")}

            -

            - {t("lolpage.rules.contactRole")} -

            -

            +

            {t("lolpage.rules.contactRole")}

            +

            Discord:{" "} Kukkel diff --git a/src/app/globals.css b/src/app/globals.css index d4020f9..ef620ac 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -56,7 +56,7 @@ body { :root { --radius: 0.625rem; - --background: oklch(1 0 0); + --background: #0a121f; --foreground: oklch(0.145 0 0); --card: oklch(1 0 0); --card-foreground: oklch(0.145 0 0); @@ -90,7 +90,7 @@ body { } .dark { - --background: oklch(0.145 0 0); + --background: #0a121f; --foreground: oklch(0.985 0 0); --card: oklch(0.205 0 0); --card-foreground: oklch(0.985 0 0); diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 57ff6d1..3ac9ed5 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -11,7 +11,7 @@ const Footer = () => {

            {t("footer.contact")}

            @@ -30,7 +30,7 @@ const Footer = () => {
            - + phone diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 2d62316..7520041 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -49,10 +49,11 @@ const Header = ({ navItems }: HeaderProps) => { "/ajakava": "event_note", "/piletid": "local_activity", "/turniirid": "rewarded_ads", + "/kodukord": "gavel", }; useEffect(() => { - const largeScreenQuery = window.matchMedia("(min-width: 1024px)"); + const largeScreenQuery = window.matchMedia("(min-width: 1280px)"); const handleScaleOrViewportChange = (event: MediaQueryListEvent) => { if (event.matches) { @@ -79,7 +80,7 @@ const Header = ({ navItems }: HeaderProps) => { }, [pathname]); return ( -
            +
            {/* Logo */} { {/* Right side - Navigation + controls */} -
            +
            {/* Desktop Navigation */} -