1
0
Fork 0
mirror of https://github.com/netz39/www.netz39.de.git synced 2025-08-11 22:40:47 +02:00

Initial commit

This commit is contained in:
MG-5 2023-10-16 01:36:59 +02:00 committed by GitHub
commit ecca3df926
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
259 changed files with 53743 additions and 0 deletions
assets/js/partials

View file

@ -0,0 +1,26 @@
/* @preserve Navbar */
document.addEventListener("DOMContentLoaded", function (event) {
/*
* Display the menu items on smaller screens
*/
const pull = document.getElementById('pull');
const menu = document.querySelector('nav ul');
['click', 'touch'].forEach(function (e) {
pull?.addEventListener(e, function () {
menu.classList.toggle('hide')
}, false);
});
/*
* Make the header images move on scroll
*/
window.addEventListener('scroll', function () {
const offset = -(window.scrollY || window.pageYOffset || document.body.scrollTop) / 3;
const main = document.getElementById('main');
if (main) {
main.style.backgroundPosition = '100% ' + (offset - 50) + 'px' + ', 0%, center top';
}
});
});