diff --git a/package.json b/package.json index 56087c2..d77c53b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aquavox", - "version": "1.13.0", + "version": "1.14.0", "private": false, "scripts": { "dev": "vite dev", diff --git a/src/lib/components/interactiveBox.svelte b/src/lib/components/interactiveBox.svelte index 1d55162..4678d8f 100644 --- a/src/lib/components/interactiveBox.svelte +++ b/src/lib/components/interactiveBox.svelte @@ -24,7 +24,6 @@ let isInfoTopOverflowing = false; let songInfoTopContainer: HTMLDivElement; let songInfoTopContent: HTMLSpanElement; - let lastTouchProgress: number; let userAdjustingVolume = false; const mql = window.matchMedia('(max-width: 1280px)'); diff --git a/src/lib/components/lyrics.svelte b/src/lib/components/lyrics.svelte index 34779a3..9050731 100644 --- a/src/lib/components/lyrics.svelte +++ b/src/lib/components/lyrics.svelte @@ -11,6 +11,7 @@ export let lyrics: string[]; export let originalLyrics: LrcJsonData; export let progress: number; + export let player: HTMLAudioElement | null; // Local state and variables let getLyricIndex: Function; @@ -289,6 +290,12 @@ } }); + function lyricClick(lyricIndex: number) { + if (player===null || originalLyrics.scripts === undefined) return; + player.currentTime = originalLyrics.scripts[lyricIndex].start; + player.play() + } + @@ -317,7 +324,7 @@ on:scroll={scrollHandler} > {#each lyrics as lyric, i} -
+
{lyricClick(i)}}> {#if debugMode && refs[i] && refs[i].style !== undefined} {i}   {originalLyrics.scripts[i].start} ~ {originalLyrics.scripts[i].end} @@ -325,7 +332,7 @@ top: {Math.round(refs[i].getBoundingClientRect().top)}px {/if} -

+

{lyric}

{#if originalLyrics.scripts[i].translation && showTranslation} @@ -397,26 +404,6 @@ top: 1rem; } - @media (min-width: 768px) { - .current-lyric { - font-size: 3rem; - line-height: 4rem; - margin: 2.4rem 0; - } - - .after-lyric { - font-size: 3rem; - line-height: 3.3rem; - margin: 2.4rem 0; - } - - .previous-lyric { - font-size: 3em; - line-height: 3.3rem; - margin: 2.4rem 0; - } - } - @media (min-width: 1024px) { .current-lyric { font-size: var(--lyric-desktop-font-size); diff --git a/src/routes/play/[id]/+page.svelte b/src/routes/play/[id]/+page.svelte index 5d6f7f9..b7558eb 100644 --- a/src/routes/play/[id]/+page.svelte +++ b/src/routes/play/[id]/+page.svelte @@ -202,14 +202,23 @@ {hasLyrics} /> - +