From 70e2a99274b65979503c1e4b8262ca98d21ebedf Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Fri, 25 Oct 2019 19:21:49 +0200 Subject: [PATCH] custom easing to restore the original fadeout --- htdocs/openwebrx.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index f6b4e0d..633a7d2 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -48,6 +48,13 @@ function init_rx_photo() { var clip = e("webrx-top-photo-clip"); rx_photo_height = clip.clientHeight; clip.style.maxHeight = rx_photo_height + "px"; + + $.extend($.easing, { + easeOutCubic:function(x) { + return 1 - Math.pow( 1 - x, 3 ); + } + }); + window.setTimeout(function () { $('#webrx-rx-photo-title').animate({opacity: 0}, 500); }, 1000); @@ -77,7 +84,7 @@ function toggle_rx_photo() { function close_rx_photo() { rx_photo_state = 0; - $('#webrx-top-photo-clip').animate({maxHeight: 67}, {duration: 1000, step: function () { + $('#webrx-top-photo-clip').animate({maxHeight: 67}, {duration: 1000, easing: 'easeOutCubic', step: function () { resize_waterfall_container(true); }}); e("openwebrx-rx-details-arrow-down").style.display = "block"; @@ -88,7 +95,7 @@ function open_rx_photo() { rx_photo_state = 1; e("webrx-rx-photo-desc").style.opacity = 1; e("webrx-rx-photo-title").style.opacity = 1; - $('#webrx-top-photo-clip').animate({maxHeight: rx_photo_height}, {duration: 1000, step: function () { + $('#webrx-top-photo-clip').animate({maxHeight: rx_photo_height}, {duration: 1000, easing: 'easeOutCubic', step: function () { resize_waterfall_container(true); }}); e("openwebrx-rx-details-arrow-down").style.display = "none";