new design with nice layout

This commit is contained in:
Mark Gregory
2026-11-20 07:12:16 +00:00
parent ce5b93c3b9
commit fb24f0f552
6 changed files with 86 additions and 56 deletions
+21 -1
View File
@@ -1 +1,21 @@
//
const mobileMenu = document.querySelector('.site-menu');
if (mobileMenu) {
const menuButton = mobileMenu.querySelector('summary');
mobileMenu.querySelectorAll('nav a').forEach((link) => {
link.addEventListener('click', () => {
mobileMenu.open = false;
if (link.pathname === window.location.pathname && link.hash) {
menuButton.focus({ preventScroll: true });
}
});
});
mobileMenu.addEventListener('keydown', (event) => {
if (event.key === 'Escape' && mobileMenu.open) {
mobileMenu.open = false;
menuButton.focus();
}
});
}