33 <div
44 :key =" amLyricsData?.[0]?.words?.length"
55 :class =" ['lyric-am', { pure: statusStore.pureLyricMode }]"
6+ :style =" {
7+ '--amll-lp-color': 'rgb(var(--main-cover-color))',
8+ }"
69 >
710 <div v-if =" statusStore.lyricLoading" class =" lyric-loading" >歌词正在加载中...</div >
811 <LyricPlayer
1518 :enableScale =" settingStore.useAMSpring"
1619 :alignPosition =" settingStore.lyricsScrollPosition === 'center' ? 0.5 : 0.2"
1720 :enableBlur =" settingStore.lyricsBlur"
21+ :hidePassedLines =" settingStore.hidePassedLines"
22+ :wordFadeWidth =" settingStore.wordFadeWidth"
1823 :style =" {
19- '--amll-lyric-view-color': 'rgb(var(--main-cover-color))',
20- '--amll-lyric-player-font-size': settingStore.lyricFontSize + 'px',
24+ '--amll-lp-font-size': settingStore.lyricFontSize + 'px',
2125 '--ja-font-family':
2226 settingStore.japaneseLyricFont !== 'follow' ? settingStore.japaneseLyricFont : '',
2327 '--en-font-family':
3842
3943<script setup lang="ts">
4044import { LyricPlayer } from " @applemusic-like-lyrics/vue" ;
41- import { type LyricLine } from " @applemusic-like-lyrics/lyric " ;
45+ import { type LyricLine } from " @applemusic-like-lyrics/core " ;
4246import { useMusicStore , useSettingStore , useStatusStore } from " @/stores" ;
4347import { getLyricLanguage } from " @/utils/format" ;
4448import { usePlayerController } from " @/core/player/PlayerController" ;
49+ import " @applemusic-like-lyrics/core/style.css" ;
50+ import { cloneDeep } from " lodash-es" ;
4551
4652const musicStore = useMusicStore ();
4753const statusStore = useStatusStore ();
@@ -61,7 +67,7 @@ const { pause: pauseSeek, resume: resumeSeek } = useRafFn(() => {
6167});
6268
6369// 当前歌词
64- const amLyricsData = computed < LyricLine []> (() => {
70+ const amLyricsData = computed (() => {
6571 const { songLyric } = musicStore ;
6672 if (! songLyric ) return [];
6773
@@ -72,7 +78,7 @@ const amLyricsData = computed<LyricLine[]>(() => {
7278 // 简单检查歌词有效性
7379 if (! Array .isArray (lyrics ) || lyrics .length === 0 ) return [];
7480
75- return lyrics ;
81+ return cloneDeep ( lyrics ) as LyricLine [] ;
7682});
7783
7884// 进度跳转
@@ -86,12 +92,12 @@ const jumpSeek = (line: any) => {
8692
8793// 处理歌词语言
8894const processLyricLanguage = (player = lyricPlayerRef .value ) => {
89- const lyricLinesEl = player ?.lyricPlayer ?.lyricLinesEl ;
90- if (! lyricLinesEl || lyricLinesEl .length === 0 ) {
95+ const lyricLineObjects = player ?.lyricPlayer ?.currentLyricLineObjects ;
96+ if (! Array . isArray ( lyricLineObjects ) || lyricLineObjects .length === 0 ) {
9197 return ;
9298 }
9399 // 遍历歌词行
94- for (let e of lyricLinesEl ) {
100+ for (let e of lyricLineObjects ) {
95101 // 获取歌词行内容 (合并逐字歌词为一句)
96102 const content = e .lyricLine .words .map ((word : any ) => word .word ).join (" " );
97103 // 获取歌词语言
@@ -177,7 +183,7 @@ onBeforeUnmount(() => {
177183 display : flex ;
178184 align-items : center ;
179185 justify-content : center ;
180- color : var (--amll-lyric-view -color , #efefef );
186+ color : var (--amll-lp -color , #efefef );
181187 font-size : 22px ;
182188}
183189 </style >
0 commit comments