From a9b13f1e3943eb34a1f29cf5d9f206c4f7b496f7 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Wed, 1 Feb 2023 00:57:36 +0000 Subject: [PATCH] Fix jumpUp button Switch to reffere instead of src url Once again, I am changing animations --- gallery/static/js/main.js | 14 ++++++++------ gallery/templates/image.html | 14 +++++++++----- gallery/templates/index.html | 12 ++++++------ gallery/templates/layout.html | 2 +- gallery/user/themes/default/animations.sass | 9 ++++++--- gallery/user/themes/default/buttons/jumpUp.sass | 8 ++++++++ gallery/user/themes/default/ui/notification.sass | 1 - 7 files changed, 38 insertions(+), 22 deletions(-) diff --git a/gallery/static/js/main.js b/gallery/static/js/main.js index dcb3283..7e9cc9a 100644 --- a/gallery/static/js/main.js +++ b/gallery/static/js/main.js @@ -1,15 +1,17 @@ let navToggle = true; document.onscroll = function() { - document.querySelector('.background-decoration').style.opacity = `${1 - window.scrollY / 621}`; - document.querySelector('.background-decoration').style.top = `-${window.scrollY / 5}px`; + try { + document.querySelector('.background-decoration').style.opacity = `${1 - window.scrollY / 621}`; + document.querySelector('.background-decoration').style.top = `-${window.scrollY / 5}px`; + } catch (e) { + console.log('No background decoration found'); + } if (document.body.scrollTop > 300 || document.documentElement.scrollTop > 20) { - document.querySelector('.jumpUp').style.opacity = 1; - document.querySelector('.jumpUp').style.right = "0.75rem"; + document.querySelector('.jumpUp').classList = 'jumpUp jumpUp--show'; } else { - document.querySelector('.jumpUp').style.opacity = 0; - document.querySelector('.jumpUp').style.right = "-3rem"; + document.querySelector('.jumpUp').classList = 'jumpUp'; } } diff --git a/gallery/templates/image.html b/gallery/templates/image.html index 06cde22..fd25b19 100644 --- a/gallery/templates/image.html +++ b/gallery/templates/image.html @@ -6,7 +6,6 @@ {% endblock %} -{% block scrollPosition %}?src={{ image['id'] }}{% endblock %} {% block wrapper_class %}image-wrapper{% endblock %} {% block content %} @@ -209,10 +208,15 @@ {% block script %}