@@ -106,9 +105,11 @@ export default {
is_play: false,
},
lyricsTexts: [],
+ lyricsFullTexts: [],
isPlay: false,
isLoop: false,
isMove: false,
+ isFullLyrics: false,
lastPageX: 0,
pageX: 0,
audio: new Audio(),
@@ -137,22 +138,25 @@ export default {
let lrcObj = this.createLrcObj(gaobaiqiqiu);
this.lyricsTexts.push(lrcObj.ms[0])
this.lyricsTexts.push(lrcObj.ms[1])
+ lrcObj.ms.map(v => {
+ if (v.c) this.lyricsFullTexts.push(v)
+ })
console.log(lrcObj.ms)
this.audio.addEventListener('timeupdate', e => {
let currentTime = Math.ceil(e.target.currentTime)
- let lastLyricsText = this.lyricsTexts[this.lyricsTexts.length - 1]
- if (Number(lastLyricsText.t) < currentTime) {
- for (let i = 0; i < lrcObj.ms.length; i++) {
- let item = lrcObj.ms[i]
- if (Number(item.t) > currentTime) {
- if (item.c) {
- console.log(item)
- this.t(item)
- break
- }
- }
- }
- }
+ // let lastLyricsText = this.lyricsTexts[this.lyricsTexts.length - 1]
+ // if (Number(lastLyricsText.t) < currentTime) {
+ // for (let i = 0; i < lrcObj.ms.length; i++) {
+ // let item = lrcObj.ms[i]
+ // if (Number(item.t) > currentTime) {
+ // if (item.c) {
+ // console.log(item)
+ // this.t(item)
+ // break
+ // }
+ // }
+ // }
+ // }
if (!this.isMove) {
this.currentTime = currentTime
if (Math.ceil(e.target.currentTime) * this.step > this.slideBarWidth - 5) {
@@ -334,8 +338,17 @@ export default {
}
.lyrics-full {
+ width: 100vw;
+ height: 60vh;
+ display: flex;
+ //align-items: center;
+ justify-content: center;
+ overflow: hidden;
+
.list {
.item {
+ display: flex;
+ justify-content: center;
height: 4rem;
}
}