Adpatation mobiles

This commit is contained in:
2026-01-29 17:35:49 +01:00
parent 67189dd7ee
commit 8d0586cfb4
11 changed files with 140 additions and 60 deletions

View File

@ -1,4 +1,5 @@
document.addEventListener('DOMContentLoaded', () => {
console.log('DOM fully loaded and parsed');
const FPS = 60; // Target frames per second for cursor tracking
@ -152,4 +153,22 @@ document.addEventListener('DOMContentLoaded', () => {
});
});
})();
});
// Navbar mobile
// Get all "navbar-burger" elements
const $navbarBurgers = document.querySelector('.navbar-burger');
console.log('$navbarBurgers:', $navbarBurgers);
// Add a click event on each of them
let el = $navbarBurgers;
el.addEventListener('click', () => {
console.log('Navbar burger clicked');
// Get the target from the "data-target" attribute
const target = el.dataset.target;
const $target = document.getElementById(target);
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
}, { once: true });