<script lang="ts">
    import Footer from "./lib/components/Footer.svelte"
    import Header from "./lib/components/Menu/Header.svelte"
    import Menu from "./lib/components/Menu/Menu.svelte"
    import { location } from "./store"

    export let url = ""

    if (url) {
        let l = url.split("?")
        $location = {
            path: l[0],
            search: l.length > 1 ? l[1] : "",
            hash: "",
            categoryPath: l[0].replace(/\/[^_\/]+_[^\/]+$/, ""),
            push: false,
            pop: false,
        }
    }

    if (typeof window !== "undefined") console.log("App initialized")
    let activeMenu = true
</script>

<main class="">
    <Header bind:active="{activeMenu}" />
    <Footer />
</main>

<Menu bind:active="{activeMenu}" />

<style lang="less" global>
    @import "./lib/assets/css/main.less";
    @import "./lib/assets/css/base.less";
    main {
        overflow: hidden;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
        width: 100%;
        @media @mobile {
            font-size: @bodyfontsize;
        }
        @media @tablet {
            font-size: @bodyfontsize_desktop;
        }
    }
    @font-face {
        font-display: swap;
        font-family: "Libre Franklin";
        font-style: normal;
        font-weight: 400;
        src: url("./lib/assets/fonts/libre-franklin-v13-latin-regular.woff2") format("woff2");
    }
</style>
