Add Svelte web client and service worker
Mobile-first PWA: groups via key-in-fragment links, encrypted outbox and sync over SSE, all split modes, currencies with ECB rate prefill, photos, comments, history and rewind, stats, recurring expenses, CSV and backup, EN/CS, dark/light theme, Web Push decrypted in the service worker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
This commit is contained in:
parent
f67add3660
commit
8fbbb4933e
53 changed files with 4558 additions and 37 deletions
32
apps/web/src/components/Sheet.svelte
Normal file
32
apps/web/src/components/Sheet.svelte
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<script lang="ts">
|
||||
// Modal sheet: full screen on phones, a centered dialog on desktop.
|
||||
// Uses <dialog> for focus trapping and Escape handling.
|
||||
import type { Snippet } from 'svelte';
|
||||
import Icon from './Icon.svelte';
|
||||
import { t } from '../lib/settings.svelte.ts';
|
||||
|
||||
let { title, onclose, children, actions }: { title: string; onclose: () => void; children: Snippet; actions?: Snippet } = $props();
|
||||
let dialog: HTMLDialogElement;
|
||||
|
||||
$effect(() => {
|
||||
dialog.showModal();
|
||||
return () => dialog.close();
|
||||
});
|
||||
</script>
|
||||
|
||||
<dialog
|
||||
class="sheet"
|
||||
bind:this={dialog}
|
||||
aria-label={title}
|
||||
oncancel={(e) => { e.preventDefault(); onclose(); }}
|
||||
onclick={(e) => { if (e.target === dialog) onclose(); }}
|
||||
>
|
||||
<header class="topbar">
|
||||
<button class="icon-btn" onclick={onclose} aria-label={t('close')}><Icon name="close" /></button>
|
||||
<h1>{title}</h1>
|
||||
{@render actions?.()}
|
||||
</header>
|
||||
<div class="sheet-body">
|
||||
{@render children()}
|
||||
</div>
|
||||
</dialog>
|
||||
Loading…
Add table
Add a link
Reference in a new issue