Skip to content

Commit d56199c

Browse files
committed
refactor: redesign header to a floating pill-shaped component with updated styling and layout
1 parent 01adb00 commit d56199c

File tree

1 file changed

+60
-70
lines changed

1 file changed

+60
-70
lines changed

src/components/Landing/index.tsx

Lines changed: 60 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -67,121 +67,111 @@ export default function Landing() {
6767
<AnnouncementBanner onVisibilityChange={handleBannerVisibility} />
6868

6969
{/* Header - Dark background fading to transparent on right for corner glow, solid when scrolled */}
70+
{/* Floating Pill Header */}
7071
<header
71-
className={`fixed left-0 right-0 z-50 w-full py-3 px-4 sm:px-6 overflow-hidden transition-all duration-300 ${isScrolled ? 'backdrop-blur-xl' : ''}`}
72-
style={{ top: bannerVisible ? '44px' : '0' }}
72+
className={`fixed z-50 left-1/2 w-[95%] max-w-[1400px] transition-all duration-300 transform -translate-x-1/2 rounded-[50px] md:rounded-[70px] px-5 md:px-10 py-3 md:py-5 shadow-2xl backdrop-blur-xl bg-[#1a1a1a]/50 hover:bg-[#1a1a1a]/70 border border-white/10 ${isScrolled ? 'top-4 md:top-6' : 'top-4 md:top-6'}`}
73+
style={{ top: bannerVisible ? 'calc(44px + 1rem)' : '1rem' }}
7374
>
74-
{/* Dark-to-transparent gradient background with fading bottom edge - or solid when scrolled */}
75-
<div
76-
className="absolute inset-0 -z-10 transition-all duration-300"
77-
style={(isScrolled || isMobile) ? {
78-
background: 'rgb(10,10,10)',
79-
opacity: 0.95,
80-
boxShadow: 'inset 0 -1px 0 0 rgba(255,255,255,0.1)',
81-
} : {
82-
background: 'linear-gradient(to right, rgb(10,10,10) 0%, rgb(10,10,10) 50%, transparent 85%)',
83-
boxShadow: 'inset 0 -1px 0 0 rgba(255,255,255,0.05)',
84-
maskImage: 'linear-gradient(to right, black 0%, black 40%, transparent 70%)',
85-
WebkitMaskImage: 'linear-gradient(to right, black 0%, black 40%, transparent 70%)',
86-
}}
87-
/>
88-
<div className="w-full max-w-[90%] md:max-w-screen-2xl mx-auto flex items-center justify-between pl-0 md:pl-8">
89-
{/* Logo and Text on Left */}
90-
<div className="flex items-center gap-2">
75+
<div className="w-full flex items-center justify-between relative">
76+
77+
{/* Left: Logo */}
78+
<div className="flex items-center gap-2 shrink-0">
9179
<button
9280
type="button"
9381
onClick={() => navigate('/')}
94-
className="flex items-center gap-2 group"
82+
className="flex items-center gap-2 md:gap-3 group"
9583
aria-label="Go to home"
9684
>
97-
<svg viewBox="0 0 464 468" className="w-9 h-9 md:w-11 md:h-11">
85+
<svg viewBox="0 0 464 468" className="w-8 h-8 md:w-12 md:h-12">
9886
<path fill="white" d="M275.9 63.5c37.7 5.3 76.6 24.1 103.7 50.2 30 28.8 41.8 57.6 35.8 87.1-6.1 30.1-33.6 52.9-70.6 58.3-6 0.9-18.3 1-44.9 0.6l-36.6-0.7-0.5 17.8c-0.3 9.7-0.4 17.8-0.4 17.9 0.1 0.1 19.1 0.3 42.2 0.4 23.2 0 42.7 0.5 43.5 1 1.2 0.7 1.1 2.2-0.8 9.4-6 23-20.5 42.1-41.8 55-7.3 4.3-26.7 11.9-36 14.1-9 2-34 2-44.5 0-41.3-7.9-74.2-38-82.9-75.7-8.1-35.7 2.2-71.5 27.5-94.7 16.1-14.9 35.5-22.4 63.7-24.7l7.7-0.7v-34.1l-11.7 0.7c-22.2 1.3-37 5.3-56.4 15.2-28.7 14.6-49.7 39.3-59.9 70.2-9.6 29.3-9.3 62.6 0.8 91.4 3.3 9.2 12.2 25.6 18.3 33.8 11.3 14.9 30.6 30.8 48.7 39.9 19.9 10 49.2 15.9 73.2 14.7 26.5-1.3 52.5-9.6 74.2-23.9 26.9-17.6 47.2-47.9 53.3-79.7 1-5.2 2.3-10.1 2.8-10.8 0.8-0.9 6.9-1.2 27.1-1l26.1 0.3 0.3 3.8c1.2 14.6-10.9 52.1-23.9 74-17.8 30-43.2 54-75.9 71.5-20.9 11.2-38.3 16.5-67.2 20.7-27.6 3.9-47.9 3.1-75.8-3.1-36.9-8.3-67.8-25.6-97.1-54.6-23.6-23.2-44.8-61.9-51.7-93.8-5.1-23.7-5.5-28.1-4.9-48.8 1.7-63.2 23.4-111.8 67.7-152 28-25.4 60.4-41.3 99-48.8 18.5-3.6 46.1-4 67.9-0.9zm16.4 92.6c-6.3 2.4-12.8 8.5-15.4 14.5-2.6 6.1-2.6 18.3 0 23.9 5 11 20.2 17.7 32.3 14.1 11.9-3.4 19.8-14.3 19.8-27.1-0.1-19.9-18.2-32.5-36.7-25.4z" />
9987
</svg>
100-
<span className="text-xl md:text-2xl font-semibold text-white/90 group-hover:text-white transition-colors leading-none">
88+
<span className="text-lg md:text-[28px] font-semibold text-white/90 group-hover:text-white transition-colors leading-none tracking-tight">
10189
ClerkTree
10290
</span>
10391
</button>
92+
</div>
93+
94+
{/* Center: Navigation Links - Hidden on Mobile. Centered absolutely to ensure it's precisely in the middle */}
95+
<nav className="hidden md:flex items-center justify-center gap-12 absolute left-1/2 transform -translate-x-1/2">
10496
<button
10597
type="button"
10698
onClick={() => navigate('/blog')}
107-
className="hidden md:block ml-8 font-medium leading-none self-center bg-transparent border-none outline-none"
99+
className="font-medium bg-transparent border-none outline-none transition-colors tracking-wide"
108100
style={{
109-
fontSize: '16px',
101+
fontSize: '18px',
110102
fontFamily: 'Urbanist, sans-serif',
111-
color: 'oklch(0.9 0 0 / 0.5)',
112-
transform: 'translateY(1px)',
103+
color: 'oklch(0.9 0 0 / 0.7)',
113104
}}
114-
onMouseEnter={(e) => e.currentTarget.style.color = 'oklch(0.9 0 0 / 0.7)'}
115-
onMouseLeave={(e) => e.currentTarget.style.color = 'oklch(0.9 0 0 / 0.5)'}
105+
onMouseEnter={(e) => e.currentTarget.style.color = '#ffffff'}
106+
onMouseLeave={(e) => e.currentTarget.style.color = 'oklch(0.9 0 0 / 0.7)'}
116107
>
117108
{t('nav.blog')}
118109
</button>
119110
<button
120111
type="button"
121112
onClick={handleAboutClick}
122-
className="hidden md:block ml-8 font-medium leading-none self-center bg-transparent border-none outline-none"
113+
className="font-medium bg-transparent border-none outline-none transition-colors tracking-wide"
123114
style={{
124-
fontSize: '16px',
115+
fontSize: '18px',
125116
fontFamily: 'Urbanist, sans-serif',
126-
color: 'oklch(0.9 0 0 / 0.5)',
127-
transform: 'translateY(1px)',
117+
color: 'oklch(0.9 0 0 / 0.7)',
128118
}}
129-
onMouseEnter={(e) => e.currentTarget.style.color = 'oklch(0.9 0 0 / 0.7)'}
130-
onMouseLeave={(e) => e.currentTarget.style.color = 'oklch(0.9 0 0 / 0.5)'}
119+
onMouseEnter={(e) => e.currentTarget.style.color = '#ffffff'}
120+
onMouseLeave={(e) => e.currentTarget.style.color = 'oklch(0.9 0 0 / 0.7)'}
131121
>
132122
{t('nav.about')}
133123
</button>
134-
</div>
135-
136-
{/* Desktop Navigation Links - Hidden on Mobile */}
137-
<nav className="hidden md:flex items-center gap-2">
138124
<button
139125
onClick={() => navigate('/docs')}
140-
className="inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive border shadow-xs h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5 backdrop-blur-md bg-white/5 border-white/10 text-white/90 hover:text-white hover:bg-white/10"
126+
className="font-medium bg-transparent border-none outline-none transition-colors tracking-wide"
141127
style={{
128+
fontSize: '18px',
142129
fontFamily: 'Urbanist, sans-serif',
130+
color: 'oklch(0.9 0 0 / 0.7)',
143131
}}
132+
onMouseEnter={(e) => e.currentTarget.style.color = '#ffffff'}
133+
onMouseLeave={(e) => e.currentTarget.style.color = 'oklch(0.9 0 0 / 0.7)'}
144134
>
145135
{t('nav.docs')}
146136
</button>
147-
<div className="w-px h-8 bg-white/10 mx-2" />
148-
{/* Login Button - dark bordered style */}
137+
</nav>
138+
139+
{/* Right: Actions */}
140+
<div className="flex items-center justify-end gap-3 md:gap-5 shrink-0">
141+
{/* Language Switcher */}
142+
<div className="hidden md:block w-[75px] scale-100 origin-right">
143+
<LanguageSwitcher isExpanded={true} forceDark={true} />
144+
</div>
145+
146+
{/* CTA Book/Login Button matching the pill style */}
149147
<button
150148
onClick={() => navigate('/login')}
151-
className="inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-all h-8 rounded-md px-4"
149+
className="hidden md:flex items-center justify-center whitespace-nowrap text-[18px] font-medium transition-all h-[54px] rounded-[30px] px-10 gap-2 group"
152150
style={{
153151
fontFamily: 'Urbanist, sans-serif',
154-
background: 'rgba(255, 255, 255, 0.95)',
152+
background: 'rgba(255, 255, 255, 1)',
155153
color: 'rgb(10, 10, 10)',
156-
border: '1px solid rgba(255, 255, 255, 0.9)',
157-
}}
158-
onMouseEnter={(e) => {
159-
e.currentTarget.style.background = 'rgba(255, 255, 255, 1)';
160-
}}
161-
onMouseLeave={(e) => {
162-
e.currentTarget.style.background = 'rgba(255, 255, 255, 0.95)';
163154
}}
164155
>
165156
{t('nav.login')}
157+
<svg width="14" height="14" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" className="transform group-hover:translate-x-0.5 group-hover:-translate-y-0.5 transition-transform">
158+
<path d="M1 11L11 1M11 1H3.5M11 1V8.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
159+
</svg>
166160
</button>
167-
<div className="w-px h-8 bg-white/10 mx-2" />
168-
<div className="w-[100px]">
169-
<LanguageSwitcher isExpanded={true} forceDark={true} />
170-
</div>
171-
</nav>
172161

173-
{/* Mobile Hamburger Menu Button - Visible only on Mobile */}
174-
<button
175-
onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}
176-
className="md:hidden p-2 text-white/80 hover:text-white transition-colors"
177-
aria-label="Toggle menu"
178-
>
179-
{isMobileMenuOpen ? (
180-
<X className="w-6 h-6" />
181-
) : (
182-
<Menu className="w-6 h-6" />
183-
)}
184-
</button>
162+
{/* Mobile Hamburger Menu Button */}
163+
<button
164+
onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}
165+
className="md:hidden p-2 text-white/80 hover:text-white transition-colors ml-1"
166+
aria-label="Toggle menu"
167+
>
168+
{isMobileMenuOpen ? (
169+
<X className="w-6 h-6" />
170+
) : (
171+
<Menu className="w-6 h-6" />
172+
)}
173+
</button>
174+
</div>
185175
</div>
186176
</header>
187177

@@ -205,10 +195,10 @@ export default function Landing() {
205195
animate={{ opacity: 1, y: 0, scale: 1 }}
206196
exit={{ opacity: 0, y: -20, scale: 0.95 }}
207197
transition={{ duration: 0.2, ease: "easeOut" }}
208-
className="fixed left-4 right-4 z-50 md:hidden"
209-
style={{ top: bannerVisible ? '108px' : '64px' }}
198+
className="fixed left-1/2 transform -translate-x-1/2 w-[95%] z-50 md:hidden"
199+
style={{ top: bannerVisible ? 'calc(44px + 90px)' : '90px' }}
210200
>
211-
<div className="backdrop-blur-xl bg-black/40 border border-white/10 rounded-2xl shadow-2xl overflow-hidden ring-1 ring-white/5">
201+
<div className="backdrop-blur-xl bg-[#1a1a1a]/50 border border-white/10 rounded-[30px] shadow-2xl overflow-hidden p-2">
212202
<nav className="flex flex-col p-2">
213203
<button
214204
onClick={handleAboutClick}

0 commit comments

Comments
 (0)