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:
commit
ecca3df926
259 changed files with 53743 additions and 0 deletions
assets/js/partials
26
assets/js/partials/navbar.js
Normal file
26
assets/js/partials/navbar.js
Normal 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';
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue