67 lines
1.2 KiB
Svelte
67 lines
1.2 KiB
Svelte
<script lang="ts">
|
|
import '../app.css';
|
|
import { page } from '$app/stores';
|
|
import Footer from "./Footer.svelte";
|
|
import Navbar from "./Navbar.svelte";
|
|
import PageTransition from "./PageTransition.svelte";
|
|
|
|
export let data : { url: string };
|
|
</script>
|
|
|
|
<!-- Homepage has its own navbar with animations -->
|
|
{#if $page.url.pathname != "/"}
|
|
<div id="layout">
|
|
<div id="navbar">
|
|
<Navbar />
|
|
<slot name="header" />
|
|
</div>
|
|
<main>
|
|
<PageTransition url={data.url}>
|
|
<slot />
|
|
</PageTransition>
|
|
<Footer />
|
|
</main>
|
|
</div>
|
|
{:else}
|
|
<!-- On the home page -->
|
|
<PageTransition url={data.url}>
|
|
<slot />
|
|
</PageTransition>
|
|
<Footer />
|
|
{/if}
|
|
|
|
<style>
|
|
#layout {
|
|
max-width: max(80vw, 100vh);
|
|
margin-left: auto;
|
|
margin-right: auto;
|
|
margin-top: 50px;
|
|
gap: 100px;
|
|
display: flex;
|
|
justify-content: center;
|
|
/*
|
|
display: grid;
|
|
grid-template-columns: 1fr 3fr;
|
|
grid-template-areas:
|
|
"nav content"
|
|
;
|
|
*/
|
|
}
|
|
@media (max-width: 700px) {
|
|
#layout {
|
|
flex-direction: column;
|
|
margin-top: 10px;
|
|
gap: 20px;
|
|
}
|
|
}
|
|
main {
|
|
width: min(100vw, max(50vw, 100vh));
|
|
grid-area: content;
|
|
}
|
|
#navbar {
|
|
align-self: right;
|
|
padding-left: 10px;
|
|
grid-area: nav;
|
|
}
|
|
</style>
|