changed mobile navbar responsivenes

This commit is contained in:
2026-05-09 21:46:40 +02:00
parent 194b55fff4
commit dcdb48db84
6 changed files with 56 additions and 23 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
</head> </head>
<body> <body>
<button id="button-mobile" class="button-mobile">22</button> <button id="button-mobile" class="button-mobile no-navbar">22</button>
<div id="navbar-mobile"> <div id="navbar-mobile">
<div id="navbar-mobile-links"> <div id="navbar-mobile-links">
</div> </div>
+1 -1
View File
@@ -80,7 +80,7 @@ async function loadData() {
const button_mobile = document.getElementById("button-mobile"); const button_mobile = document.getElementById("button-mobile");
button_navbar_mobile.textContent = ""; button_navbar_mobile.textContent = "";
button_mobile.textContent = ""; button_mobile.textContent = "";
button_navbar_mobile.classList = "button-mobile"; button_navbar_mobile.classList = "button-mobile navbar";
navbar_mobile_links.appendChild(button_navbar_mobile); navbar_mobile_links.appendChild(button_navbar_mobile);
button_navbar_mobile.addEventListener("click", () => { button_navbar_mobile.addEventListener("click", () => {
navbar_mobile.classList.toggle("inactive"); navbar_mobile.classList.toggle("inactive");
+1 -1
View File
@@ -8,7 +8,7 @@
--serif: Georgia, serif; --serif: Georgia, serif;
--sans: system-ui, sans-serif; --sans: system-ui, sans-serif;
--nav-w: 230px; --nav-w: 230px;
--nav-mobile-w: 200px; --nav-mobile-w: 60vw;
--font-size: 1rem; --font-size: 1rem;
} }
+32 -7
View File
@@ -10,7 +10,6 @@
align-items: center; align-items: center;
border-right: 1px solid var(--border); border-right: 1px solid var(--border);
gap: 10px; gap: 10px;
background: var(--bg);
transition: left 0.3s; transition: left 0.3s;
-webkit-user-select: none; -webkit-user-select: none;
-ms-user-select: none; -ms-user-select: none;
@@ -18,6 +17,15 @@
z-index: 10; z-index: 10;
} }
#navbar-mobile::before {
content: "";
position: absolute;
inset: 0;
background: var(--bg);
opacity: 0.992;
z-index: -1;
}
#navbar-mobile.inactive { #navbar-mobile.inactive {
left: calc(var(--nav-mobile-w) * (-1)) left: calc(var(--nav-mobile-w) * (-1))
} }
@@ -33,7 +41,9 @@
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
gap: 10px; width: 100%;
border-bottom: 1px solid var(--border);
height: fit-content;
} }
.button-mobile { .button-mobile {
@@ -47,6 +57,10 @@
border: 1px solid var(--border); border: 1px solid var(--border);
} }
.button-mobile.navbar {
margin-bottom: 20px;
}
.button-mobile::before { .button-mobile::before {
content: ""; content: "";
position: absolute; position: absolute;
@@ -83,29 +97,32 @@
background: var(--bg2); background: var(--bg2);
} }
#button-mobile { .button-mobile.no-navbar {
position: fixed; position: fixed;
top: 5px; top: 5px;
left: 5px; left: 5px;
margin-top: 0; margin-top: 0;
} }
#button-mobile.inactive { .button-mobile.no-navbar.inactive {
display: none; display: none;
} }
.navbar-item-mobile { .navbar-item-mobile {
width: 100%; width: 100%;
height: 60px; height: 8vh;
list-style: none; list-style: none;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-top: 1px solid var(--border);
} }
@media (hover: hover) and (pointer: fine) {
.navbar-item-mobile:hover { .navbar-item-mobile:hover {
background: var(--surface); background: var(--surface);
} }
}
.nav-link-mobile { .nav-link-mobile {
text-align: center; text-align: center;
@@ -121,10 +138,18 @@
.mobile-config { .mobile-config {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: flex-start;
margin-top: auto; margin-top: auto;
margin-bottom: 20px; margin-bottom: 20px;
gap: 20px; gap: 20px;
height: fit-content; height: fit-content;
width: fit-content; width: 100%;
}
.mobile-config .switch{
margin-left: 40px;;
}
.mobile-config .lang-dropdown {
margin-left: 19.5px;
} }
+1 -1
View File
@@ -14,7 +14,7 @@
.main-content { .main-content {
margin-left: 0; margin-left: 0;
--margin-main-content: 20px; --margin-main-content: 20px;
--margin-top: 30px; --margin-top: 50px;
} }
} }
+8
View File
@@ -82,9 +82,11 @@
font-size: 0.75rem; font-size: 0.75rem;
} }
@media (hover: hover) and (pointer: fine) {
.nav-link:hover { .nav-link:hover {
color: var(--text); color: var(--text);
} }
}
.nav-link.active { .nav-link.active {
color: var(--text); color: var(--text);
@@ -162,9 +164,11 @@
border: 1px solid var(--border); border: 1px solid var(--border);
} }
@media (hover: hover) and (pointer: fine) {
.slider:hover { .slider:hover {
border: 1px solid var(--text); border: 1px solid var(--text);
} }
}
.slider:before { .slider:before {
position: absolute; position: absolute;
@@ -233,10 +237,12 @@ input:checked+.slider:before {
color: var(--muted); color: var(--muted);
} }
@media (hover: hover) and (pointer: fine) {
.lang-item:hover { .lang-item:hover {
border-color: var(--text); border-color: var(--text);
color: var(--text); color: var(--text);
} }
}
.lang-button { .lang-button {
width: 40px; width: 40px;
@@ -255,10 +261,12 @@ input:checked+.slider:before {
font-size: 14px; font-size: 14px;
} }
@media (hover: hover) and (pointer: fine) {
.lang-button:hover { .lang-button:hover {
border-color: var(--text); border-color: var(--text);
color: var(--text); color: var(--text);
} }
}
/* Contact */ /* Contact */