|
85 | 85 | display: flex; |
86 | 86 | justify-content: flex-end; |
87 | 87 | align-items: center; |
88 | | - gap: 10px; |
| 88 | + gap: 6px; |
89 | 89 | position: relative; |
90 | 90 | } |
91 | 91 |
|
92 | | - .nav-center a, .nav-center .dropbtn { |
| 92 | + .nav-center .nav-link { |
93 | 93 | text-decoration: none; |
94 | 94 | color: var(--text-muted); |
95 | 95 | font-weight: 600; |
|
102 | 102 | border: none; |
103 | 103 | cursor: pointer; |
104 | 104 | font-family: 'Inter', sans-serif; |
105 | | - display: flex; |
| 105 | + display: inline-flex; |
106 | 106 | align-items: center; |
107 | 107 | gap: 5px; |
108 | 108 | } |
109 | 109 |
|
110 | | - .nav-center a:hover, .nav-center .dropbtn:hover, .nav-center .dropdown:hover .dropbtn { |
| 110 | + .nav-center .nav-link:hover, .nav-center .dropdown:hover > .nav-link { |
111 | 111 | color: var(--accent-blue); |
112 | 112 | } |
113 | 113 |
|
|
122 | 122 | transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1); |
123 | 123 | z-index: 1; |
124 | 124 | box-shadow: 0 0 10px rgba(0, 210, 255, 0.5); |
| 125 | + pointer-events: none; |
125 | 126 | } |
126 | 127 |
|
127 | 128 | /* DROPDOWN APPS */ |
|
340 | 341 | </div> |
341 | 342 | <div class="nav-center" id="navCenter"> |
342 | 343 | <div class="nav-indicator" id="navIndicator"></div> |
343 | | - <a href="/" class="nav-item nav-link {% if page.url == '/' %}active-page{% endif %}">Hub</a> |
344 | | - <a href="/newsy" class="nav-item nav-link {% if page.url contains 'newsy' %}active-page{% endif %}">Newsy</a> |
345 | | - <a href="/blog" class="nav-item nav-link {% if page.url contains 'blog' %}active-page{% endif %}">Blog</a> |
346 | | - <a href="/homelab" class="nav-item nav-link {% if page.url contains 'homelab' %}active-page{% endif %}">HomeLab</a> |
347 | | - <a href="/sponsors" class="nav-item nav-link {% if page.url contains 'sponsors' %}active-page{% endif %}">Sponsors</a> |
| 344 | + <a href="/" class="nav-link {% if page.url == '/' %}active-page{% endif %}">Hub</a> |
| 345 | + <a href="/newsy" class="nav-link {% if page.url contains 'newsy' %}active-page{% endif %}">Newsy</a> |
| 346 | + <a href="/blog" class="nav-link {% if page.url contains 'blog' %}active-page{% endif %}">Blog</a> |
| 347 | + <a href="/homelab" class="nav-link {% if page.url contains 'homelab' %}active-page{% endif %}">HomeLab</a> |
| 348 | + <a href="/sponsors" class="nav-link {% if page.url contains 'sponsors' %}active-page{% endif %}">Sponsors</a> |
348 | 349 |
|
349 | | - <div class="dropdown nav-item nav-link"> |
350 | | - <button class="dropbtn">Apps ▾</button> |
| 350 | + <div class="dropdown nav-link" style="padding: 0;"> |
| 351 | + <a href="#" class="nav-link dropbtn" onclick="return false;">Apps ▾</a> |
351 | 352 | <div class="dropdown-content"> |
352 | 353 | <div class="dropdown-links-wrapper"> |
353 | 354 | <a href="/orbit">Orbit <span>↗</span></a> |
|
362 | 363 | </div> |
363 | 364 | </div> |
364 | 365 |
|
365 | | - <a href="/benchmarks" class="nav-item nav-link {% if page.url contains 'benchmarks' %}active-page{% endif %}">Benchmarks</a> |
366 | | - <a href="/kontakt" class="nav-item nav-link {% if page.url contains 'kontakt' %}active-page{% endif %}">Kontakt</a> |
| 366 | + <a href="/benchmarks" class="nav-link {% if page.url contains 'benchmarks' %}active-page{% endif %}">Benchmarks</a> |
| 367 | + <a href="/kontakt" class="nav-link {% if page.url contains 'kontakt' %}active-page{% endif %}">Kontakt</a> |
367 | 368 | </div> |
368 | 369 | </nav> |
369 | 370 |
|
@@ -456,30 +457,42 @@ <h4>Follow DevLabStudy</h4> |
456 | 457 | <script> |
457 | 458 | const navCenter = document.getElementById('navCenter'); |
458 | 459 | const indicator = document.getElementById('navIndicator'); |
459 | | - const navItems = navCenter.querySelectorAll('.nav-item'); |
460 | | - const activeItem = navCenter.querySelector('.active-page') || navItems[0]; |
| 460 | + const navLinks = navCenter.querySelectorAll(':scope > .nav-link'); |
| 461 | + const activeLink = navCenter.querySelector('.active-page') || navLinks[0]; |
461 | 462 |
|
462 | 463 | function moveIndicator(el) { |
463 | 464 | if (!el) return; |
464 | 465 | indicator.style.width = el.offsetWidth + 'px'; |
465 | 466 | indicator.style.left = el.offsetLeft + 'px'; |
466 | 467 | } |
467 | 468 |
|
468 | | - moveIndicator(activeItem); |
| 469 | + const savedLeft = sessionStorage.getItem('nav_indicator_left'); |
| 470 | + const savedWidth = sessionStorage.getItem('nav_indicator_width'); |
| 471 | + |
| 472 | + if (savedLeft !== null && savedWidth !== null) { |
| 473 | + indicator.style.transition = 'none'; |
| 474 | + indicator.style.left = savedLeft; |
| 475 | + indicator.style.width = savedWidth; |
| 476 | + void indicator.offsetHeight; |
| 477 | + indicator.style.transition = ''; |
| 478 | + moveIndicator(activeLink); |
| 479 | + } else { |
| 480 | + moveIndicator(activeLink); |
| 481 | + } |
469 | 482 |
|
470 | | - navItems.forEach(item => { |
471 | | - item.addEventListener('click', () => { |
472 | | - sessionStorage.setItem('nav_indicator_left', item.offsetLeft + 'px'); |
473 | | - sessionStorage.setItem('nav_indicator_width', item.offsetWidth + 'px'); |
| 483 | + navLinks.forEach(link => { |
| 484 | + link.addEventListener('click', () => { |
| 485 | + sessionStorage.setItem('nav_indicator_left', link.offsetLeft + 'px'); |
| 486 | + sessionStorage.setItem('nav_indicator_width', link.offsetWidth + 'px'); |
474 | 487 | }); |
475 | 488 |
|
476 | | - item.addEventListener('mouseenter', () => { |
477 | | - moveIndicator(item); |
| 489 | + link.addEventListener('mouseenter', () => { |
| 490 | + moveIndicator(link); |
478 | 491 | }); |
479 | 492 | }); |
480 | 493 |
|
481 | 494 | navCenter.addEventListener('mouseleave', () => { |
482 | | - moveIndicator(activeItem); |
| 495 | + moveIndicator(activeLink); |
483 | 496 | }); |
484 | 497 | </script> |
485 | 498 | </body> |
|
0 commit comments