From ba605402ceca426b9b3fbc8aa527cd401561eb3f Mon Sep 17 00:00:00 2001 From: Iu Date: Sat, 10 Oct 2026 18:28:56 +0300 Subject: [PATCH] feat(frontend): fullscreen toggle and album back button - add fullscreen/fullscreen_exit icons and a top-bar toggle (right of themes) - add back arrow left of the album title to return to the albums overview --- frontend/src/lib/components/AppShell.svelte | 26 +++++++++++++++++++ frontend/src/lib/icons/registry.ts | 4 ++- .../src/routes/(app)/albums/[id]/+page.svelte | 12 ++++++++- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/AppShell.svelte b/frontend/src/lib/components/AppShell.svelte index 795d5a6..9e27984 100644 --- a/frontend/src/lib/components/AppShell.svelte +++ b/frontend/src/lib/components/AppShell.svelte @@ -24,13 +24,29 @@ let railWidth = $state(RAIL.def); let panelWidth = $state(PANEL.def); + let isFullscreen = $state(false); + onMount(() => { const r = parseInt(localStorage.getItem(RAIL.key) ?? '', 10); if (r >= RAIL.min && r <= RAIL.max) railWidth = r; const p = parseInt(localStorage.getItem(PANEL.key) ?? '', 10); if (p >= PANEL.min && p <= PANEL.max) panelWidth = p; + + const onFs = () => (isFullscreen = !!document.fullscreenElement); + document.addEventListener('fullscreenchange', onFs); + onFs(); + return () => document.removeEventListener('fullscreenchange', onFs); }); + async function toggleFullscreen() { + try { + if (document.fullscreenElement) await document.exitFullscreen(); + else await document.documentElement.requestFullscreen(); + } catch { + /* недоступно */ + } + } + function startResize(side: 'left' | 'right', ev: PointerEvent) { ev.preventDefault(); const cfg = side === 'left' ? RAIL : PANEL; @@ -134,6 +150,16 @@ {/if} + diff --git a/frontend/src/lib/icons/registry.ts b/frontend/src/lib/icons/registry.ts index 1b2e84e..035c0fb 100644 --- a/frontend/src/lib/icons/registry.ts +++ b/frontend/src/lib/icons/registry.ts @@ -43,7 +43,9 @@ export const icons = { check: { path: '' }, menu: { path: '' }, grid_view: { path: '' }, - wallpaper: { path: '' } + wallpaper: { path: '' }, + fullscreen: { path: '' }, + fullscreen_exit: { path: '' } } satisfies Record; export type IconName = keyof typeof icons; diff --git a/frontend/src/routes/(app)/albums/[id]/+page.svelte b/frontend/src/routes/(app)/albums/[id]/+page.svelte index 8d1d3c5..4b4d884 100644 --- a/frontend/src/routes/(app)/albums/[id]/+page.svelte +++ b/frontend/src/routes/(app)/albums/[id]/+page.svelte @@ -155,7 +155,17 @@
-

{album?.title ?? ''}

+
+ + + +

{album?.title ?? ''}

+
{#if canUpload}