From edf97f63dda699a20df6b4794e083eee73fb9e84 Mon Sep 17 00:00:00 2001 From: Aelita4 Date: Sat, 11 Nov 2023 23:28:42 +0100 Subject: [PATCH] Implement basic layout of website --- src/components/NavBar.astro | 57 +++++++++++++---- src/pages/game/index.astro | 120 +++++++++++++++++++++++++++++++++++ src/pages/index.astro | 7 ++- src/pages/login.astro | 76 ++++++++++++++++++++++ src/pages/logout.astro | 7 +++ src/pages/register.astro | 122 ++++++++++++++++++++++++++++++++++++ 6 files changed, 375 insertions(+), 14 deletions(-) create mode 100644 src/pages/game/index.astro create mode 100644 src/pages/login.astro create mode 100644 src/pages/logout.astro create mode 100644 src/pages/register.astro diff --git a/src/components/NavBar.astro b/src/components/NavBar.astro index eb43486..934b61e 100644 --- a/src/components/NavBar.astro +++ b/src/components/NavBar.astro @@ -1,4 +1,5 @@ --- +import { getHighestWeightedLanguage, getLocales } from '../lib/lang/langDriver'; interface Props { loggedIn: string; } @@ -10,20 +11,34 @@ interface NavElement { dropdowns?: Array; } +const lang = await getLocales(getHighestWeightedLanguage(Astro.request.headers.get('accept-language')), 'navbar'); + const listOfElements: Array = [{ - title: "home", - type: "simple", - url: "#" -}, { - title: "login", + title: lang["Link_home"], type: "simple", url: "/" }, { - title: "dropdown", + title: lang["Link_login"], + type: "simple", + url: "/login" +}, { + title: lang["Link_register"], + type: "simple", + url: "/register" +},{ + title: lang["Link_dropdown"], type: "dropdown", url: "about:blank", dropdowns: [{ - title: "chuj", + title: "drop1", + type: "simple", + url: "aaa" + }, { + title: "drop2", + type: "simple", + url: "aaa" + }, { + title: "drop3", type: "simple", url: "aaa" }] @@ -38,8 +53,8 @@ const { loggedIn } = Astro.props; element.type === "dropdown" ?