broken but cool htmx! also improved templating
Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
parent
5c59348362
commit
c1ff03c4e5
18 changed files with 297 additions and 97 deletions
|
@ -1,4 +1,3 @@
|
|||
const header_home = document.getElementById("header-home");
|
||||
const header_links = document.getElementById("header-links");
|
||||
const hamburger = document.getElementById("header-links-toggle");
|
||||
|
||||
|
@ -7,14 +6,9 @@ function toggle_header_links() {
|
|||
}
|
||||
|
||||
document.addEventListener("click", event => {
|
||||
if (!header_links.contains(event.target) && !hamburger.contains(event.target)) {
|
||||
if (!header_links.contains(event.target) && !hamburger.contains(event.target) && !header_links.href) {
|
||||
header_links.classList.remove("open");
|
||||
}
|
||||
});
|
||||
|
||||
hamburger.addEventListener("click", event => { toggle_header_links(); });
|
||||
|
||||
header_home.addEventListener("click", event => {
|
||||
event.preventDefault();
|
||||
location.href = "/";
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue