mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update web-animations.html
This commit is contained in:
parent
f2e329c22d
commit
30db5a009c
6 changed files with 21 additions and 25 deletions
|
@ -15,14 +15,14 @@
|
|||
|
||||
function fadeInRight(elem) {
|
||||
|
||||
var pct = browserInfo.mobile ? '2%' : '1%';
|
||||
var pct = browserInfo.mobile ? '2%' : '0.5%';
|
||||
|
||||
var keyframes = [
|
||||
{ opacity: '0', transform: 'translate3d(' + pct + ', 0, 0)', offset: 0 },
|
||||
{ opacity: '1', transform: 'none', offset: 1 }];
|
||||
|
||||
elem.animate(keyframes, {
|
||||
duration: 300,
|
||||
duration: 160,
|
||||
iterations: 1,
|
||||
easing: 'ease-out'
|
||||
});
|
||||
|
@ -40,21 +40,12 @@
|
|||
return;
|
||||
}
|
||||
elem.animate(keyframes, {
|
||||
duration: 160,
|
||||
duration: 120,
|
||||
iterations: 1,
|
||||
easing: 'ease-out'
|
||||
});
|
||||
}
|
||||
|
||||
function animateTabOnShow(newPanel, animateTabs, index) {
|
||||
|
||||
if (animateTabs && animateTabs.indexOf(index) != -1 && /*browserInfo.animate &&*/ newPanel.animate) {
|
||||
setTimeout(function () {
|
||||
fadeInRight(newPanel);
|
||||
}, 160);
|
||||
}
|
||||
}
|
||||
|
||||
var libraryBrowser = (function (window, document, screen) {
|
||||
|
||||
// Regular Expressions for parsing tags and attributes
|
||||
|
@ -301,11 +292,13 @@
|
|||
var index = parseInt(link.getAttribute('data-index'));
|
||||
var newPanel = panels[index];
|
||||
|
||||
animateTabOnShow(newPanel, animateTabs, index);
|
||||
|
||||
// If toCenter is called syncronously within the click event, it sometimes ends up canceling it
|
||||
setTimeout(function () {
|
||||
|
||||
if (animateTabs && animateTabs.indexOf(index) != -1 && /*browserInfo.animate &&*/ newPanel.animate) {
|
||||
fadeInRight(newPanel);
|
||||
}
|
||||
|
||||
tabs.dispatchEvent(new CustomEvent("tabchange", {
|
||||
detail: {
|
||||
selectedTabIndex: index
|
||||
|
@ -315,7 +308,7 @@
|
|||
newPanel.classList.add('is-active');
|
||||
|
||||
//scrollHelper.toCenter(tabs, link, true);
|
||||
}, 160);
|
||||
}, 120);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -157,17 +157,21 @@
|
|||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
document.body.classList.add('autoScrollY');
|
||||
depends.push('scripts/livetvguide');
|
||||
break;
|
||||
case 2:
|
||||
document.body.classList.remove('autoScrollY');
|
||||
depends.push('scripts/livetvchannels');
|
||||
depends.push('paper-icon-item');
|
||||
depends.push('paper-item-body');
|
||||
break;
|
||||
case 3:
|
||||
document.body.classList.remove('autoScrollY');
|
||||
depends.push('scripts/livetvrecordings');
|
||||
break;
|
||||
case 4:
|
||||
document.body.classList.remove('autoScrollY');
|
||||
depends.push('scripts/livetvseriestimers');
|
||||
break;
|
||||
default:
|
||||
|
@ -210,13 +214,6 @@
|
|||
loadTab(view, parseInt(e.detail.selectedTabIndex));
|
||||
});
|
||||
|
||||
view.addEventListener('viewshow', function (e) {
|
||||
|
||||
// Needed on the guide tab
|
||||
// Ideally this should be moved to the guide tab on show/hide
|
||||
document.body.classList.add('autoScrollY');
|
||||
});
|
||||
|
||||
view.addEventListener('viewbeforehide', function (e) {
|
||||
|
||||
document.body.classList.remove('autoScrollY');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue