2024-07-31 10:29:46 +02:00
|
|
|
<script lang="ts">
|
2024-08-02 15:33:18 +02:00
|
|
|
import "../app.css";
|
2024-07-31 10:29:46 +02:00
|
|
|
import { page } from "$app/stores";
|
2024-08-05 14:38:44 +02:00
|
|
|
import type { LayoutServerData } from "./$types";
|
|
|
|
|
import type { Snippet } from "svelte";
|
2024-08-14 19:33:41 +02:00
|
|
|
import { dev } from "$app/environment";
|
2024-08-05 14:38:44 +02:00
|
|
|
|
|
|
|
|
const { data, children } = $props<{ data: LayoutServerData; children: Snippet }>();
|
2024-08-01 18:09:35 +02:00
|
|
|
|
|
|
|
|
const isProjectRoute = $derived($page.url.pathname.startsWith("/website"));
|
2024-08-02 15:33:18 +02:00
|
|
|
const routeName = $derived(
|
|
|
|
|
$page.url.pathname === "/"
|
|
|
|
|
? "Dashboard"
|
|
|
|
|
: `${$page.url.pathname.charAt(1).toUpperCase()}${$page.url.pathname.slice(2)}`
|
|
|
|
|
);
|
2024-07-31 10:29:46 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<nav>
|
2024-08-01 18:09:35 +02:00
|
|
|
<strong>archtika</strong>
|
2024-07-31 10:29:46 +02:00
|
|
|
{#if data.user}
|
2024-08-01 18:09:35 +02:00
|
|
|
<a href="/">Dashboard</a>
|
2024-07-31 10:29:46 +02:00
|
|
|
<a href="/account">Account</a>
|
|
|
|
|
{:else}
|
|
|
|
|
<a href="/register">Register</a>
|
|
|
|
|
<a href="/login">Login</a>
|
|
|
|
|
{/if}
|
|
|
|
|
</nav>
|
|
|
|
|
|
2024-08-01 18:09:35 +02:00
|
|
|
{#if !isProjectRoute}
|
|
|
|
|
<header>
|
2024-08-02 15:33:18 +02:00
|
|
|
<h1>{routeName}</h1>
|
2024-08-01 18:09:35 +02:00
|
|
|
</header>
|
|
|
|
|
{/if}
|
2024-07-31 10:29:46 +02:00
|
|
|
|
2024-08-01 18:09:35 +02:00
|
|
|
<main class:editor={isProjectRoute}>
|
2024-07-31 10:29:46 +02:00
|
|
|
{@render children()}
|
|
|
|
|
</main>
|
|
|
|
|
|
|
|
|
|
<footer>
|
|
|
|
|
<p>
|
2024-08-01 18:09:35 +02:00
|
|
|
<small>archtika is a free, open, modern, performant and lightweight CMS</small>
|
2024-07-31 10:29:46 +02:00
|
|
|
</p>
|
|
|
|
|
</footer>
|
2024-08-01 18:09:35 +02:00
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
nav,
|
|
|
|
|
header,
|
|
|
|
|
main,
|
|
|
|
|
footer {
|
|
|
|
|
padding-block: 1rem;
|
|
|
|
|
inline-size: min(100% - 2rem, 1024px);
|
|
|
|
|
margin-inline: auto;
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-02 15:33:18 +02:00
|
|
|
nav {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nav > *:first-child {
|
|
|
|
|
margin-inline-end: auto;
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-01 18:09:35 +02:00
|
|
|
footer {
|
|
|
|
|
text-align: center;
|
2024-08-02 15:33:18 +02:00
|
|
|
margin-block-start: auto;
|
2024-08-01 18:09:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.editor {
|
|
|
|
|
inline-size: min(100% - 2rem, 1536px);
|
|
|
|
|
block-size: calc(100vh - 7rem);
|
2024-08-03 13:49:41 +02:00
|
|
|
border-block-start: var(--border-primary);
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: 1fr 1fr;
|
2024-08-01 18:09:35 +02:00
|
|
|
padding-block: 0;
|
|
|
|
|
}
|
|
|
|
|
</style>
|