Added non synced text
This commit is contained in:
1 parent
ab22cd6eb9
commit
d5482a9ea4
2 files changed
+41
-5
No files matched your search
@@ -54,7 +54,11 @@ onMounted(() => {
|
||||
<PlayerFullscreenTrackDisplay
|
||||
:show-buttons="mouseMovedRecently"
|
||||
/>
|
||||
<LyricsDisplay :animation-duration="0.2" :offset="150" />
|
||||
<LyricsDisplay
|
||||
:animation-duration="0.2"
|
||||
:offset="150"
|
||||
:show-scroll-bar="mouseMovedRecently"
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
const { animationDuration, offset } = defineProps<{
|
||||
const { animationDuration, offset, showScrollBar } = defineProps<{
|
||||
animationDuration: number
|
||||
offset: number
|
||||
showScrollBar: boolean
|
||||
}>()
|
||||
|
||||
const song = useSong()
|
||||
@@ -46,7 +47,7 @@ const scrollActiveIndex = computed(() => {
|
||||
|
||||
const height = ref(0)
|
||||
|
||||
watch(parsedLyrics, () => {
|
||||
watch(song, () => {
|
||||
const trackDisplay = document.querySelector(".track-display")
|
||||
|
||||
if (!trackDisplay) return
|
||||
@@ -139,13 +140,21 @@ const finalTransform = computed(() => {
|
||||
</p>
|
||||
</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>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@use "@/styles/util" as *;
|
||||
@use "@/styles/variables" as *;
|
||||
|
||||
.synced-lyrics-container {
|
||||
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>
|
||||
Reference in new issue
Block a user