mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update audio animation
This commit is contained in:
parent
7dd1eedf26
commit
0a96f8e0bf
6 changed files with 22 additions and 13 deletions
|
@ -70,7 +70,6 @@
|
|||
return html;
|
||||
}
|
||||
|
||||
var isSlidUp;
|
||||
var height;
|
||||
|
||||
function getHeight(elem) {
|
||||
|
@ -85,35 +84,42 @@
|
|||
|
||||
function slideDown(elem) {
|
||||
|
||||
if (!isSlidUp) {
|
||||
if (elem.classList.contains('hide')) {
|
||||
return;
|
||||
}
|
||||
|
||||
isSlidUp = false;
|
||||
var onfinish = function() {
|
||||
elem.classList.add('hide');
|
||||
};
|
||||
|
||||
if (!browserInfo.animate) {
|
||||
onfinish();
|
||||
return;
|
||||
}
|
||||
|
||||
requestAnimationFrame(function () {
|
||||
var keyframes = [
|
||||
{ height: getHeight(elem), offset: 0 },
|
||||
{ height: '0', display: 'none', offset: 1 }];
|
||||
var timing = { duration: 200, iterations: 1, fill: 'both', easing: 'ease-out' };
|
||||
elem.animate(keyframes, timing).onfinish = function () {
|
||||
elem.classList.add('hide');
|
||||
};
|
||||
elem.animate(keyframes, timing).onfinish = onfinish;
|
||||
});
|
||||
}
|
||||
|
||||
function slideUp(elem) {
|
||||
|
||||
if (isSlidUp) {
|
||||
if (!elem.classList.contains('hide')) {
|
||||
return;
|
||||
}
|
||||
|
||||
isSlidUp = true;
|
||||
elem.classList.remove('hide');
|
||||
|
||||
if (!browserInfo.animate) {
|
||||
return;
|
||||
}
|
||||
|
||||
requestAnimationFrame(function () {
|
||||
|
||||
elem.classList.remove('hide');
|
||||
|
||||
var keyframes = [
|
||||
{ height: '0', offset: 0 },
|
||||
{ height: getHeight(elem), offset: 1 }];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue