Skip to content

A self-hosted media server and file management system

feat: lyric fading effects

aminnausin742c1c671571
diff --git a/resources/js/components/video/VideoLyrics.vue b/resources/js/components/video/VideoLyrics.vue
index fb27ca11..eeaea429 100644
--- a/resources/js/components/video/VideoLyrics.vue
+++ b/resources/js/components/video/VideoLyrics.vue
@@ -78,7 +78,7 @@ const handleUpdate = () => {
if (index < 0) return;
const current = lyrics.value[index];
- if (!current || !current.time) return;
+ if (!current || !current.time || (current.time === activeTime.value && isActiveLyricVisible.value)) return;
activeTime.value = current.time;
@@ -145,12 +145,12 @@ watch(() => props.isPaused, handleUpdate);
watch(() => props.rawLyrics, resetComponent);
</script>
<template>
- <section class="relative flex flex-col h-full w-full my-auto overflow-y-scroll scrollbar-hide" ref="lyrics-container" v-show="lyrics.length > 0">
+ <section class="relative flex flex-col h-full w-full overflow-y-scroll scrollbar-hide text-lg text-center" ref="lyrics-container" v-show="lyrics.length > 0">
<div class="shrink-0" style="height: 45%"></div>
<div
v-for="(lyric, index) in lyrics"
@click="handleClick(`lyric-${lyric?.time ?? index}`, lyric?.time ?? NaN)"
- :class="`hover:bg-neutral-800/20 ${lyric?.time === activeTime || index === activeTime ? 'bg-neutral-800/40' : ''} w-full drop-shadow-lg text-center text-lg pointer-events-auto cursor-pointer`"
+ :class="`hover:bg-neutral-800/30 ${lyric?.time === activeTime || index === activeTime ? 'bg-neutral-800/40 text-yellow-400 opacity-100 duration-300' : 'opacity-85'} transition-all ease-in w-full pointer-events-auto cursor-pointer`"
:id="`lyric-${lyric?.time ?? index}`"
:title="`${lyric.time}`"
>
diff --git a/resources/js/components/video/VideoPlayer.vue b/resources/js/components/video/VideoPlayer.vue
index 7234c15d..702c16e6 100755
--- a/resources/js/components/video/VideoPlayer.vue
+++ b/resources/js/components/video/VideoPlayer.vue
@@ -1361,7 +1361,11 @@ defineExpose({
leave-active-class="transition ease-in duration-300"
leave-from-class="opacity-100"
leave-to-class="opacity-0"
- ><div :class="`absolute w-full h-full top-0 flex transition-all backdrop-blur-sm`" style="z-index: 3" v-show="isLyricsEnabled"></div>
+ ><div :class="`absolute w-full h-full top-0 transition-all backdrop-blur-sm `" style="z-index: 3" v-show="isLyricsEnabled">
+ <section v-if="isAudio && !stateVideo.metadata?.lyrics" class="bg-neutral-600/20 w-full h-full flex items-center justify-center">
+ <p class="w-full text-center pointer-events-auto hover:bg-neutral-800/20">No lyrics yet...</p>
+ </section>
+ </div>
</Transition>
</section>
<!-- Is a blurred copy of the thumbnail or poster as a backdrop to the clear poster -->