Skip to content

Commit 53eb385

Browse files
Merge pull request steam-bell-92#567 from nishtha-agarwal-211/fix/decorative-code-overlapping-474
fix(navbar): restore floating island layout and mobile hamburger menu
2 parents b9e46fe + 2cc2ac7 commit 53eb385

1 file changed

Lines changed: 44 additions & 17 deletions

File tree

web-app/index.html

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -842,10 +842,10 @@
842842
</a>
843843
<div aria-hidden="true" class="cursor-glow" id="cursorGlow"></div>
844844
<!-- 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">
849849
<a class="logo-wrap" href="#">
850850
<!-- LOGO IMAGE -->
851851
<img alt="PyMini Logo" class="navbar-logo" src="assets/logo.png"/>
@@ -861,20 +861,19 @@
861861
</span>
862862
</a>
863863
</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>
874872
</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>
878877
</button>
879878
<button aria-selected="false" class="feature-badge tab" data-category="utilities" role="tab" tabindex="-1">
880879
<span class="feature-icon"><i data-lucide="lock"></i></span>
@@ -1473,6 +1472,34 @@ <h3>Stay Updated</h3>
14731472
}
14741473
});
14751474
});
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+
});
14761503
</script>
14771504
</body>
14781505
</html>

0 commit comments

Comments
 (0)