Skip to content

Commit a79a52c

Browse files
authored
fixed contrast issues in navbar (JhaSourav07#2215)
## Description This PR overhauls the CommitPulse navbar to resolve readability and contrast issues in light mode while elevating the overall premium aesthetic across both themes. Key changes include: Improved Contrast: Darkened the navbar shell background slightly and transitioned text/icons to highly legible dark grays in light mode for better WCAG accessibility. Refined Visual Hierarchy: Converted secondary actions ("Compare", "Customization Studio") into sleek ghost links to reduce boxy visual clutter, while emphasizing the "GitHub Repo" button as the distinct primary action. Modern Flourishes: Added a subtle text gradient to the "CommitPulse" logo and tactile micro-interactions (slight upward lifts, icon rotations) on hover states. Accessibility (a11y): Implemented comprehensive focus-visible rings across all interactive elements for robust keyboard navigation support. Fixes JhaSourav07#912 ## Pillar - [ ] 🎨 Pillar 1 — New Theme Design - [ ] 📐 Pillar 2 — Geometric SVG Improvement - [ ] 🕐 Pillar 3 — Timezone Logic Optimization - [ x ] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview before: <img width="1580" height="159" alt="Screenshot 2026-05-28 145415" src="https://github.com/user-attachments/assets/6cc54d84-89ac-4ea6-8a22-db5d0022e83a" /> after: <img width="1503" height="99" alt="Screenshot 2026-06-01 100802" src="https://github.com/user-attachments/assets/1661f804-4f0c-4748-a2cc-521c217ffdb4" /> <img width="1403" height="116" alt="Screenshot 2026-06-01 102633" src="https://github.com/user-attachments/assets/559b3157-21bf-42b7-bcb7-6a11580d5577" /> ## Checklist before requesting a review: - [ x ] I have read the `CONTRIBUTING.md` file. - [ x ] I have tested these changes locally (`localhost:3000/api/streak?user=YOUR_USERNAME`). - [ x ] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will fail otherwise). - [ x ] My commits follow the Conventional Commits format (e.g., `feat(themes): ...`, `fix(calculate): ...`). - [ ] I have updated `README.md` if I added a new theme or URL parameter. - [ x ] I have started the repo. - [ x ] I have made sure that i have only one commit to merge in this PR. - [ x ] The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts). - [ x ] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
2 parents 16f372a + ab25bb9 commit a79a52c

2 files changed

Lines changed: 106 additions & 48 deletions

File tree

app/components/navbar.tsx

Lines changed: 75 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ const NAV_LINKS = [
1919
label: 'Compare',
2020
href: '/compare',
2121
isExternal: false,
22+
isPrimary: false,
2223
},
2324
{
2425
label: 'Customization Studio',
2526
href: '/#customization-studio',
2627
isExternal: false,
28+
isPrimary: false,
2729
},
2830
{
2931
label: 'GitHub Repo',
3032
href: 'https://github.com/JhaSourav07/commitpulse',
3133
isExternal: true,
34+
isPrimary: true,
3235
},
3336
];
3437

