fix: overflow on mobile

This commit is contained in:
alikia2x (寒寒) 2024-11-24 05:19:00 +08:00
parent e573c70497
commit e60baa0358
Signed by: alikia2x
GPG Key ID: 56209E0CCD8420C6
4 changed files with 15 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "aquavox",
"version": "2.9.4",
"version": "2.9.5",
"private": false,
"module": "index.ts",
"type": "module",

View File

@ -151,7 +151,7 @@
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class={"absolute w-full h-2/3 bottom-0" + (showInteractiveBox ? '' : '-translate-y-48')}
<div class={"absolute w-full h-3/4 bottom-0" + (showInteractiveBox ? '' : '-translate-y-48')}
style={`z-index: ${showInteractiveBox ? "0" : "50"}`}
on:click={handleClick}
></div>

View File

@ -12,7 +12,7 @@
const blurRatio = viewportWidth > 640 ? 1 : 1.4;
const currentLyricTop = viewportWidth > 640 ? viewportHeight * 0.12 : viewportHeight * 0.05;
const deceleration = 0.95; // Velocity decay factor for inertia
const minVelocity = 0.1; // Minimum velocity to stop inertia
const minVelocity = 0.001; // Minimum velocity to stop inertia
document.body.style.overflow = 'hidden';
// Props
@ -37,6 +37,7 @@
let lastTime: number = $state(0); // For tracking time between touch moves
let velocityY = $state(0); // Vertical scroll velocity
let inertiaFrame: number = $state(0); // For storing the requestAnimationFrame reference
let inertiaFrameCount: number = $state(0);
// References to lyric elements
let lyricElements: HTMLDivElement[] = $state([]);
@ -122,7 +123,7 @@
if (scrollingTimeout) clearTimeout(scrollingTimeout);
scrollingTimeout = setTimeout(() => {
scrolling = false;
}, 5000);
}, 2000);
}
// Handle the touch start event

View File

@ -0,0 +1,10 @@
<script>
import '../../../app.css';
</script>
<div
class="h-fit min-h-screen w-screen max-w-[100vw] overflow-hidden
bg-zinc-50 dark:bg-[#1f1f1f] text-black dark:text-white relative z-0" style="font-family: 'Barlow', sans-serif;"
>
<slot />
</div>