more fluent animation

This commit is contained in:
DIYgod
2015-12-07 21:54:34 +08:00
parent 6ac27552bd
commit cc9362ef9e
6 changed files with 11 additions and 20 deletions
+2 -2
View File
@@ -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');
}
-1
View File
@@ -348,7 +348,6 @@ $aplayer-height-lrc: $aplayer-height + $lrc-height;
}
.aplayer-lrc-contents {
position: absolute;
width: 100%;
transition: all 0.5s ease-out;
}