feat: 优化播放 修改为howler 修复搜索导致播放无限卡顿问题(#15)

- 优化了整个项目的播放
- 去除audio
- 优化歌词页 歌词同步时间

fixes #15
This commit is contained in:
alger
2024-12-12 22:18:52 +08:00
parent bb99049991
commit cebf313075
12 changed files with 199 additions and 182 deletions
+5 -5
View File
@@ -34,7 +34,7 @@
:key="index"
class="music-lrc-text"
:class="{ 'now-text': index === nowIndex, 'hover-text': item.text }"
@click="setAudioTime(index, audio)"
@click="setAudioTime(index)"
>
<span :style="getLrcStyle(index)">{{ item.text }}</span>
<div class="music-lrc-text-tr">{{ item.trText }}</div>
@@ -75,10 +75,6 @@ const props = defineProps({
type: Boolean,
default: false,
},
audio: {
type: HTMLAudioElement,
default: null,
},
background: {
type: String,
default: '',
@@ -260,6 +256,7 @@ defineExpose({
span {
background-clip: text !important;
-webkit-background-clip: text !important;
padding-right: 30px;
}
&-tr {
@@ -291,6 +288,9 @@ defineExpose({
.music-lrc {
height: calc(100vh - 260px) !important;
width: 100vw;
span {
padding-right: 0px !important;
}
}
.music-lrc-text {
text-align: center;