@@ -16,7 +16,7 @@ const navItems = [
1616 <span class =" logo-text" >DataPup</span >
1717 </a >
1818
19- <ul class =" nav-links" >
19+ <ul class =" nav-links" id = " nav-links " >
2020 { navItems .map (item => (
2121 <li >
2222 <a
@@ -36,16 +36,18 @@ const navItems = [
3636 ))}
3737 </ul >
3838
39- <button class =" theme-toggle-nav" aria-label =" Toggle theme" >
40- <span class =" theme-icon sun-icon" >☀️</span >
41- <span class =" theme-icon moon-icon" >🌙</span >
42- </button >
43-
44- <button class =" mobile-menu-toggle" aria-label =" Toggle mobile menu" >
39+ <div class =" nav-actions" >
40+ <button class =" theme-toggle-nav" aria-label =" Toggle theme" >
41+ <span class =" theme-icon sun-icon" >☀️</span >
42+ <span class =" theme-icon moon-icon" >🌙</span >
43+ </button >
44+
45+ <button class =" mobile-menu-toggle" aria-label =" Toggle mobile menu" id =" mobile-menu-toggle" >
4546 <svg width =" 24" height =" 24" viewBox =" 0 0 24 24" fill =" none" stroke =" currentColor" stroke-width =" 2" >
4647 <path d =" M3 12h18M3 6h18M3 18h18" />
4748 </svg >
48- </button >
49+ </button >
50+ </div >
4951 </div >
5052 </nav >
5153 </div >
@@ -77,6 +79,15 @@ const navItems = [
7779 padding: 0.5rem 1.5rem;
7880 pointer-events: auto;
7981 transition: all 0.3s ease;
82+ width: 100%;
83+ max-width: 90%;
84+ }
85+
86+ @media (min-width: 768px) {
87+ .floating-nav {
88+ width: auto;
89+ max-width: none;
90+ }
8091 }
8192
8293 html.dark .floating-nav {
@@ -99,6 +110,7 @@ const navItems = [
99110 align-items: center;
100111 gap: 2rem;
101112 height: auto;
113+ justify-content: space-between;
102114 }
103115
104116 .logo-link {
@@ -144,6 +156,61 @@ const navItems = [
144156 }
145157 }
146158
159+ .nav-actions {
160+ display: flex;
161+ gap: 0.5rem;
162+ align-items: center;
163+ }
164+
165+ @media (max-width: 767px) {
166+ .floating-nav {
167+ padding: 0.5rem 1rem;
168+ }
169+
170+ .floating-nav.menu-open {
171+ border-radius: 1.5rem;
172+ padding: 1rem 1.5rem;
173+ }
174+
175+ .nav-content {
176+ flex-wrap: wrap;
177+ gap: 1rem;
178+ }
179+
180+ .nav-links {
181+ position: absolute;
182+ top: 100%;
183+ left: 0;
184+ right: 0;
185+ flex-direction: column;
186+ background: rgba(255, 255, 255, 0.95);
187+ backdrop-filter: blur(20px) saturate(180%);
188+ -webkit-backdrop-filter: blur(20px) saturate(180%);
189+ padding: 1rem 0;
190+ margin-top: 0.5rem;
191+ border-radius: 1rem;
192+ border: 1px solid rgba(255, 255, 255, 0.5);
193+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 2px 4px rgba(255, 255, 255, 0.5);
194+ }
195+
196+ html.dark .nav-links {
197+ background: rgba(30, 30, 30, 0.95);
198+ border: 1px solid rgba(255, 255, 255, 0.2);
199+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.1);
200+ }
201+
202+ .nav-links.show {
203+ display: flex;
204+ }
205+
206+ .nav-actions {
207+ display: flex;
208+ gap: 0.5rem;
209+ align-items: center;
210+ margin-left: auto;
211+ }
212+ }
213+
147214 .nav-link {
148215 color: var(--color-text-secondary);
149216 font-weight: 500;
@@ -248,4 +315,31 @@ const navItems = [
248315 html.classList.add(newTheme);
249316 localStorage.setItem('theme', newTheme);
250317 });
318+
319+ // Mobile menu toggle functionality
320+ const mobileMenuToggle = document.getElementById('mobile-menu-toggle');
321+ const navLinks = document.getElementById('nav-links');
322+ const floatingNav = document.querySelector('.floating-nav');
323+
324+ mobileMenuToggle?.addEventListener('click', () => {
325+ navLinks?.classList.toggle('show');
326+ floatingNav?.classList.toggle('menu-open');
327+ });
328+
329+ // Close mobile menu when clicking outside
330+ document.addEventListener('click', (e) => {
331+ if (!floatingNav?.contains(e.target)) {
332+ navLinks?.classList.remove('show');
333+ floatingNav?.classList.remove('menu-open');
334+ }
335+ });
336+
337+ // Close mobile menu when clicking on a link
338+ const navLinkElements = document.querySelectorAll('.nav-link');
339+ navLinkElements.forEach(link => {
340+ link.addEventListener('click', () => {
341+ navLinks?.classList.remove('show');
342+ floatingNav?.classList.remove('menu-open');
343+ });
344+ });
251345</script >
0 commit comments