feat: multi-purpose site

feat: editor
feat: plugin editor
This commit is contained in:
2024-08-01 01:31:04 +02:00
parent b8b903c5e1
commit 8b2bfee099
15 changed files with 262 additions and 64 deletions

View File

@@ -0,0 +1,60 @@
<script lang="ts">
import { page } from "$app/stores";
import LL from "$i18n/i18n-svelte";
import type { Snippet } from "svelte";
let { children }: { children?: Snippet } = $props();
let paths = $derived([
{
href: "/config/chords/",
title: $LL.configure.chords.TITLE(),
icon: "piano",
},
{
href: "/config/layout/",
title: $LL.configure.layout.TITLE(),
icon: "keyboard",
},
{
href: "/config/settings/",
title: $LL.configure.settings.TITLE(),
icon: "settings",
},
]);
</script>
<nav>
{#each paths as { href, title, icon }}
<a {href} class:active={$page.url.pathname.startsWith(href)}>
<span class="icon">{icon}</span>
{title}
</a>
{/each}
</nav>
{#if children}
{@render children()}
{/if}
<style lang="scss">
nav {
display: flex;
gap: 8px;
padding: 8px;
color: var(--md-sys-color-on-surface-variant);
background: var(--md-sys-color-surface-variant);
border: none;
border-radius: 32px;
}
a.active {
--icon-fill: 1;
color: var(--md-sys-color-on-primary);
background: var(--md-sys-color-primary);
}
</style>