Skip to content

Commit 796c4c7

Browse files
Kosthiclaude
andcommitted
fix: mobile navbar layout overflow
- Separate desktop and mobile navigation structures - Move language switcher and GitHub button into mobile menu - Only show hamburger button on mobile - Add smooth slide-down animation for mobile menu - Fix z-index and positioning for mobile overlay Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bd7ba5f commit 796c4c7

File tree

2 files changed

+155
-19
lines changed

2 files changed

+155
-19
lines changed

src/components/vue/NavBar.vue

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,9 @@ onUnmounted(() => {
154154
<img src="/RushDB.png" alt="RushDB Logo" class="nav-logo-img" />
155155
<span>&ensp;RushDB</span>
156156
</a>
157-
<div class="nav-actions">
158-
<button class="nav-toggle" type="button" :aria-label="t('nav.openMenu')" @click="toggleNavMenu">
159-
<span class="nav-toggle-bars" aria-hidden="true"></span>
160-
</button>
157+
158+
<!-- Desktop navigation -->
159+
<div class="nav-actions nav-desktop">
161160
<ul class="nav-links">
162161
<li>
163162
<a href="#about" :class="{ active: activeSection === 'about' }">{{ t('nav.about') }}</a>
@@ -195,6 +194,53 @@ onUnmounted(() => {
195194
{{ t('nav.github') }}
196195
</a>
197196
</div>
197+
198+
<!-- Mobile hamburger button -->
199+
<button class="nav-toggle" type="button" :aria-label="t('nav.openMenu')" @click="toggleNavMenu">
200+
<span class="nav-toggle-bars" aria-hidden="true"></span>
201+
</button>
202+
203+
<!-- Mobile menu -->
204+
<div class="nav-mobile-menu" :class="{ open: isMenuOpen }">
205+
<ul class="nav-mobile-links">
206+
<li>
207+
<a href="#about" :class="{ active: activeSection === 'about' }" @click="closeNavMenu">{{ t('nav.about') }}</a>
208+
</li>
209+
<li>
210+
<a href="#achievements" :class="{ active: activeSection === 'achievements' }" @click="closeNavMenu">{{ t('nav.achievements') }}</a>
211+
</li>
212+
<li>
213+
<a href="#projects" :class="{ active: activeSection === 'projects' }" @click="closeNavMenu">{{ t('nav.projects') }}</a>
214+
</li>
215+
<li>
216+
<a href="#members" :class="{ active: activeSection === 'members' }" @click="closeNavMenu">{{ t('nav.members') }}</a>
217+
</li>
218+
<li>
219+
<a :href="`/${lang}/blog/`" class="nav-blog-link">{{ t('nav.blog') }}</a>
220+
</li>
221+
</ul>
222+
223+
<div class="nav-mobile-actions">
224+
<div class="language-switcher mobile-lang" :class="{ show: isLanguageOpen }">
225+
<div class="language-trigger" @click="toggleLanguageSwitcher">{{ languageLabel }}</div>
226+
<div class="language-dropdown">
227+
<button
228+
v-for="(label, langKey) in languages"
229+
:key="langKey"
230+
class="lang-btn"
231+
:class="{ active: lang === langKey }"
232+
:data-lang="langKey"
233+
@click="switchLanguage(langKey as Lang)"
234+
>
235+
{{ label }}
236+
</button>
237+
</div>
238+
</div>
239+
<a class="nav-cta mobile-cta" href="https://github.com/RushDB-Lab" target="_blank" rel="noopener noreferrer">
240+
{{ t('nav.github') }}
241+
</a>
242+
</div>
243+
</div>
198244
</div>
199245
</nav>
200246
</template>

src/styles/global.css

Lines changed: 105 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,42 +2272,132 @@
22722272
display: inline-flex;
22732273
}
22742274

2275-
.nav-links {
2276-
display: flex;
2275+
/* Hide desktop nav on mobile */
2276+
.nav-desktop {
2277+
display: none;
2278+
}
2279+
2280+
/* Mobile hamburger button */
2281+
.nav-toggle {
2282+
order: 1;
2283+
margin-left: auto;
2284+
}
2285+
2286+
/* Mobile menu */
2287+
.nav-mobile-menu {
22772288
position: fixed;
2278-
top: 80px;
2289+
top: 70px;
22792290
left: 12px;
22802291
right: 12px;
2281-
padding: 10px;
2282-
gap: 0.25rem;
2283-
flex-direction: column;
2284-
background: rgba(8, 12, 28, 0.86);
2285-
border: 1px solid rgba(234, 242, 255, 0.12);
2292+
padding: 16px;
2293+
background: rgba(8, 12, 28, 0.95);
2294+
border: 1px solid rgba(240, 246, 255, 0.12);
22862295
border-radius: 16px;
22872296
backdrop-filter: blur(20px);
22882297
transform: translateY(-10px);
22892298
opacity: 0;
22902299
pointer-events: none;
2291-
transition: opacity 0.2s ease, transform 0.2s ease;
2300+
transition: opacity 0.25s ease, transform 0.25s ease;
2301+
z-index: 999;
2302+
max-height: calc(100vh - 100px);
2303+
overflow-y: auto;
22922304
}
22932305

2294-
.navbar.menu-open .nav-links {
2306+
.nav-mobile-menu.open {
22952307
opacity: 1;
22962308
transform: translateY(0);
22972309
pointer-events: auto;
22982310
}
22992311

2300-
.nav-links a {
2312+
.nav-mobile-links {
2313+
list-style: none;
2314+
padding: 0;
2315+
margin: 0 0 16px 0;
2316+
display: flex;
2317+
flex-direction: column;
2318+
gap: 4px;
2319+
}
2320+
2321+
.nav-mobile-links a {
23012322
display: block;
2302-
padding: 12px 14px;
2323+
padding: 12px 16px;
23032324
border-radius: 12px;
2304-
background: rgba(234, 242, 255, 0.03);
2305-
border: 1px solid rgba(234, 242, 255, 0.06);
2325+
background: rgba(240, 246, 255, 0.03);
2326+
border: 1px solid rgba(240, 246, 255, 0.06);
2327+
color: var(--text-2);
2328+
text-decoration: none;
2329+
font-weight: 600;
2330+
transition: all 0.2s ease;
23062331
}
23072332

2308-
.nav-links a:hover {
2333+
.nav-mobile-links a:hover,
2334+
.nav-mobile-links a.active {
23092335
background: rgba(34, 211, 238, 0.08);
23102336
border-color: rgba(34, 211, 238, 0.22);
2337+
color: var(--text);
2338+
}
2339+
2340+
.nav-mobile-actions {
2341+
display: flex;
2342+
flex-direction: column;
2343+
gap: 12px;
2344+
padding-top: 16px;
2345+
border-top: 1px solid rgba(240, 246, 255, 0.1);
2346+
}
2347+
2348+
.mobile-lang {
2349+
width: 100%;
2350+
}
2351+
2352+
.mobile-lang .language-trigger {
2353+
width: 100%;
2354+
justify-content: center;
2355+
}
2356+
2357+
.mobile-lang .language-dropdown {
2358+
position: relative;
2359+
top: 8px;
2360+
left: 0;
2361+
right: 0;
2362+
margin-top: 0;
2363+
transform: none;
2364+
opacity: 0;
2365+
max-height: 0;
2366+
overflow: hidden;
2367+
transition: all 0.25s ease;
2368+
}
2369+
2370+
.mobile-lang.show .language-dropdown {
2371+
opacity: 1;
2372+
max-height: 200px;
2373+
}
2374+
2375+
.mobile-cta {
2376+
width: 100%;
2377+
justify-content: center;
2378+
text-align: center;
2379+
}
2380+
2381+
/* Hide original nav-links on mobile */
2382+
.nav-links {
2383+
display: none !important;
2384+
}
2385+
}
2386+
2387+
/* Show mobile menu structure only on mobile */
2388+
@media (min-width: 981px) {
2389+
.nav-toggle {
2390+
display: none;
2391+
}
2392+
2393+
.nav-mobile-menu {
2394+
display: none;
2395+
}
2396+
2397+
.nav-desktop {
2398+
display: flex;
2399+
align-items: center;
2400+
gap: 2rem;
23112401
}
23122402
}
23132403

0 commit comments

Comments
 (0)