Skip to content

Commit 52c844a

Browse files
style: redesign navbar, add better dropdowns, improve layout
1 parent 3e797c5 commit 52c844a

File tree

1 file changed

+41
-22
lines changed

1 file changed

+41
-22
lines changed

src/components/Common/Header.tsx

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,23 @@ export const Header: React.FC = () => {
7575

7676
const userInfo = user?.lichessId ? (
7777
<div
78-
className="relative flex w-full items-center gap-3 rounded bg-background-1 px-3 py-2 md:w-auto"
78+
className="relative flex items-center gap-2 rounded-full bg-background-1/50 px-3 py-1.5 transition-all duration-200 hover:bg-background-1"
7979
onMouseEnter={() => setShowProfileDropdown(true)}
8080
onMouseLeave={() => setShowProfileDropdown(false)}
8181
>
82-
<span className="material-symbols-outlined text-3xl">account_circle</span>
83-
<div className="flex flex-col">
84-
<p className="text-sm">{user?.displayName}</p>
85-
<p className="text-xs text-secondary">View Info</p>
86-
</div>
82+
<span className="material-symbols-outlined text-xl text-primary/80">
83+
account_circle
84+
</span>
85+
<span className="text-sm font-medium text-primary/90">
86+
{user?.displayName}
87+
</span>
88+
<motion.i
89+
className="material-symbols-outlined text-sm text-primary/60"
90+
animate={{ rotate: showProfileDropdown ? 180 : 0 }}
91+
transition={{ duration: 0.2 }}
92+
>
93+
arrow_drop_down
94+
</motion.i>
8795
<AnimatePresence>
8896
{showProfileDropdown && (
8997
<motion.div
@@ -126,13 +134,24 @@ export const Header: React.FC = () => {
126134
<Image src="/maia.png" width={40} height={40} alt="Maia Logo" />
127135
<h2 className="text-2xl font-bold">Maia Chess</h2>
128136
</Link>
129-
<div className="hidden flex-row gap-1 *:px-2 *:py-1 md:flex">
137+
<div className="hidden flex-row gap-1 text-sm tracking-wider md:flex">
130138
<div
131-
className={`${router.pathname.startsWith('/play') && 'bg-background-1'} relative`}
139+
className="relative"
132140
onMouseEnter={() => setShowPlayDropdown(true)}
133141
onMouseLeave={() => setShowPlayDropdown(false)}
134142
>
135-
<button className="uppercase">Play</button>
143+
<button
144+
className={`-gap-1 flex items-center px-2 py-1 transition-all duration-200 hover:!text-primary ${router.pathname.startsWith('/play') ? '!text-primary' : '!text-primary/80'}`}
145+
>
146+
<p>PLAY</p>
147+
<motion.i
148+
className="material-symbols-outlined text-sm"
149+
animate={{ rotate: showPlayDropdown ? 180 : 0 }}
150+
transition={{ duration: 0.2 }}
151+
>
152+
arrow_drop_down
153+
</motion.i>
154+
</button>
136155
<AnimatePresence>
137156
{showPlayDropdown && (
138157
<motion.div
@@ -168,43 +187,43 @@ export const Header: React.FC = () => {
168187
</div>
169188
<Link
170189
href="/analysis"
171-
className={`${router.pathname.startsWith('/analysis') ? 'bg-background-1' : ''} uppercase hover:bg-background-1`}
190+
className={`px-2 py-1 transition-all duration-200 hover:!text-primary ${router.pathname.startsWith('/analysis') ? '!text-primary' : '!text-primary/80'}`}
172191
>
173-
Analysis
192+
ANALYSIS
174193
</Link>
175194
<Link
176195
href="/puzzles"
177-
className={`${router.pathname.startsWith('/puzzles') ? 'bg-background-1' : ''} uppercase hover:bg-background-1`}
196+
className={`px-2 py-1 transition-all duration-200 hover:!text-primary ${router.pathname.startsWith('/puzzles') ? '!text-primary' : '!text-primary/80'}`}
178197
>
179-
Puzzles
198+
PUZZLES
180199
</Link>
181200
<Link
182201
href="/openings"
183-
className={`${router.pathname.startsWith('/openings') ? 'bg-background-1' : ''} uppercase hover:bg-background-1`}
202+
className={`px-2 py-1 transition-all duration-200 hover:!text-primary ${router.pathname.startsWith('/openings') ? '!text-primary' : '!text-primary/80'}`}
184203
>
185-
Openings
204+
OPENINGS
186205
</Link>
187206
<Link
188207
href="/turing"
189-
className={`${router.pathname.startsWith('/turing') ? 'bg-background-1' : ''} uppercase hover:bg-background-1`}
208+
className={`px-2 py-1 transition-all duration-200 hover:!text-primary ${router.pathname.startsWith('/turing') ? '!text-primary' : '!text-primary/80'}`}
190209
>
191-
Bot-or-Not
210+
BOT-OR-NOT
192211
</Link>
193212
<Link
194213
href="/leaderboard"
195-
className={`${router.pathname.startsWith('/leaderboard') ? 'bg-background-1' : ''} uppercase hover:bg-background-1`}
214+
className={`px-2 py-1 transition-all duration-200 hover:!text-primary ${router.pathname.startsWith('/leaderboard') ? '!text-primary' : '!text-primary/80'}`}
196215
>
197-
Leaderboard
216+
LEADERBOARD
198217
</Link>
199218
<div
200219
className="relative"
201220
onMouseEnter={() => setShowMoreDropdown(true)}
202221
onMouseLeave={() => setShowMoreDropdown(false)}
203222
>
204-
<button className="-gap-1 flex items-center">
205-
<p className="uppercase">More</p>
223+
<button className="-gap-1 flex items-center px-2 py-1 !text-primary/80 transition-all duration-200 hover:!text-primary">
224+
<p>MORE</p>
206225
<motion.i
207-
className="material-symbols-outlined"
226+
className="material-symbols-outlined text-sm"
208227
animate={{ rotate: showMoreDropdown ? 180 : 0 }}
209228
transition={{ duration: 0.2 }}
210229
>

0 commit comments

Comments
 (0)