fixed mobile bar close event

This commit is contained in:
2026-05-08 10:00:52 +02:00
parent f50d76e033
commit 2b337a848a
3 changed files with 12 additions and 2 deletions
+3 -2
View File
@@ -66,11 +66,12 @@ async function loadData() {
const sidebar_top = document.getElementById("sidebar-top-content"); const sidebar_top = document.getElementById("sidebar-top-content");
const navbar_mobile = document.getElementById("navbar-mobile"); const navbar_mobile = document.getElementById("navbar-mobile");
const button_mobile2 = document.getElementById("button_mobile"); const button_mobile2 = document.getElementById("button-mobile");
document.addEventListener("click", (e) => { document.addEventListener("click", (e) => {
if (!e.target.closest("navbar-mobile") && button_mobile2.classList.contains("inactive")) { if (!e.target.closest("#navbar-mobile") && !e.target.closest("#button-mobile") && !navbar_mobile.classList.contains("inactive")) {
navbar_mobile.classList.add("inactive"); navbar_mobile.classList.add("inactive");
button_mobile2.classList.remove("inactive");
} }
}); });
+3
View File
@@ -12,6 +12,9 @@
gap: 10px; gap: 10px;
background: var(--bg); background: var(--bg);
transition: left 0.3s; transition: left 0.3s;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
} }
#navbar-mobile.inactive { #navbar-mobile.inactive {
+6
View File
@@ -72,6 +72,9 @@
position: relative; position: relative;
font-weight: normal; font-weight: normal;
margin: 5px 0px 5px 0px; margin: 5px 0px 5px 0px;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
} }
.nav-link { .nav-link {
@@ -194,6 +197,9 @@ input:checked+.slider:before {
align-items: center; align-items: center;
border: none; border: none;
background: none; background: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
} }
.lang-dropdown.show-border { .lang-dropdown.show-border {