diff --git a/materialious/src/lib/components/Toast.svelte b/materialious/src/lib/components/Toast.svelte index 227e4931..c1c984a6 100644 --- a/materialious/src/lib/components/Toast.svelte +++ b/materialious/src/lib/components/Toast.svelte @@ -62,6 +62,10 @@ padding: 0; } + [data-melt-toaster-root]:empty { + display: none; + } + [data-melt-toaster-toast-content]:nth-last-child(n + 4) { z-index: 1; scale: 0.925; diff --git a/materialious/src/lib/css/global.css b/materialious/src/lib/css/global.css index b4e9ee3c..01a0dcb7 100644 --- a/materialious/src/lib/css/global.css +++ b/materialious/src/lib/css/global.css @@ -4,6 +4,7 @@ :root { --video-player-height: 0px; + --safe-area-inset-top: 0px; } @font-face { @@ -11,6 +12,19 @@ src: url('/inter.ttf'); } +html, +body { + height: 100%; + margin: 0; + overflow: hidden; +} + +:has(>main) { + height: 100%; + min-height: 0; + overflow: hidden; +} + .hide { display: none; } @@ -58,9 +72,10 @@ dialog { } main.root { - max-height: 100vh; + min-height: 0; overflow-y: auto; overflow-x: hidden; + overscroll-behavior: contain; } .row { diff --git a/materialious/src/routes/(app)/+layout.svelte b/materialious/src/routes/(app)/+layout.svelte index 4781a52b..b8381df1 100644 --- a/materialious/src/routes/(app)/+layout.svelte +++ b/materialious/src/routes/(app)/+layout.svelte @@ -61,8 +61,13 @@ page.subscribe((pageData) => { playerIsPip = !pageData.url.pathname.includes('/watch'); + requestAnimationFrame(() => resetScroll()); }); + playerState.subscribe((player) => { + requestAnimationFrame(() => resetScroll()); + }) + interfaceAmoledTheme.subscribe(async () => { setAmoledTheme(); @@ -194,6 +199,13 @@ await ui('theme', hex); }); + function resetScroll() { + const main = document.querySelector('main.root'); + if (main) main.scrollTop = 0; + document.documentElement.scrollTop = 0; + document.body.scrollTop = 0; + } + onMount(async () => { ui(); @@ -233,6 +245,7 @@ if (isLoggedIn) { loadNotifications().catch(() => authStore.set(null)); } + resetScroll(); }); let webManifestLink = $derived(pwaInfo ? pwaInfo.webManifest.linkTag : '');