more fluent animation
This commit is contained in:
+2
-2
@@ -68,7 +68,7 @@ APlayer.prototype.init = function () {
|
||||
+ '<span class="aplayer-author"> - (>﹏<)加载中,好累的说...</span>'
|
||||
+ '</div>'
|
||||
+ '<div class="aplayer-lrc">'
|
||||
+ '<div class="aplayer-lrc-contents" style="top: 0"></div>'
|
||||
+ '<div class="aplayer-lrc-contents" style="transform: translateY(0);"></div>'
|
||||
+ '</div>'
|
||||
+ '<div class="aplayer-controller">'
|
||||
+ '<div class="aplayer-bar-wrap">'
|
||||
@@ -299,7 +299,7 @@ APlayer.prototype.updateLrc = function (currentTime) {
|
||||
for (var i = 0; i < this.lrcTime.length; i++) {
|
||||
if (currentTime >= this.lrcTime[i] && (!this.lrcTime[i + 1] || currentTime < this.lrcTime[i + 1])) {
|
||||
this.lrcIndex = i;
|
||||
this.lrcContents.style.top = -this.lrcIndex * 20 + 'px';
|
||||
this.lrcContents.style.transform = 'translateY(' + -this.lrcIndex * 20 + 'px)';
|
||||
this.lrcContents.getElementsByClassName('aplayer-lrc-current')[0].classList.remove('aplayer-lrc-current');
|
||||
this.lrcContents.getElementsByTagName('p')[i].classList.add('aplayer-lrc-current');
|
||||
}
|
||||
|
||||
@@ -348,7 +348,6 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
|
||||
}
|
||||
|
||||
.aplayer-lrc-contents {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
transition: all 0.5s ease-out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user