1
0
Fork 0
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:
Luke Pulverenti 2015-11-28 22:14:55 -05:00
parent 20df393f36
commit 2b72b53233

View file

@ -18,16 +18,30 @@
elem = elem.querySelector('.cardOverlayTarget'); elem = elem.querySelector('.cardOverlayTarget');
if ($(elem).is(':visible')) { if ($(elem).is(':visible')) {
require(["jquery", "velocity"], function ($, Velocity) { slideDown(elem, 1);
}
}
Velocity.animate(elem, { "height": "0" }, function slideDown(elem, iterations) {
{
complete: function () { var keyframes = [
$(elem).hide(); { 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) { function getOverlayHtml(item, currentUser, card, commands) {
@ -707,12 +721,8 @@
}); });
$(innerElem).show(); $(innerElem).show();
innerElem.style.height = '0';
require(["jquery", "velocity"], function ($, Velocity) { slideUp(innerElem, 1);
Velocity.animate(innerElem, { "height": "100%" }, "fast");
});
} }
function onHoverIn(e) { function onHoverIn(e) {