arimelody.me/public/script/header.js
ari melody 13d802d361 moving to custom swap engine
Signed-off-by: ari melody <ari@arimelody.me>
2024-08-31 01:52:28 +01:00

13 lines
454 B
JavaScript

const header_links = document.getElementById("header-links");
const hamburger = document.getElementById("header-links-toggle");
document.addEventListener("click", event => {
if (!header_links.contains(event.target) && !hamburger.contains(event.target) && !header_links.href) {
header_links.classList.remove("open");
}
});
hamburger.addEventListener("click", event => {
header_links.classList.toggle("open");
});