From d11d71ccaf334f1acd7a39c1c5481de52afe5f27 Mon Sep 17 00:00:00 2001 From: mahakagarwal7 Date: Wed, 10 Jun 2026 14:29:46 +0530 Subject: [PATCH] UI: Refactor Tools mega menu for better architecture and neobrutalist aesthetic (#22) --- frontend/src/components/shared/Navbar.jsx | 180 +++++++++++----------- frontend/src/index.css | 15 ++ 2 files changed, 103 insertions(+), 92 deletions(-) diff --git a/frontend/src/components/shared/Navbar.jsx b/frontend/src/components/shared/Navbar.jsx index bd70e86..290b132 100644 --- a/frontend/src/components/shared/Navbar.jsx +++ b/frontend/src/components/shared/Navbar.jsx @@ -106,6 +106,9 @@ function Chevron({ open, className = "" }) { // ─── Desktop Mega Menu Panel ─────────────────────────────────────────────────── function MegaMenuPanel({ megaRef, onMouseEnter, onMouseLeave, onClose, megaTriggerRef, firstMenuItemRef, }) { + const coreTools = MEGA_MENU_ITEMS.filter((item) => !item.submenu); + const contestArsenal = MEGA_MENU_ITEMS.find((item) => item.submenu); + return (
- {/* Single thin top accent — replaces aggressive border-4 */} -
- -
- {/* Section label */} -

- AI-Powered Tools — GSSoC '26 -

- - {/* Item grid — gap-px with bg-zinc-100 creates razor-thin dividers */} -
- {MEGA_MENU_ITEMS.map((item) => { - const hasSubmenu = item.submenu && item.submenu.length > 0; - - // ── Contest Arsenal: full-width with nested submenu ──────────── - if (hasSubmenu) { +
+ {/* Left Pane: Core Tools */} +
+ {/* Subtle grid pattern background to look premium */} +
+ +

+ Core Arsenal +

+
+ {coreTools.map((item, idx) => { + const Wrapper = item.to ? Link : "div"; + const wrapperProps = item.to ? { to: item.to, onClick: onClose } : {}; + return ( -
- {/* Parent header */} -
-
- {item.icon} - {item.label} - + +
+ {/* Icon wrapper */} +
+ + {item.icon} +
-

- {item.desc} -

+ + {item.label} + +
- {/* Submenu grid */} -
- {item.submenu.map((sub) => ( - -
- {sub.icon} - - {sub.label} - -
-

- {sub.desc} -

- - ))} -
-
+

+ {item.desc} +

+ ); - } - - // ── Standard grid item ───────────────────────────────────────── - const Wrapper = item.to ? Link : "div"; - const wrapperProps = item.to ? { to: item.to, onClick: onClose } : {}; - - return ( - +
+ + {/* Right Pane: Contest Arsenal */} +
+

+ Contest Solutions +

+
+ {contestArsenal.submenu.map((sub) => ( + -
- {item.icon} - {item.label} - + + {sub.icon} + +
+ + {sub.label} + +

+ {sub.desc} +

-

- {item.desc} -

- - ); - })} + + ))} +
+
- {/* Footer strip */} -
- - More tools shipping soon - - - View All → - -
+ {/* Footer strip */} +
+ + Explore all integrations + + + → +
); @@ -628,17 +624,17 @@ export default function Navbar() { onClick={() => setExpandedSubmenu(isExpanded ? null : item.label) } - className="w-full text-left px-7 py-3 bg-zinc-900 text-white flex items-center justify-between" + className="w-full text-left px-7 py-4 bg-zinc-50 hover:bg-zinc-100 text-zinc-800 flex items-center justify-between transition-colors" >
{item.icon} - + {item.label}
-

+

{item.desc}

@@ -646,15 +642,15 @@ export default function Navbar() { {isExpanded && ( -
+
{item.submenu.map((sub) => ( - {sub.icon} + {sub.icon}

{sub.label} @@ -679,7 +675,7 @@ export default function Navbar() {

-

{item.desc}

+

{item.desc}

); diff --git a/frontend/src/index.css b/frontend/src/index.css index 108ce24..f99a505 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -9,3 +9,18 @@ body { font-family: 'Inter', sans-serif; } + +@keyframes dropdown-enter { + 0% { + opacity: 0; + transform: translate(-50%, -12px) scale(0.98); + } + 100% { + opacity: 1; + transform: translate(-50%, 0) scale(1); + } +} + +.animate-dropdown { + animation: dropdown-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; +}