mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update recording dialogs
This commit is contained in:
parent
bdfd870584
commit
141344eead
60 changed files with 546 additions and 211 deletions
|
@ -7,4 +7,63 @@
|
|||
contain: layout style;
|
||||
/* Can't use will-change because it causes the alpha picker to move when the page scrolls*/
|
||||
/*will-change: transform;*/
|
||||
}
|
||||
|
||||
@keyframes view-fadeout {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes view-fadein {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes view-slideleft {
|
||||
from {
|
||||
transform: translate3d(100%, 0, 0);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes view-slideleft-r {
|
||||
from {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translate3d(-100%, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes view-slideright {
|
||||
from {
|
||||
transform: translate3d(-100%, 0, 0);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes view-slideright-r {
|
||||
from {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
to {
|
||||
transform: translate3d(100%, 0, 0);
|
||||
}
|
||||
}
|
|
@ -116,72 +116,59 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
|
|||
function slide(newAnimatedPage, oldAnimatedPage, transition, isBack) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
var timings = {
|
||||
duration: 450,
|
||||
iterations: 1,
|
||||
easing: 'ease-out',
|
||||
fill: 'both'
|
||||
};
|
||||
|
||||
var duration = 450;
|
||||
|
||||
var animations = [];
|
||||
|
||||
if (oldAnimatedPage) {
|
||||
var destination = isBack ? '100%' : '-100%';
|
||||
|
||||
animations.push(oldAnimatedPage.animate([
|
||||
|
||||
{ transform: 'none', offset: 0 },
|
||||
{ transform: 'translate3d(' + destination + ', 0, 0)', offset: 1 }
|
||||
|
||||
], timings));
|
||||
if (isBack) {
|
||||
oldAnimatedPage.style.animation = 'view-slideright-r ' + duration + 'ms ease-out normal both';
|
||||
setAnimation(oldAnimatedPage, 'view-slideright-r ' + duration + 'ms ease-out normal both');
|
||||
} else {
|
||||
setAnimation(oldAnimatedPage, 'view-slideleft-r ' + duration + 'ms ease-out normal both');
|
||||
}
|
||||
animations.push(oldAnimatedPage);
|
||||
}
|
||||
|
||||
var start = isBack ? '-100%' : '100%';
|
||||
|
||||
animations.push(newAnimatedPage.animate([
|
||||
|
||||
{ transform: 'translate3d(' + start + ', 0, 0)', offset: 0 },
|
||||
{ transform: 'none', offset: 1 }
|
||||
|
||||
], timings));
|
||||
if (isBack) {
|
||||
setAnimation(newAnimatedPage, 'view-slideright ' + duration + 'ms ease-out normal both');
|
||||
} else {
|
||||
setAnimation(newAnimatedPage, 'view-slideleft ' + duration + 'ms ease-out normal both');
|
||||
}
|
||||
animations.push(newAnimatedPage);
|
||||
|
||||
currentAnimations = animations;
|
||||
|
||||
animations[animations.length - 1].onfinish = resolve;
|
||||
setTimeout(resolve, duration);
|
||||
});
|
||||
}
|
||||
|
||||
function fade(newAnimatedPage, oldAnimatedPage, transition, isBack) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
var timings = {
|
||||
duration: 300,
|
||||
iterations: 1,
|
||||
easing: 'ease-out',
|
||||
fill: 'both'
|
||||
};
|
||||
|
||||
var duration = 400;
|
||||
var animations = [];
|
||||
|
||||
if (oldAnimatedPage) {
|
||||
animations.push(oldAnimatedPage.animate([
|
||||
|
||||
{ opacity: 1, offset: 0 },
|
||||
{ opacity: 0, offset: 1 }
|
||||
|
||||
], timings));
|
||||
setAnimation(oldAnimatedPage, 'view-fadeout ' + duration + 'ms ease-out normal both');
|
||||
animations.push(oldAnimatedPage);
|
||||
}
|
||||
|
||||
animations.push(newAnimatedPage.animate([
|
||||
|
||||
{ opacity: 0, offset: 0 },
|
||||
{ opacity: 1, offset: 1 }
|
||||
|
||||
], timings));
|
||||
setAnimation(newAnimatedPage, 'view-fadein ' + duration + 'ms ease-in normal both');
|
||||
animations.push(newAnimatedPage);
|
||||
|
||||
currentAnimations = animations;
|
||||
|
||||
animations[animations.length - 1].onfinish = resolve;
|
||||
setTimeout(resolve, duration);
|
||||
});
|
||||
}
|
||||
|
||||
function setAnimation(elem, value) {
|
||||
|
||||
requestAnimationFrame(function () {
|
||||
elem.style.animation = value;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -190,16 +177,7 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
|
|||
|
||||
var animations = currentAnimations;
|
||||
for (var i = 0, length = animations.length; i < length; i++) {
|
||||
cancelAnimation(animations[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function cancelAnimation(animation) {
|
||||
|
||||
try {
|
||||
animation.cancel();
|
||||
} catch (err) {
|
||||
console.log('Error canceling animation: ' + err);
|
||||
animations[i].animation = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue