Initial commit.

Signed-off-by: Andreas Widen <aw@luflow.net>
This commit is contained in:
Andreas Widen 2026-07-27 17:57:03 +02:00
commit a4a5c7daa5
Signed by: hfsoulz
GPG key ID: 5B85F9B5F576A667
1389 changed files with 241399 additions and 0 deletions

44
static/scripts/core.js Normal file
View file

@ -0,0 +1,44 @@
/* luflow.net web site */
/* Public domain 2025. All rights waived */
// handle menu toggle while in mobile (or smaller) type screens:
let menuToggle = document.querySelector('.menuToggle');
let header = document.querySelector('header');
menuToggle.onclick = function () {
header.classList.toggle('active');
};
// hide header navigation bar when scrolling down, and show again when scrolling up:
let lastScrollTop = 0;
let navbarHeight = 100;
let didScroll = false;
let delta = 5;
window.onscroll = function () {
didScroll = true;
};
setInterval(function () {
if (didScroll) {
hasScrolled();
didScroll = false;
}
}, 250);
function hasScrolled() {
let scrollTop = document.documentElement.scrollTop;
if (Math.abs(lastScrollTop - scrollTop) <= delta) {
return;
}
if (scrollTop > lastScrollTop && scrollTop > navbarHeight) {
header.classList.add('nav-up');
header.classList.remove('nav-down');
} else {
header.classList.remove('nav-up');
header.classList.add('nav-down');
}
lastScrollTop = scrollTop;
}