@@ -10,127 +10,92 @@ const Navbar: React.FC = () => {
1010 const { toggleTheme, mode } = themeContext ;
1111
1212 return (
13- < nav className = "bg-white text-black dark:bg-gray-800 dark:text-white shadow-lg" >
13+ < nav className = "bg-gradient-to-br from-indigo-100 to-slate-100 dark:from-blue-950 dark:to-gray-900 text-black dark:text-white border-b-2 border-blue-300 shadow-lg" >
14+ { /* Top Nav */ }
1415 < div className = "container mx-auto px-6 py-4 flex justify-between items-center" >
15- { /* Logo Section */ }
16+ { /* Logo */ }
1617 < Link
1718 to = "/"
18- className = "text-2xl font-bold hover:text-gray-300 cursor-pointer flex items-center"
19+ className = "text-2xl font-bold hover:text-gray-500 dark:hover:text-gray-300 flex items-center"
1920 >
2021 < img src = "/crl-icon.png" alt = "CRL Icon" className = "h-8 mr-2" />
2122 GitHub Tracker
2223 </ Link >
2324
2425 { /* Desktop Links */ }
25- < div className = "hidden md:flex space-x-6" >
26- < Link
27- to = "/"
28- className = "text-lg font-medium hover:text-gray-300 transition-all px-2 py-1 border border-transparent hover:border-gray-400 rounded"
29- >
30- Home
31- </ Link >
32- < Link
33- to = "/about"
34- className = "text-lg font-medium hover:text-gray-300 transition-all px-2 py-1 border border-transparent hover:border-gray-400 rounded"
35- >
36- About
37- </ Link >
38- < Link
39- to = "/contact"
40- className = "text-lg font-medium hover:text-gray-300 transition-all px-2 py-1 border border-transparent hover:border-gray-400 rounded"
41- >
42- Contact
43- </ Link >
44- < Link
45- to = "/contributors"
46- className = "text-lg font-medium hover:text-gray-300 transition-all px-2 py-1 border border-transparent hover:border-gray-400 rounded"
47- >
48- Contributors
49- </ Link >
50- < Link
51- to = "/login"
52- className = "text-lg font-medium hover:text-gray-300 transition-all px-2 py-1 border border-transparent hover:border-gray-400 rounded"
53- >
54- Login
55- </ Link >
26+ < div className = "hidden md:flex space-x-6 items-center" >
27+ { [ "/" , "/about" , "/contact" , "/contributors" , "/login" ] . map ( ( path , idx ) => {
28+ const labels = [ "Home" , "About" , "Contact" , "Contributors" , "Login" ] ;
29+ return (
30+ < Link
31+ key = { path }
32+ to = { path }
33+ className = "text-lg font-medium hover:text-gray-600 dark:hover:text-gray-300 transition px-2 py-1 border border-transparent hover:border-gray-400 rounded"
34+ >
35+ { labels [ idx ] }
36+ </ Link >
37+ ) ;
38+ } ) }
39+
40+ { /* Theme Toggle */ }
5641 < button
5742 onClick = { toggleTheme }
58- className = "text-sm font-semibold px-3 py-1 rounded border border-gray-500 hover:text-gray-300 hover:border-gray-300 transition duration-200"
43+ className = "text-sm font-semibold px-3 py-1 rounded border border-gray-500 dark:border-gray-400 hover:text-gray-700 dark: hover:text-gray-300 hover:border-gray-300 transition duration-200"
5944 >
6045 { mode === "dark" ? "🌞 Light" : "🌙 Dark" }
6146 </ button >
6247 </ div >
6348
64- { /* Mobile Menu Button */ }
49+ { /* Mobile Hamburger */ }
6550 < div className = "md:hidden" >
6651 < button
6752 onClick = { ( ) => setIsOpen ( ! isOpen ) }
68- className = "relative w-8 h-8 flex flex-col space-y-[5px] items-center group focus:outline-none"
53+ className = "w-8 h-8 flex flex-col justify-between items-center focus:outline-none"
6954 >
7055 < span
71- className = { `block h-[3px] w-full bg-white rounded-lg transition-transform duration-300 ${
56+ className = { `block h-[3px] w-full bg-black dark:bg- white rounded transition-transform duration-300 ${
7257 isOpen ? "rotate-45 translate-y-2" : ""
7358 } `}
74- > </ span >
59+ / >
7560 < span
76- className = { `block h-[3px] w-full bg-white rounded-lg transition-opacity duration-300 ${
61+ className = { `block h-[3px] w-full bg-black dark:bg- white rounded transition-opacity duration-300 ${
7762 isOpen ? "opacity-0" : ""
7863 } `}
79- > </ span >
64+ / >
8065 < span
81- className = { `block h-[3px] w-full bg-white rounded-lg transition-transform duration-300 ${
66+ className = { `block h-[3px] w-full bg-black dark:bg- white rounded transition-transform duration-300 ${
8267 isOpen ? "-rotate-45 -translate-y-2" : ""
8368 } `}
84- > </ span >
69+ / >
8570 </ button >
8671 </ div >
8772 </ div >
8873
89- { /* Mobile Links */ }
74+ { /* Mobile Dropdown Menu */ }
9075 { isOpen && (
91- < div className = "md:hidden bg-gray-800" >
92- < div className = "space-y-4 px-6 py-4" >
93- < Link
94- to = "/home"
95- className = "block text-lg font-medium hover:text-gray-300 transition-all px-2 py-1 border border-transparent hover:border-gray-400 rounded"
96- onClick = { ( ) => setIsOpen ( false ) }
97- >
98- Home
99- </ Link >
100- < Link
101- to = "/about"
102- className = "block text-lg font-medium hover:text-gray-300 transition-all px-2 py-1 border border-transparent hover:border-gray-400 rounded"
103- onClick = { ( ) => setIsOpen ( false ) }
104- >
105- About
106- </ Link >
107- < Link
108- to = "/contact"
109- className = "block text-lg font-medium hover:text-gray-300 transition-all px-2 py-1 border border-transparent hover:border-gray-400 rounded"
110- onClick = { ( ) => setIsOpen ( false ) }
111- >
112- Contact
113- </ Link >
114- < Link
115- to = "/contributors"
116- className = "block text-lg font-medium hover:text-gray-300 transition-all px-2 py-1 border border-transparent hover:border-gray-400 rounded"
117- onClick = { ( ) => setIsOpen ( false ) }
118- >
119- Contributors
120- </ Link >
121- < Link
122- to = "/login"
123- className = "block text-lg font-medium hover:text-gray-300 transition-all px-2 py-1 border border-transparent hover:border-gray-400 rounded"
124- onClick = { ( ) => setIsOpen ( false ) }
125- >
126- Login
127- </ Link >
76+ < div className = "md:hidden bg-gradient-to-br from-indigo-100 to-slate-100 dark:from-blue-950 dark:to-gray-900 text-black dark:text-white" >
77+ < div className = "space-y-4 px-6 py-6" >
78+ { [ "/" , "/about" , "/contact" , "/contributors" , "/login" ] . map ( ( path , idx ) => {
79+ const labels = [ "Home" , "About" , "Contact" , "Contributors" , "Login" ] ;
80+ return (
81+ < Link
82+ key = { path }
83+ to = { path }
84+ onClick = { ( ) => setIsOpen ( false ) }
85+ className = "block text-lg font-medium hover:text-gray-700 dark:hover:text-gray-300 transition px-2 py-1 border border-transparent hover:border-gray-400 rounded"
86+ >
87+ { labels [ idx ] }
88+ </ Link >
89+ ) ;
90+ } ) }
91+
92+ { /* Theme Toggle */ }
12893 < button
12994 onClick = { ( ) => {
13095 toggleTheme ( ) ;
13196 setIsOpen ( false ) ;
13297 } }
133- className = "text-sm font-semibold px-3 py-1 rounded border border-gray-500 hover:text-gray-300 hover:border-gray-300 transition duration-200 w-full text-left "
98+ className = "text-sm font-semibold px-3 py-1 w-xl text-left rounded border border-gray-500 dark:border-gray-400 hover:text-gray-700 dark:hover:text-gray- 300 hover:border-gray-300 transition duration-200"
13499 >
135100 { mode === "dark" ? "🌞 Light" : "🌙 Dark" }
136101 </ button >
0 commit comments