Adpatation mobiles
This commit is contained in:
@ -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 });
|
||||
|
||||
@ -35,7 +35,11 @@ body{
|
||||
}
|
||||
#nav{
|
||||
--bulma-navbar-item-img-max-height: 2.5rem;
|
||||
display:flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#hero{
|
||||
justify-content:center;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user