Added non synced text

This commit is contained in:
lucast committed 2026-03-07 19:49:06 +01:00
1 parent ab22cd6eb9
commit d5482a9ea4
2 files changed
+41 -5

No files matched your search

+5 -1
View File
@@ -54,7 +54,11 @@ onMounted(() => {
<PlayerFullscreenTrackDisplay <PlayerFullscreenTrackDisplay
:show-buttons="mouseMovedRecently" :show-buttons="mouseMovedRecently"
/> />
<LyricsDisplay :animation-duration="0.2" :offset="150" /> <LyricsDisplay
:animation-duration="0.2"
:offset="150"
:show-scroll-bar="mouseMovedRecently"
/>
</div> </div>
</section> </section>
</section> </section>
@@ -1,7 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
const { animationDuration, offset } = defineProps<{ const { animationDuration, offset, showScrollBar } = defineProps<{
animationDuration: number animationDuration: number
offset: number offset: number
showScrollBar: boolean
}>() }>()
const song = useSong() const song = useSong()
@@ -46,7 +47,7 @@ const scrollActiveIndex = computed(() => {
const height = ref(0) const height = ref(0)
watch(parsedLyrics, () => { watch(song, () => {
const trackDisplay = document.querySelector(".track-display") const trackDisplay = document.querySelector(".track-display")
if (!trackDisplay) return if (!trackDisplay) return
@@ -139,13 +140,21 @@ const finalTransform = computed(() => {
</p> </p>
</div> </div>
</div> </div>
<template v-else-if="song"> <div
v-else-if="song"
class="lyrics"
:style="{
height: `${height}px`,
}"
:class="{ show: showScrollBar }"
>
<p>{{ song.lyrics.text }}</p> <p>{{ song.lyrics.text }}</p>
</template> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
@use "@/styles/util" as *; @use "@/styles/util" as *;
@use "@/styles/variables" as *;
.synced-lyrics-container { .synced-lyrics-container {
position: relative; position: relative;
@@ -191,4 +200,27 @@ const finalTransform = computed(() => {
} }
} }
} }
.lyrics {
overflow: hidden;
& > p {
height: 100%;
overflow-y: scroll;
white-space: pre-wrap;
&::-webkit-scrollbar {
width: 10px;
}
&::-webkit-scrollbar-thumb {
background-color: transparent;
border-radius: 5px;
}
}
&.show > p::-webkit-scrollbar-thumb {
background-color: $color-secondary-background;
}
}
</style> </style>