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
|
@ -169,6 +169,7 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nowPlayingBarPositionContainer {
|
.nowPlayingBarPositionContainer {
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
document.body.appendChild(dlg);
|
document.body.appendChild(dlg);
|
||||||
|
|
||||||
// The animations flicker in IE and Firefox (probably wherever the polyfill is used)
|
// The animations flicker in IE and Firefox (probably wherever the polyfill is used)
|
||||||
if (browserInfo.chrome) {
|
if (browserInfo.animate) {
|
||||||
dlg.animationConfig = {
|
dlg.animationConfig = {
|
||||||
// scale up
|
// scale up
|
||||||
'entry': {
|
'entry': {
|
||||||
|
|
|
@ -2794,7 +2794,7 @@
|
||||||
dlg.exitAnimation = 'fade-out-animation';
|
dlg.exitAnimation = 'fade-out-animation';
|
||||||
|
|
||||||
// The animations flicker in IE and Firefox (probably wherever the polyfill is used)
|
// The animations flicker in IE and Firefox (probably wherever the polyfill is used)
|
||||||
if (browserInfo.chrome) {
|
if (browserInfo.animate) {
|
||||||
dlg.animationConfig = {
|
dlg.animationConfig = {
|
||||||
// scale up
|
// scale up
|
||||||
'entry': {
|
'entry': {
|
||||||
|
|
|
@ -70,7 +70,6 @@
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
var isSlidUp;
|
|
||||||
var height;
|
var height;
|
||||||
|
|
||||||
function getHeight(elem) {
|
function getHeight(elem) {
|
||||||
|
@ -85,35 +84,42 @@
|
||||||
|
|
||||||
function slideDown(elem) {
|
function slideDown(elem) {
|
||||||
|
|
||||||
if (!isSlidUp) {
|
if (elem.classList.contains('hide')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
isSlidUp = false;
|
var onfinish = function() {
|
||||||
|
elem.classList.add('hide');
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!browserInfo.animate) {
|
||||||
|
onfinish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
requestAnimationFrame(function () {
|
requestAnimationFrame(function () {
|
||||||
var keyframes = [
|
var keyframes = [
|
||||||
{ height: getHeight(elem), offset: 0 },
|
{ height: getHeight(elem), offset: 0 },
|
||||||
{ height: '0', display: 'none', offset: 1 }];
|
{ height: '0', display: 'none', offset: 1 }];
|
||||||
var timing = { duration: 200, iterations: 1, fill: 'both', easing: 'ease-out' };
|
var timing = { duration: 200, iterations: 1, fill: 'both', easing: 'ease-out' };
|
||||||
elem.animate(keyframes, timing).onfinish = function () {
|
elem.animate(keyframes, timing).onfinish = onfinish;
|
||||||
elem.classList.add('hide');
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function slideUp(elem) {
|
function slideUp(elem) {
|
||||||
|
|
||||||
if (isSlidUp) {
|
if (!elem.classList.contains('hide')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
isSlidUp = true;
|
elem.classList.remove('hide');
|
||||||
|
|
||||||
|
if (!browserInfo.animate) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
requestAnimationFrame(function () {
|
requestAnimationFrame(function () {
|
||||||
|
|
||||||
elem.classList.remove('hide');
|
|
||||||
|
|
||||||
var keyframes = [
|
var keyframes = [
|
||||||
{ height: '0', offset: 0 },
|
{ height: '0', offset: 0 },
|
||||||
{ height: getHeight(elem), offset: 1 }];
|
{ height: getHeight(elem), offset: 1 }];
|
||||||
|
|
|
@ -2387,6 +2387,8 @@ var AppInfo = {};
|
||||||
browser.mobile = true;
|
browser.mobile = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
browser.animate = document.documentElement.animate != null;
|
||||||
|
|
||||||
window.browserInfo = browser;
|
window.browserInfo = browser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@
|
||||||
elem.setAttribute("src", url);
|
elem.setAttribute("src", url);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browserInfo.chrome && !browserInfo.mobile) {
|
if (browserInfo.animate && !browserInfo.mobile) {
|
||||||
if (!elem.classList.contains('noFade')) {
|
if (!elem.classList.contains('noFade')) {
|
||||||
fadeIn(elem, 1);
|
fadeIn(elem, 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue