Files
frontend-svelte/src/app/ui/Layout.svelte
T

88 lines
2.6 KiB
Svelte
Raw Normal View History

<!--
Component: Layout
Application shell with providers and page wrapper
-->
<script lang="ts">
import { themeManager } from '$features/ChangeAppTheme';
2026-04-22 13:00:29 +03:00
import G from '$shared/assets/G.svg';
import { ResponsiveProvider } from '$shared/lib';
2026-04-23 09:48:32 +03:00
import { cn } from '$shared/lib';
2026-04-22 13:01:46 +03:00
import { Footer } from '$widgets/Footer';
import {
type Snippet,
2026-02-27 12:23:31 +03:00
onDestroy,
onMount,
} from 'svelte';
2026-01-24 15:32:01 +03:00
interface Props {
/**
* Content snippet
*/
2026-01-24 15:32:01 +03:00
children: Snippet;
}
2026-01-24 15:32:01 +03:00
let { children }: Props = $props();
let fontsReady = $state(true);
2026-02-27 12:23:31 +03:00
const theme = $derived(themeManager.value);
2026-02-27 12:23:31 +03:00
onMount(() => themeManager.init());
onDestroy(() => themeManager.destroy());
</script>
<svelte:head>
2026-04-22 13:00:29 +03:00
<link rel="icon" href={G} type="image/svg+xml" />
<link rel="preconnect" href="https://api.fontshare.com" />
<link
rel="preconnect"
href="https://cdn.fontshare.com"
crossorigin="anonymous"
/>
2026-01-22 15:31:59 +03:00
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin="anonymous"
/>
2026-01-22 15:31:59 +03:00
<link
rel="preload"
as="style"
href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Space+Grotesk:wght@300..700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&family=Syne:wght@800&display=swap"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Space+Grotesk:wght@300..700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&family=Syne:wght@800&display=swap"
media="print"
onload={(e => ((e.currentTarget as HTMLLinkElement).media = 'all'))}
/>
<noscript>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Space+Grotesk:wght@300..700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&family=Syne:wght@800&display=swap"
/>
</noscript>
<title>GlyphDiff | Typography & Typefaces</title>
2026-04-19 19:15:46 +03:00
<meta
name="description"
content="Compare typefaces side by side. Adjust size, weight, leading, and tracking to find the perfect typographic pairing."
/>
</svelte:head>
<ResponsiveProvider>
2026-02-27 12:23:31 +03:00
<div
id="app-root"
2026-04-23 09:48:32 +03:00
class={cn(
'min-h-dvh w-auto flex flex-col bg-surface dark:bg-dark-bg relative',
2026-02-27 12:23:31 +03:00
theme === 'dark' ? 'dark' : '',
)}
>
2026-04-17 13:20:01 +03:00
{#if fontsReady}
{@render children?.()}
{/if}
2026-04-22 13:01:46 +03:00
<Footer />
</div>
</ResponsiveProvider>