diff --git a/scripts/main_page.js b/scripts/main_page.js index 28ada7a..77397c7 100644 --- a/scripts/main_page.js +++ b/scripts/main_page.js @@ -66,6 +66,14 @@ async function loadData() { const sidebar_top = document.getElementById("sidebar-top-content"); const navbar_mobile = document.getElementById("navbar-mobile"); + const button_mobile2 = document.getElementById("button_mobile"); + + document.addEventListener("click", (e) => { + if (!e.target.closest("navbar-mobile") && button_mobile2.classList.contains("inactive")) { + navbar_mobile.classList.add("inactive"); + } + }); + const navbar_mobile_links = document.getElementById("navbar-mobile-links"); const button_navbar_mobile = document.createElement("button"); const button_mobile = document.getElementById("button-mobile"); diff --git a/styles/main_style.css b/styles/main_style.css index 7c328b3..941d37c 100644 --- a/styles/main_style.css +++ b/styles/main_style.css @@ -8,7 +8,7 @@ --serif: Georgia, serif; --sans: system-ui, sans-serif; --nav-w: 230px; - --nav-mobile-w: 100px; + --nav-mobile-w: 200px; --font-size: 1rem; }