From 8b4cf022f26032b7850d11b6e466e7a6a470d7f4 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 3 Aug 2022 22:56:51 +0200 Subject: [PATCH] bbox: tweak end-of-gallery animation --- copyparty/web/baguettebox.js | 19 +++++++------------ copyparty/web/browser.css | 10 ++++++++-- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/copyparty/web/baguettebox.js b/copyparty/web/baguettebox.js index 1e9b45de..4c6ef35b 100644 --- a/copyparty/web/baguettebox.js +++ b/copyparty/web/baguettebox.js @@ -699,18 +699,12 @@ window.baguetteBox = (function () { showOverlay(index); return true; } - if (index < 0) { - if (options.animation) - bounceAnimation('left'); - return false; - } - if (index >= imagesElements.length) { - if (options.animation) - bounceAnimation('right'); + if (index < 0) + return bounceAnimation('left'); - return false; - } + if (index >= imagesElements.length) + return bounceAnimation('right'); var v = vid(); if (v) { @@ -893,10 +887,11 @@ window.baguetteBox = (function () { } function bounceAnimation(direction) { - slider.className = 'bounce-from-' + direction; + slider.className = options.animation == 'slideIn' ? 'bounce-from-' + direction : 'eog'; setTimeout(function () { slider.className = ''; - }, 400); + }, 300); + return false; } function updateOffset() { diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index e4dc04d5..4bd9d951 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -1909,10 +1909,13 @@ html.y #bbox-overlay figcaption a { transition: left .2s ease, transform .2s ease; } .bounce-from-right { - animation: bounceFromRight .4s ease-out; + animation: bounceFromRight .3s ease-out; } .bounce-from-left { - animation: bounceFromLeft .4s ease-out; + animation: bounceFromLeft .3s ease-out; +} +.eog { + animation: eog .2s; } @keyframes bounceFromRight { 0% {margin-left: 0} @@ -1924,6 +1927,9 @@ html.y #bbox-overlay figcaption a { 50% {margin-left: 30px} 100% {margin-left: 0} } +@keyframes eog { + 0% {filter: brightness(1.5)} +} #bbox-next, #bbox-prev { top: 50%;