Files
web-app/src/App.svelte

67 lines
1.3 KiB
Svelte
Raw Normal View History

2026-08-15 05:27:48 +03:00
<script>
import MainMenu from './lib/MainMenu.svelte';
import PrintMenu from './lib/PrintMenu.svelte';
/** @type {'main' | 'print'} */
let page = 'main';
/** @param {'print' | 'scan' | 'photo' | 'access'} id */
function handleAction(id) {
if (id === 'print') {
page = 'print';
} else {
console.log('Выбрано действие:', id);
}
}
function handleBack() {
page = 'main';
}
function handlePrint() {
console.log('Печать с настройками...');
}
function handleLoadPreview() {
console.log('Загрузка файла для предпросмотра...');
}
2026-08-15 05:27:48 +03:00
</script>
<style>
: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;
}
2026-08-15 05:27:48 +03:00
.app-wrapper {
display: flex;
justify-content: center;
}
2026-08-15 05:27:48 +03:00
@media (max-width: 480px) {
.app-wrapper {
justify-content: center;
}
}
</style>
2026-08-15 05:27:48 +03:00
<main class="app-wrapper">
{#if page === 'main'}
<MainMenu onAction={handleAction} />
{/if}
{#if page === 'print'}
<PrintMenu onBack={handleBack} onPrint={handlePrint} />
{/if}
</main>