-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path+layout.svelte
64 lines (56 loc) · 1.21 KB
/
+layout.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<script lang="ts">
import '@ryanatkn/moss/style.css';
import '@ryanatkn/moss/theme.css';
import '$routes/moss.css';
import '$routes/style.css';
import Themed from '@ryanatkn/fuz/Themed.svelte';
import Dialog from '@ryanatkn/fuz/Dialog.svelte';
import Contextmenu_Root from '@ryanatkn/fuz/Contextmenu_Root.svelte';
import {contextmenu_action} from '@ryanatkn/fuz/contextmenu_state.svelte.js';
import type {Snippet} from 'svelte';
import Settings from '$routes/Settings.svelte';
interface Props {
children: Snippet;
}
const {children}: Props = $props();
let show_settings = $state(false);
</script>
<svelte:head>
<title>@ryanatkn/fuz_template</title>
</svelte:head>
<svelte:body
use:contextmenu_action={[
{
snippet: 'text',
props: {
content: 'Settings',
icon: '?',
run: () => {
show_settings = true;
},
},
},
{
snippet: 'text',
props: {
content: 'Reload',
icon: '⟳',
run: () => {
location.reload();
},
},
},
]}
/>
<Themed>
<Contextmenu_Root>
{@render children()}
{#if show_settings}
<Dialog onclose={() => (show_settings = false)}>
<div class="pane">
<Settings />
</div>
</Dialog>
{/if}
</Contextmenu_Root>
</Themed>