feat: Escape key closes menu
All checks were successful
Deploy / Deploy to Production (push) Successful in 13s
All checks were successful
Deploy / Deploy to Production (push) Successful in 13s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8a0f58c053
commit
0e1b65badf
1 changed files with 4 additions and 0 deletions
|
|
@ -30,6 +30,10 @@ export function headerToggle() {
|
|||
});
|
||||
|
||||
overlay?.addEventListener("click", closeMenu);
|
||||
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Escape" && document.body.classList.contains("menu-open")) closeMenu();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue