muthuk1 commited on
Commit
023a6ec
·
verified ·
1 Parent(s): f4447b9

🎨 Premium navbar with page routing and mobile menu

Browse files
Files changed (1) hide show
  1. web/src/components/Navbar.tsx +113 -47
web/src/components/Navbar.tsx CHANGED
@@ -1,57 +1,123 @@
1
  "use client";
2
 
 
 
3
  import { useState } from "react";
4
 
 
 
 
 
 
 
 
 
 
5
  export function Navbar() {
 
6
  const [mobileOpen, setMobileOpen] = useState(false);
7
 
8
  return (
9
- <nav className="navbar">
10
- {/* Logo */}
11
- <div className="flex items-center gap-3">
12
- {/* Tiger spike mark */}
13
- <svg width="28" height="28" viewBox="0 0 28 28" fill="none">
14
- <circle cx="14" cy="14" r="13" stroke="#FF6B00" strokeWidth="2" />
15
- <path d="M14 4L14 24M4 14L24 14M7 7L21 21M21 7L7 21" stroke="#FF6B00" strokeWidth="1.5" strokeLinecap="round" />
16
- </svg>
17
- <span className="title-lg" style={{ color: "#002B49" }}>
18
- Graph<span style={{ color: "#FF6B00" }}>RAG</span>
19
- </span>
20
- <span className="badge-outline text-xs hidden sm:inline-flex">Hackathon</span>
21
- </div>
22
-
23
- {/* Desktop Nav */}
24
- <div className="hidden md:flex items-center gap-6">
25
- <a href="#live" className="body-sm hover:text-tiger-orange transition-colors" style={{ color: "#6c6a64" }}>Live Compare</a>
26
- <a href="#benchmark" className="body-sm hover:text-tiger-orange transition-colors" style={{ color: "#6c6a64" }}>Benchmark</a>
27
- <a href="#cost" className="body-sm hover:text-tiger-orange transition-colors" style={{ color: "#6c6a64" }}>Cost Analysis</a>
28
- <a href="#graph" className="body-sm hover:text-tiger-orange transition-colors" style={{ color: "#6c6a64" }}>Graph Explorer</a>
29
- </div>
30
-
31
- {/* CTA */}
32
- <div className="flex items-center gap-3">
33
- <span className="caption hidden lg:block" style={{ color: "#6c6a64" }}>
34
- Powered by TigerGraph + Claude
35
- </span>
36
- <button className="btn btn-primary btn-sm">
37
- Try Demo
38
- </button>
39
- </div>
40
-
41
- {/* Mobile hamburger */}
42
- <button
43
- className="btn-ghost md:hidden"
44
- onClick={() => setMobileOpen(!mobileOpen)}
45
- aria-label="Toggle menu"
46
- >
47
- <svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
48
- {mobileOpen ? (
49
- <path d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" />
50
- ) : (
51
- <path d="M3 5h14M3 10h14M3 15h14" stroke="currentColor" strokeWidth="2" strokeLinecap="round" fill="none" />
52
- )}
53
- </svg>
54
- </button>
55
- </nav>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  );
57
  }
 
1
  "use client";
2
 
3
+ import Link from "next/link";
4
+ import { usePathname } from "next/navigation";
5
  import { useState } from "react";
6
 
