|
842 | 842 | </a> |
843 | 843 | <div aria-hidden="true" class="cursor-glow" id="cursorGlow"></div> |
844 | 844 | <!-- Navigation --> |
845 | | - <nav aria-label="Primary" class="navbar"> |
846 | | - <div class="container nav-wrapper"> |
847 | | - <!-- LEFT --> |
848 | | - <div class="navbar-brand"> |
| 845 | +<nav aria-label="Primary" class="navbar" id="mainNavbar"> |
| 846 | +<div class="nav-island"> |
| 847 | +<!-- LEFT --> |
| 848 | +<div class="navbar-brand"> |
849 | 849 | <a class="logo-wrap" href="#"> |
850 | 850 | <!-- LOGO IMAGE --> |
851 | 851 | <img alt="PyMini Logo" class="navbar-logo" src="assets/logo.png"/> |
|
861 | 861 | </span> |
862 | 862 | </a> |
863 | 863 | </div> |
864 | | - |
865 | | - <div class="container1"> |
866 | | - <div aria-label="Project categories" class="hero-features" role="tablist"> |
867 | | -<button aria-selected="true" class="feature-badge tab active" data-category="all" role="tab" tabindex="0"> |
868 | | -<span class="feature-icon"><i data-lucide="star"></i></span> |
869 | | -<span class="feature-label">all</span> |
870 | | -</button> |
871 | | -<button aria-selected="false" class="feature-badge tab" data-category="games" role="tab" tabindex="-1"> |
872 | | -<span class="feature-icon"><i data-lucide="gamepad-2"></i></span> |
873 | | -<span class="feature-label">games</span> |
| 864 | +<!-- CENTER SEARCH --> |
| 865 | +<div class="search-box"> |
| 866 | +<i class="fas fa-search"></i> |
| 867 | +<input aria-label="Search projects" id="searchInput" placeholder="Search projects or games..." type="text"/> |
| 868 | +</div> |
| 869 | +<!-- HAMBURGER TOGGLE (mobile) --> |
| 870 | +<button type="button" class="mobile-menu-toggle" id="mobileMenuToggle" aria-label="Toggle navigation menu" aria-expanded="false"> |
| 871 | +<i class="fas fa-bars"></i> |
874 | 872 | </button> |
875 | | -<button aria-selected="false" class="feature-badge tab" data-category="math" role="tab" tabindex="-1"> |
876 | | -<span class="feature-icon"><i data-lucide="hash"></i></span> |
877 | | -<span class="feature-label">math</span> |
| 873 | +<!-- RIGHT --> |
| 874 | +<div class="nav-controls" id="navControls"> |
| 875 | +<button aria-label="Mute sounds" class="sound-toggle" id="soundToggle" type="button"> |
| 876 | +<i class="fas fa-volume-up"></i> |
878 | 877 | </button> |
879 | 878 | <button aria-selected="false" class="feature-badge tab" data-category="utilities" role="tab" tabindex="-1"> |
880 | 879 | <span class="feature-icon"><i data-lucide="lock"></i></span> |
@@ -1473,6 +1472,34 @@ <h3>Stay Updated</h3> |
1473 | 1472 | } |
1474 | 1473 | }); |
1475 | 1474 | }); |
| 1475 | + |
| 1476 | + // Handle Scroll Transitions to resize the floating layout dynamically |
| 1477 | + const mainNavbar = document.getElementById("mainNavbar"); |
| 1478 | + window.addEventListener("scroll", () => { |
| 1479 | + if (window.scrollY > 40) { |
| 1480 | + mainNavbar.classList.add("scrolled"); |
| 1481 | + } else { |
| 1482 | + mainNavbar.classList.remove("scrolled"); |
| 1483 | + } |
| 1484 | + }); |
| 1485 | + |
| 1486 | + // Mobile Navigation Controls Open/Close interface handlers |
| 1487 | + const mobileMenuToggle = document.getElementById("mobileMenuToggle"); |
| 1488 | + const navControls = document.getElementById("navControls"); |
| 1489 | + |
| 1490 | + mobileMenuToggle.addEventListener("click", () => { |
| 1491 | + const isActive = navControls.classList.toggle("mobile-active"); |
| 1492 | + mobileMenuToggle.setAttribute("aria-expanded", isActive); |
| 1493 | + mobileMenuToggle.querySelector("i").className = isActive ? "fas fa-times" : "fas fa-bars"; |
| 1494 | + }); |
| 1495 | + |
| 1496 | + document.addEventListener("click", (e) => { |
| 1497 | + if (!navControls.contains(e.target) && !mobileMenuToggle.contains(e.target) && navControls.classList.contains("mobile-active")) { |
| 1498 | + navControls.classList.remove("mobile-active"); |
| 1499 | + mobileMenuToggle.setAttribute("aria-expanded", "false"); |
| 1500 | + mobileMenuToggle.querySelector("i").className = "fas fa-bars"; |
| 1501 | + } |
| 1502 | + }); |
1476 | 1503 | </script> |
1477 | 1504 | </body> |
1478 | 1505 | </html> |
0 commit comments