@@ -32,7 +32,6 @@ export default function Navbar() {
3232
3333 const [ isDark , setIsDark ] = useState ( ( ) => {
3434 if ( typeof window === 'undefined' ) return true ;
35-
3635 return localStorage . getItem ( 'theme' ) !== 'light' ;
3736 } ) ;
3837
@@ -62,8 +61,6 @@ export default function Navbar() {
6261 }
6362 } ;
6463
65- // Defer the initial check so it doesn't cause a synchronous setState
66- // inside the effect body (which would trigger cascading re-renders).
6764 const initialCheckTimer = setTimeout ( ( ) => {
6865 if ( mediaQuery . matches ) {
6966 setOpen ( false ) ;
@@ -88,23 +85,23 @@ export default function Navbar() {
8885 < div className = "mx-auto max-w-6xl" >
8986 < div
9087 ref = { shellRef }
91- className = "relative overflow-hidden rounded-2xl border border-white/25 bg-black/45 backdrop-blur-xl shadow-[0_14px_40px_rgba(0,0,0,0.45)]"
88+ className = "relative overflow-hidden rounded-2xl border border-gray-200 bg- white/70 dark:border-white/ 25 dark: bg-black/45 backdrop-blur-xl shadow-[0_8px_30px_rgba(0,0,0,0.08)] dark:shadow-[ 0_14px_40px_rgba(0,0,0,0.45)] transition-colors duration-300 "
9289 style = { shellVars }
9390 onMouseEnter = { handleMouseEnter }
9491 onMouseMove = { handleMouseMove }
9592 onMouseLeave = { handleMouseLeave }
9693 >
9794 < div
98- className = "pointer-events-none absolute inset-0 transition-opacity duration-300 ease-out"
95+ className = "pointer-events-none absolute inset-0 transition-opacity duration-300 ease-out hidden dark:block "
9996 style = { {
10097 opacity : 'var(--glow-opacity)' ,
10198 background :
10299 'radial-gradient(180px 105px at var(--mx) var(--my), rgba(255,255,255,0.26), rgba(191,219,254,0.18) 30%, rgba(244,114,182,0.1) 48%, rgba(0,0,0,0) 68%)' ,
103100 } }
104101 />
105- < div className = "pointer-events-none absolute inset-0 rounded-2xl border border-white/20" />
102+ < div className = "pointer-events-none absolute inset-0 rounded-2xl border border-black/5 dark:border- white/20" />
106103 < div
107- className = "pointer-events-none absolute inset-0 rounded-2xl p-px transition-opacity duration-300 ease-out"
104+ className = "pointer-events-none absolute inset-0 rounded-2xl p-px transition-opacity duration-300 ease-out hidden dark:block "
108105 style = { {
109106 opacity : 'var(--border-opacity)' ,
110107 background :
@@ -121,10 +118,10 @@ export default function Navbar() {
121118 className = "group inline-flex items-center gap-3"
122119 onClick = { handleLogoClick }
123120 >
124- < span className = "flex h-10 w-10 items-center justify-center rounded-xl border border-white/35 bg-white/10 text-white shadow-[0_0_25px_rgba(255,255,255,0.22)] transition-transform duration-300 group-hover:scale-105" >
121+ < span className = "flex h-10 w-10 items-center justify-center rounded-xl border border-gray-200 bg-gray-50 text-gray-800 shadow-sm dark:border- white/35 dark: bg-white/10 dark: text-white dark: shadow-[0_0_25px_rgba(255,255,255,0.22)] transition-transform duration-300 group-hover:scale-105" >
125122 < Activity size = { 19 } />
126123 </ span >
127- < span className = "text-base font-semibold tracking-[0.08em] text-white sm:text-lg" >
124+ < span className = "text-base font-semibold tracking-[0.08em] text-gray-900 dark:text- white sm:text-lg" >
128125 CommitPulse
129126 </ span >
130127 </ Link >
@@ -133,7 +130,7 @@ export default function Navbar() {
133130 < button
134131 type = "button"
135132 onClick = { toggleTheme }
136- className = "inline-flex h-10 w-10 items-center justify-center rounded-xl border border-white/15 bg-white/5 text-white transition hover:bg-white/10"
133+ className = "inline-flex h-10 w-10 items-center justify-center rounded-xl border border-gray-200 bg-gray-50 text-gray-700 transition hover:bg-gray-100 dark:border- white/15 dark: bg-white/5 dark: text-white dark: hover:bg-white/10"
137134 aria-label = "Toggle theme"
138135 >
139136 { mounted ? (
@@ -153,7 +150,7 @@ export default function Navbar() {
153150 href = { link . href }
154151 target = { link . isExternal ? '_blank' : undefined }
155152 rel = { link . isExternal ? 'noopener noreferrer' : undefined }
156- className = "inline-flex items-center gap-2 rounded-xl border border-white/15 bg-white/5 px-4 py-2 text-sm font-medium text-white/90 transition hover:border-white/45 hover:bg-white/10"
153+ className = "inline-flex items-center gap-2 rounded-xl border border-gray-200 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-700 transition hover:border-gray-300 hover:bg-gray-100 dark:border- white/15 dark:bg-white/5 dark:text-white/90 dark: hover:border-white/45 dark: hover:bg-white/10"
157154 >
158155 { link . isExternal && < GithubMark /> }
159156 { link . label }
@@ -165,14 +162,14 @@ export default function Navbar() {
165162 < button
166163 type = "button"
167164 onClick = { toggleTheme }
168- className = "hidden sm:inline-flex h-10 w-10 items-center justify-center rounded-xl border border-white/15 bg-white/5 text-white transition hover:bg-white/10"
165+ className = "hidden sm:inline-flex h-10 w-10 items-center justify-center rounded-xl border border-gray-200 bg-gray-50 text-gray-700 transition hover:bg-gray-100 dark:border- white/15 dark: bg-white/5 dark: text-white dark: hover:bg-white/10"
169166 aria-label = "Toggle theme"
170167 >
171168 { isDark ? < Sun size = { 18 } /> : < Moon size = { 18 } /> }
172169 </ button >
173170 < button
174171 type = "button"
175- className = "md:hidden inline-flex items-center justify-center rounded-xl border border-white/15 bg-white/5 p-2 text-white/90 transition hover:bg-white/10"
172+ className = "md:hidden inline-flex items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-2 text-gray-700 transition hover:bg-gray-100 dark:border- white/15 dark: bg-white/5 dark: text-white/90 dark: hover:bg-white/10"
176173 aria-label = { open ? 'Close menu' : 'Open menu' }
177174 aria-expanded = { open }
178175 onClick = { ( ) => setOpen ( ( prev ) => ! prev ) }
@@ -183,7 +180,7 @@ export default function Navbar() {
183180 </ nav >
184181
185182 { open ? (
186- < div className = "border-t border-white/10 px-4 py-3 md:hidden" >
183+ < div className = "border-t border-gray-200 dark:border- white/10 px-4 py-3 md:hidden" >
187184 < ul className = "space-y-2" >
188185 { NAV_LINKS . map ( ( link ) => (
189186 < li key = { link . href } >
@@ -192,18 +189,19 @@ export default function Navbar() {
192189 target = { link . isExternal ? '_blank' : undefined }
193190 rel = { link . isExternal ? 'noopener noreferrer' : undefined }
194191 onClick = { ( ) => setOpen ( false ) }
195- className = "inline-flex w-full items-center gap-2 rounded-xl border border-white/15 bg-white/5 px-4 py-2 text-sm font-medium text-white/90 transition hover:border-white/45 hover:bg-white/10"
192+ className = "inline-flex w-full items-center gap-2 rounded-xl border border-gray-200 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-700 transition hover:border-gray-300 hover:bg-gray-100 dark:border- white/15 dark:bg-white/5 dark:text-white/90 dark: hover:border-white/45 dark: hover:bg-white/10"
196193 >
197194 { link . isExternal && < GithubMark /> }
198195 { link . label }
199196 </ a >
200197 </ li >
201198 ) ) }
202- < li className = "sm:hidden" >
199+
200+ < li className = "sm:hidden pt-2 mt-2 border-t border-gray-200 dark:border-white/10" >
203201 < button
204202 type = "button"
205203 onClick = { toggleTheme }
206- className = "inline-flex w-full items-center gap-2 rounded-xl border border-white/15 bg-white/5 px-4 py-2 text-sm font-medium text-white/90 transition hover:border-white/45 hover:bg-white/10"
204+ className = "inline-flex w-full items-center gap-2 rounded-xl border border-gray-200 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-700 transition hover:border-gray-300 hover:bg-gray-100 dark:border- white/15 dark:bg-white/5 dark:text-white/90 dark: hover:border-white/45 dark: hover:bg-white/10"
207205 aria-label = "Toggle theme"
208206 >
209207 { isDark ? < Sun size = { 18 } /> : < Moon size = { 18 } /> }
0 commit comments