From 4b3ce9902e9c4cae3dc50b2758bed9e0b35aef73 Mon Sep 17 00:00:00 2001 From: Flummi Date: Tue, 28 Dec 2021 04:06:24 +0100 Subject: [PATCH] better visual feedback for main view scroller --- public/s/js/f0ck.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/s/js/f0ck.js b/public/s/js/f0ck.js index 5ee7b55..4887dba 100644 --- a/public/s/js/f0ck.js +++ b/public/s/js/f0ck.js @@ -68,7 +68,8 @@ if((window.innerHeight + window.scrollY) >= document.body.offsetHeight && e.deltaY > 0) { // down if(elem = document.querySelector(".pagination > .next:not(.disabled)")) { if(tts < scroll_treshold) { - document.querySelector("div#footbar").style.backgroundColor = "var(--scroller-bg)"; + document.querySelector("div#footbar").style.boxShadow = "inset 0px 4px 0px var(--accent)"; + document.querySelector("div#footbar").style.color = "var(--accent)"; tts++; } else @@ -78,7 +79,8 @@ else if(window.scrollY <= 0 && e.deltaY < 0) { // up if(elem = document.querySelector(".pagination > .prev:not(.disabled)")) { if(tts < scroll_treshold) { - document.querySelector("nav.navbar").style.backgroundColor = "var(--scroller-bg)"; + document.querySelector("nav.navbar").style.boxShadow = "0px 2px 0px var(--accent)"; + document.querySelector("nav.navbar").style.transition = ".5s ease-in-out"; tts++; } else @@ -87,8 +89,9 @@ } else { tts = 0; - document.querySelector("div#footbar").style.backgroundColor = "var(--nav-bg)"; - document.querySelector("nav.navbar").style.backgroundColor = "var(--nav-bg)"; + document.querySelector("div#footbar").style.boxShadow = "unset"; + document.querySelector("div#footbar").style.color = "transparent"; + document.querySelector("nav.navbar").style.boxShadow = "unset"; } }); }