---
import {l} from "../util/util";
import Login from "../components/Login.svelte";
import NavbarLayout from "../layouts/NavbarLayout.astro";
import {t} from "astro-i18n";
import {Image} from "astro:assets";
import localBau from "../images/2023-10-08_20.43.43.png";
---

<NavbarLayout title={t("login.page")}>
    <script>
        import {l} from "../util/util";
        import {AES} from "crypto-js";

        if (AES.decrypt(localStorage.getItem("sw-session") ?? "", import.meta.env.PUBLIC_SECRET)?.toString() !== "") {
            window.location.href = l("/dashboard");
        }
    </script>
    <Image src={localBau} alt="Bau" width="1920" height="1080" class="w-screen h-screen dark:brightness-75 fixed -z-10 object-cover" draggable="false" />
    <div class="h-screen mx-auto  p-8 rounded-b-md shadow-md pt-40 sm:pt-28 md:pt-14 flex flex-col justify-center items-center
            dark:text-white " style="width: min(100vw, 75em);">
        <Login client:load />
    </div>
</NavbarLayout>