Files
web-app/src/App.svelte

58 lines
1.1 KiB
Svelte
Raw Normal View History

2026-08-15 05:27:48 +03:00
<script>
2026-09-08 17:38:13 +03:00
import MainMenu from '$lib/pages/main/MainMenu.svelte';
import PrintMenu from '$lib/pages/print/PrintMenu.svelte';
/** @type {'main' | 'print'} */
let page = $state('main');
/** @param {'print' | 'scan' | 'photo' | 'access'} id */
function handleAction(id) {
if (id === 'print') {
page = 'print';
} else {
console.log('Выбрано действие:', id);
}
}
function handleBack() {
page = 'main';
}
2026-08-15 05:27:48 +03:00
</script>
<style>
2026-09-08 17:38:13 +03:00
:global(html),
:global(body) {
margin: 0;
padding: 0;
background: #0b0d11;
}
:global(body) {
display: block;
place-items: initial;
min-width: 0;
color: #f5f7fa;
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
}
.app-wrapper {
display: flex;
justify-content: center;
}
@media (max-width: 480px) {
.app-wrapper {
justify-content: center;
}
}
</style>
2026-08-15 05:27:48 +03:00
<main class="app-wrapper">
2026-09-08 17:38:13 +03:00
{#if page === 'main'}
<MainMenu onAction={handleAction} />
{:else if page === 'print'}
<PrintMenu onBack={handleBack} />
{/if}
</main>