mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
switch animations from velocity to WebAnimations
This commit is contained in:
parent
20df393f36
commit
2b72b53233
1 changed files with 24 additions and 14 deletions
|
@ -18,18 +18,32 @@
|
|||
elem = elem.querySelector('.cardOverlayTarget');
|
||||
|
||||
if ($(elem).is(':visible')) {
|
||||
require(["jquery", "velocity"], function ($, Velocity) {
|
||||
|
||||
Velocity.animate(elem, { "height": "0" },
|
||||
{
|
||||
complete: function () {
|
||||
$(elem).hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
slideDown(elem, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function slideDown(elem, iterations) {
|
||||
|
||||
var keyframes = [
|
||||
{ height: '100%', offset: 0 },
|
||||
{ height: '0', display: 'none', offset: 1 }];
|
||||
var timing = { duration: 300, iterations: iterations, fill: 'forwards', easing: 'ease-out' };
|
||||
elem.animate(keyframes, timing).onfinish = function() {
|
||||
elem.style.display = 'none';
|
||||
};
|
||||
}
|
||||
|
||||
function slideUp(elem, iterations) {
|
||||
|
||||
elem.style.display = 'block';
|
||||
|
||||
var keyframes = [
|
||||
{ height: '0', offset: 0 },
|
||||
{ height: '100%', offset: 1 }];
|
||||
var timing = { duration: 300, iterations: iterations, fill: 'forwards', easing: 'ease-out' };
|
||||
return elem.animate(keyframes, timing);
|
||||
}
|
||||
|
||||
function getOverlayHtml(item, currentUser, card, commands) {
|
||||
|
||||
var html = '';
|
||||
|
@ -707,12 +721,8 @@
|
|||
});
|
||||
|
||||
$(innerElem).show();
|
||||
innerElem.style.height = '0';
|
||||
|
||||
require(["jquery", "velocity"], function ($, Velocity) {
|
||||
|
||||
Velocity.animate(innerElem, { "height": "100%" }, "fast");
|
||||
});
|
||||
slideUp(innerElem, 1);
|
||||
}
|
||||
|
||||
function onHoverIn(e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue