2024-03-20 03:56:51 +00:00
|
|
|
const header_home = document.getElementById("header-home");
|
2024-03-18 15:04:04 +00:00
|
|
|
const header_links = document.getElementById("header-links");
|
|
|
|
const hamburger = document.getElementById("header-links-toggle");
|
|
|
|
|
|
|
|
function toggle_header_links() {
|
|
|
|
header_links.classList.toggle("open");
|
|
|
|
}
|
|
|
|
|
|
|
|
document.addEventListener("click", event => {
|
|
|
|
if (!header_links.contains(event.target) && !hamburger.contains(event.target)) {
|
|
|
|
header_links.classList.remove("open");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
hamburger.addEventListener("click", event => { toggle_header_links(); });
|
2024-03-20 03:56:51 +00:00
|
|
|
|
|
|
|
header_home.addEventListener("click", event => {
|
|
|
|
event.preventDefault();
|
|
|
|
location.href = "/";
|
|
|
|
});
|