This commit is contained in:
Flummi
2021-12-26 17:26:30 +01:00
parent ef54c7ccce
commit 52bfed6ed9
5 changed files with 131 additions and 8 deletions

View File

@ -62,11 +62,12 @@
// <scroller>
let tts = 0;
const scroll_treshold = 1;
if(document.querySelector("div#posts")) {
document.addEventListener("wheel", e => {
if((window.innerHeight + window.scrollY) >= document.body.offsetHeight && e.deltaY > 0) { // down
if(elem = document.querySelector(".pagination > .next:not(.disabled)")) {
if(tts < 2) {
if(tts < scroll_treshold) {
document.querySelector("div#footbar").style.backgroundColor = "var(--scroller-bg)";
tts++;
}
@ -76,7 +77,7 @@
}
else if(window.scrollY <= 0 && e.deltaY < 0) { // up
if(elem = document.querySelector(".pagination > .prev:not(.disabled)")) {
if(tts < 2) {
if(tts < scroll_treshold) {
document.querySelector("nav.navbar").style.backgroundColor = "var(--scroller-bg)";
tts++;
}
@ -85,6 +86,7 @@
}
}
else {
tts = 0;
document.querySelector("div#footbar").style.backgroundColor = "var(--nav-bg)";
document.querySelector("nav.navbar").style.backgroundColor = "var(--nav-bg)";
}