7
+ const NAV_LINKS = [
8
+ { href: "/", label: "Home" },
9
+ { href: "/playground", label: "Playground" },
10
+ { href: "/benchmarks", label: "Benchmarks" },
11
+ { href: "/explorer", label: "Graph Explorer" },
12
+ { href: "/architecture", label: "Architecture" },
13
+ { href: "/docs", label: "Docs" },
14
+ ];
15
+
16
  export function Navbar() {
17
+ const pathname = usePathname();
18
  const [mobileOpen, setMobileOpen] = useState(false);
19
 
20
  return (
21
+ <>
22
+ <nav className="navbar">
23
+ {/* Logo */}
24
+ <Link href="/" className="flex items-center gap-3 no-underline">
25
+ <div className="relative">
26
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none">
27
+ <circle cx="16" cy="16" r="14" stroke="#FF6B00" strokeWidth="2.5" />
28
+ <circle cx="16" cy="16" r="5" fill="#FF6B00" />
29
+ <path d="M16 2L16 30M2 16L30 16M5.5 5.5L26.5 26.5M26.5 5.5L5.5 26.5" stroke="#FF6B00" strokeWidth="1" strokeLinecap="round" opacity="0.4" />
30
+ </svg>
31
+ <div className="absolute -top-0.5 -right-0.5 w-2.5 h-2.5 rounded-full bg-success" style={{ boxShadow: '0 0 6px rgba(93,184,114,0.6)' }} />
32
+ </div>
33
+ <div>
34
+ <span className="title-lg" style={{ color: "#002B49", letterSpacing: "-0.5px" }}>
35
+ Graph<span style={{ color: "#FF6B00" }}>RAG</span>
36
+ </span>
37
+ </div>
38
+ </Link>
39
+
40
+ {/* Desktop Nav */}
41
+ <div className="hidden lg:flex items-center gap-1">
42
+ {NAV_LINKS.map((link) => {
43
+ const isActive = pathname === link.href;
44
+ return (
45
+ <Link
46
+ key={link.href}
47
+ href={link.href}
48
+ className={`nav-link ${isActive ? "nav-link-active" : ""}`}
49
+ >
50
+ {link.label}
51
+ </Link>
52
+ );
53
+ })}
54
+ </div>
55
+
56
+ {/* Right side */}
57
+ <div className="flex items-center gap-3">
58
+ <a
59
+ href="https://github.com/MUTHUKUMARAN-K-1/graphrag-inference-hackathon"
60
+ target="_blank"
61
+ rel="noopener noreferrer"
62
+ className="btn btn-ghost btn-sm hidden md:inline-flex"
63
+ style={{ gap: "6px" }}
64
+ >
65
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
66
+ <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
67
+ </svg>
68
+ GitHub
69
+ </a>
70
+ <Link href="/playground" className="btn btn-primary btn-sm">
71
+ Try Demo →
72
+ </Link>
73
+
74
+ {/* Mobile hamburger */}
75
+ <button
76
+ className="btn-ghost lg:hidden"
77
+ onClick={() => setMobileOpen(!mobileOpen)}
78
+ aria-label="Toggle menu"
79
+ >
80
+ <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round">
81
+ {mobileOpen ? (
82
+ <><line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" /></>
83
+ ) : (
84
+ <><line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="18" x2="21" y2="18" /></>
85
+ )}
86
+ </svg>
87
+ </button>
88
+ </div>
89
+ </nav>
90
+
91
+ {/* Mobile Menu */}
92
+ {mobileOpen && (
93
+ <div className="lg:hidden fixed inset-0 z-40 bg-canvas" style={{ top: "60px" }}>
94
+ <div className="flex flex-col p-6 gap-2">
95
+ {NAV_LINKS.map((link) => {
96
+ const isActive = pathname === link.href;
97
+ return (
98
+ <Link
99
+ key={link.href}
100
+ href={link.href}
101
+ onClick={() => setMobileOpen(false)}
102
+ className={`nav-link text-lg py-3 ${isActive ? "nav-link-active" : ""}`}
103
+ >
104
+ {link.label}
105
+ </Link>
106
+ );
107
+ })}
108
+ <div className="mt-4 pt-4" style={{ borderTop: "1px solid var(--color-hairline)" }}>
109
+ <a
110
+ href="https://github.com/MUTHUKUMARAN-K-1/graphrag-inference-hackathon"
111
+ target="_blank"
112
+ rel="noopener noreferrer"
113
+ className="btn btn-secondary w-full"
114
+ >
115
+ ⭐ GitHub
116
+ </a>
117
+ </div>
118
+ </div>
119
+ </div>
120
+ )}
121
+ </>
122
  );
123
  }