Begin Display, Add View Transitions

This commit is contained in:
2024-02-28 17:28:21 +01:00
parent 361d7dae6a
commit 678746c89b
31 changed files with 349 additions and 212 deletions

View File

@@ -7,10 +7,11 @@ import {t} from "astro-i18n";
<PageLayout title={t("dashboard.page")}>
<script>
import {l} from "../util/util";
import {navigate} from "astro:transitions/client";
if (window.location.href.endsWith("/dashboard") || window.location.href.endsWith("/dashboard/")) {
if ((localStorage.getItem("sw-session") ?? "") === "") {
window.location.href = l("/login");
navigate(l("/login"), {});
}
}
</script>

View File

@@ -9,10 +9,11 @@ import localBau from "@images/2023-10-08_20.43.43.png";
<NavbarLayout title={t("login.page")}>
<script>
import {l} from "../util/util";
import {navigate} from "astro:transitions/client";
if (window.location.href.endsWith("/login") || window.location.href.endsWith("/login/")) {
if ((localStorage.getItem("sw-session") ?? "") !== "") {
window.location.href = l("/dashboard");
navigate(l("/dashboard"));
}
}
</script>

View File

@@ -31,7 +31,7 @@ const {page, german} = Astro.props;
const {Content} = await page.render();
---
<PageLayout title={t("title", {mode: t(`${page.data.translationKey}.title`)}, {route: "/rules"})}>
<PageLayout title={t("rules.title", {mode: t(`${page.data.translationKey}.title`)})}>
<article>
{german && (
<LanguageWarning/>

View File

@@ -20,22 +20,22 @@ const imageMap = {
const modes = await getCollection("modes", entry => entry.data.main);
---
<PageLayout title={t("page")}>
<PageLayout title={t("rules.page")}>
{modes.map(value => (
<div class="dark:bg-neutral-800 rounded-md p-4 border border-neutral-400 shadow-md my-4 flex flex-col
md:flex-row">
<Image height="300" width="300" src={imageMap[value.data.translationKey]}
alt={t(value.data.translationKey + ".title")} class="dark:invert"></Image>
alt={t("rules." + value.data.translationKey + ".title")} class="dark:invert"></Image>
<div class="ml-4">
<h1 class="text-2xl font-bold">{t(value.data.translationKey + ".title")}</h1>
<div>{t(value.data.translationKey + ".description")}</div>
<div>{t("rules." + value.data.translationKey + ".description")}</div>
<div class="mt-2 flex flex-col">
<a href={l(`/rules/${value.id}`)} class="text-yellow-300 hover:underline w-fit">{t("rules")}</a>
<a href={l(`/rules/${value.id}`)} class="text-yellow-300 hover:underline w-fit">{t("rules.rules")}</a>
<a href={l(`/announcements/tags/${value.id}`)}
class="text-yellow-300 hover:underline w-fit">{t("announcements")}</a>
class="text-yellow-300 hover:underline w-fit">{t("rules.announcements")}</a>
{value.data.ranked
? <a href={l(`/ranked/${value.id}`)}
class="text-yellow-300 hover:underline w-fit">{t("ranking")}</a>
class="text-yellow-300 hover:underline w-fit">{t("rules.ranking")}</a>
: null}
</div>
</div>