@@ -75,131 +78,166 @@ export default function Navbar() {
7578
<div className="mx-auto max-w-6xl">
7679
<div
7780
ref={shellRef}
78-
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"
81+
className="relative overflow-hidden rounded-2xl border border-gray-200/80 bg-white/80 dark:border-white/20 dark:bg-[#0a0a0a]/60 backdrop-blur-xl shadow-sm dark:shadow-[0_8px_30px_rgba(0,0,0,0.8)] transition-all duration-300"
7982
style={shellVars}
8083
onMouseEnter={handleMouseEnter}
8184
onMouseMove={handleMouseMove}
8285
onMouseLeave={handleMouseLeave}
8386
>
87+
{/* Glow effects remain untouched */}
8488
<div
8589
className="pointer-events-none absolute inset-0 transition-opacity duration-300 ease-out hidden dark:block"
8690
style={{
8791
opacity: 'var(--glow-opacity)',
8892
background:
89-
'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%)',
93+
'radial-gradient(180px 105px at var(--mx) var(--my), rgba(255,255,255,0.20), rgba(191,219,254,0.12) 30%, rgba(244,114,182,0.08) 48%, rgba(0,0,0,0) 68%)',
9094
}}
9195
/>
92-
<div className="pointer-events-none absolute inset-0 rounded-2xl border border-black/5 dark:border-white/20" />
96+
<div className="pointer-events-none absolute inset-0 rounded-2xl border border-black/5 dark:border-white/10" />
9397
<div
9498
className="pointer-events-none absolute inset-0 rounded-2xl p-px transition-opacity duration-300 ease-out hidden dark:block"
9599
style={{
96100
opacity: 'var(--border-opacity)',
97101
background:
98-
'radial-gradient(150px 90px at var(--mx) var(--my), rgba(255,255,255,0.98), rgba(186,230,253,0.64) 32%, rgba(196,181,253,0.34) 50%, rgba(0,0,0,0) 68%)',
102+
'radial-gradient(150px 90px at var(--mx) var(--my), rgba(255,255,255,0.8), rgba(186,230,253,0.5) 32%, rgba(196,181,253,0.2) 50%, rgba(0,0,0,0) 68%)',
99103
WebkitMask: 'linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)',
100104
WebkitMaskComposite: 'xor',
101105
maskComposite: 'exclude',
102106
}}
103107
/>
108+
104109
<nav className="relative flex items-center justify-between px-4 py-3 sm:px-6">
105110
<Link
106111
href="/"
107112
aria-label="Go to home"
108-
className="group inline-flex items-center gap-3"
113+
className="group inline-flex items-center gap-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 rounded-xl dark:focus-visible:ring-gray-300 dark:focus-visible:ring-offset-[#0a0a0a]"
109114
onClick={handleLogoClick}
110115
>
111-
<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">
112-
<Activity size={19} />
116+
<span className="flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br from-gray-100 to-gray-200 border border-gray-300 text-gray-800 shadow-sm dark:border-white/20 dark:from-white/10 dark:to-white/5 dark:text-white transition-transform duration-300 group-hover:scale-105 group-hover:shadow-md">
117+
<Activity
118+
size={19}
119+
className="transition-transform duration-300 group-hover:rotate-6"
120+
/>
113121
</span>
114-
<span className="text-base font-semibold tracking-[0.08em] text-gray-900 dark:text-white sm:text-lg">
122+
{/* Added Text Gradient here */}
123+
<span className="text-base font-bold tracking-wide bg-clip-text text-transparent bg-gradient-to-r from-gray-900 to-gray-600 dark:from-white dark:to-gray-400 sm:text-lg">
115124
CommitPulse
116125
</span>
117126
</Link>
118127

119-
<div className="hidden items-center gap-3 md:flex">
128+
<div className="hidden items-center gap-2 md:flex">
129+
{NAV_LINKS.map((link) => (
130+
<a
131+
key={link.href}
132+
href={link.href}
133+
target={link.isExternal ? '_blank' : undefined}
134+
rel={link.isExternal ? 'noopener noreferrer' : undefined}
135+
className={`inline-flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-[#0a0a0a] ${
136+
link.isPrimary
137+
? 'rounded-xl bg-gray-900 text-white shadow-md hover:bg-gray-800 hover:-translate-y-0.5 hover:shadow-lg dark:bg-white dark:text-gray-900 dark:hover:bg-gray-200 dark:hover:shadow-[0_4px_20px_rgba(255,255,255,0.2)] focus-visible:ring-gray-900 dark:focus-visible:ring-white ml-2'
138+
: 'rounded-lg text-gray-600 hover:text-gray-900 hover:bg-gray-100/80 dark:text-gray-300 dark:hover:text-white dark:hover:bg-white/10 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500'
139+
}`}
140+
>
141+
{link.isExternal && <GithubMark />}
142+
{link.label}
143+
</a>
144+
))}
145+
146+
{/* Separator line between links and theme toggle */}
147+
<div className="mx-2 h-6 w-px bg-gray-200 dark:bg-white/15" />
148+
120149
<button
121150
type="button"
122151
onClick={toggleTheme}
123-
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"
152+
className="group inline-flex h-10 w-10 items-center justify-center rounded-xl text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 dark:text-gray-400 dark:hover:bg-white/10 dark:hover:text-white dark:focus-visible:ring-gray-400 dark:focus-visible:ring-offset-[#0a0a0a]"
124153
aria-label="Toggle theme"
125154
>
126155
{mounted ? (
127156
isDark ? (
128-
<Moon size={18} />
157+
<Moon
158+
size={18}
159+
className="transition-transform duration-300 group-hover:-rotate-12"
160+
/>
129161
) : (
130-
<Sun size={18} />
162+
<Sun
163+
size={18}
164+
className="transition-transform duration-300 group-hover:rotate-45"
165+
/>
131166
)
132167
) : (
133168
<span className="w-[18px] h-[18px]" />
134169
)}
135170
</button>
136-
137-
{NAV_LINKS.map((link) => (
138-
<a
139-
key={link.href}
140-
href={link.href}
141-
target={link.isExternal ? '_blank' : undefined}
142-
rel={link.isExternal ? 'noopener noreferrer' : undefined}
143-
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"
144-
>
145-
{link.isExternal && <GithubMark />}
146-
{link.label}
147-
</a>
148-
))}
149171
</div>
150172

151-
<div className="md:hidden inline-flex items-center justify-center gap-2">
173+
{/* Mobile Menu Buttons */}
174+
<div className="md:hidden inline-flex items-center justify-center gap-1">
152175
<button
153176
type="button"
154177
onClick={toggleTheme}
155-
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"
178+
className="group hidden sm:inline-flex h-10 w-10 items-center justify-center rounded-xl text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 dark:text-gray-400 dark:hover:bg-white/10 dark:hover:text-white"
156179
aria-label="Toggle theme"
157180
>
158181
{mounted ? (
159182
isDark ? (
160-
<Moon size={18} />
183+
<Moon
184+
size={18}
185+
className="transition-transform duration-300 group-hover:-rotate-12"
186+
/>
161187
) : (
162-
<Sun size={18} />
188+
<Sun
189+
size={18}
190+
className="transition-transform duration-300 group-hover:rotate-45"
191+
/>
163192
)
164193
) : (
165194
<span className="w-[18px] h-[18px]" />
166195
)}
167196
</button>
168197
<button
169198
type="button"
170-
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"
199+
className="md:hidden inline-flex items-center justify-center rounded-xl p-2 text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 dark:text-gray-400 dark:hover:bg-white/10 dark:hover:text-white"
171200
aria-label={open ? 'Close menu' : 'Open menu'}
172201
aria-expanded={open}
173202
onClick={() => setOpen((prev) => !prev)}
174203
>
175-
{open ? <X size={20} /> : <Menu size={20} />}
204+
{open ? (
205+
<X size={20} className="transition-transform duration-300 rotate-90 scale-110" />
206+
) : (
207+
<Menu size={20} className="transition-transform duration-300 hover:scale-110" />
208+
)}
176209
</button>
177210
</div>
178211
</nav>
179212

213+
{/* Mobile Dropdown Menu */}
180214
{open ? (
181-
<div className="border-t border-gray-200 dark:border-white/10 px-4 py-3 md:hidden">
182-
<ul className="space-y-2">
215+
<div className="border-t border-gray-100 dark:border-white/10 px-4 py-4 md:hidden">
216+
<ul className="space-y-1">
183217
{NAV_LINKS.map((link) => (
184218
<li key={link.href}>
185219
<a
186220
href={link.href}
187221
target={link.isExternal ? '_blank' : undefined}
188222
rel={link.isExternal ? 'noopener noreferrer' : undefined}
189223
onClick={() => setOpen(false)}
190-
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"
224+
className={`inline-flex w-full items-center gap-3 rounded-xl px-4 py-3 text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 dark:focus-visible:ring-offset-[#0a0a0a] ${
225+
link.isPrimary
226+
? 'mt-2 bg-gray-900 text-white shadow-md hover:bg-gray-800 dark:bg-white dark:text-gray-900 dark:hover:bg-gray-200 focus-visible:ring-gray-900 dark:focus-visible:ring-white justify-center'
227+
: 'text-gray-600 hover:text-gray-900 hover:bg-gray-100/80 dark:text-gray-300 dark:hover:text-white dark:hover:bg-white/10 focus-visible:ring-gray-400 dark:focus-visible:ring-gray-500'
228+
}`}
191229
>
192230
{link.isExternal && <GithubMark />}
193231
{link.label}
194232
</a>
195233
</li>
196234
))}
197235

198-
<li className="sm:hidden pt-2 mt-2 border-t border-gray-200 dark:border-white/10">
236+
<li className="sm:hidden pt-3 mt-3 border-t border-gray-100 dark:border-white/10">
199237
<button
200238
type="button"
201239
onClick={toggleTheme}
202-
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"
240+
className="inline-flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 dark:text-gray-400 dark:hover:bg-white/10 dark:hover:text-white dark:focus-visible:ring-gray-500"
203241
aria-label="Toggle theme"
204242
>
205243
{mounted ? (
@@ -211,7 +249,7 @@ export default function Navbar() {
211249
) : (
212250
<span className="w-[18px] h-[18px]" />
213251
)}
214-
{mounted ? (isDark ? 'Light Mode' : 'Dark Mode') : 'Theme'}
252+
{mounted ? (isDark ? 'Switch to Light Mode' : 'Switch to Dark Mode') : 'Theme'}
215253
</button>
216254
</li>
217255
</ul>

0 commit comments

Comments
 (0)