Skip to content

Commit b98e442

Browse files
committed
init
1 parent 0ef7c78 commit b98e442

2 files changed

Lines changed: 24 additions & 10 deletions

File tree

src/components/Header.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,16 @@ const Header = () => {
7171

7272
{/* Desktop Navigation */}
7373
<div className="hidden md:flex items-center space-x-8">
74-
<a href="#features" className="text-muted-foreground hover:text-primary transition-colors">
74+
<a href="#features" className="text-muted-foreground hover:text-primary transition-colors whitespace-nowrap min-w-[80px] text-center">
7575
{t('nav.features')}
7676
</a>
77-
<a href="#comparison" className="text-muted-foreground hover:text-primary transition-colors">
77+
<a href="#comparison" className="text-muted-foreground hover:text-primary transition-colors whitespace-nowrap min-w-[120px] text-center">
7878
{t('nav.comparison')}
7979
</a>
80-
<a href="#quickstart" className="text-muted-foreground hover:text-primary transition-colors">
80+
<a href="#quickstart" className="text-muted-foreground hover:text-primary transition-colors whitespace-nowrap min-w-[100px] text-center">
8181
{t('nav.quickstart')}
8282
</a>
83-
<a href="https://doc.fluxmq.com" target="_blank" rel="noopener noreferrer" className="text-muted-foreground hover:text-primary transition-colors">
83+
<a href="https://doc.fluxmq.com" target="_blank" rel="noopener noreferrer" className="text-muted-foreground hover:text-primary transition-colors whitespace-nowrap min-w-[100px] text-center">
8484
{t('nav.documentation')}
8585
</a>
8686
</div>
@@ -90,9 +90,9 @@ const Header = () => {
9090
{/* Language Selector */}
9191
<DropdownMenu>
9292
<DropdownMenuTrigger asChild>
93-
<Button variant="ghost" className="flex items-center space-x-2">
93+
<Button variant="ghost" className="flex items-center space-x-2 min-w-[80px] justify-center">
9494
<Globe className="h-4 w-4" />
95-
<span className="text-sm">{getCurrentLanguage()}</span>
95+
<span className="text-sm whitespace-nowrap">{getCurrentLanguage()}</span>
9696
<ChevronDown className="h-3 w-3" />
9797
</Button>
9898
</DropdownMenuTrigger>
@@ -136,16 +136,16 @@ const Header = () => {
136136
<Card className="md:hidden mt-4 bg-card/95 backdrop-blur-sm border-border/50">
137137
<CardContent className="p-4">
138138
<div className="flex flex-col space-y-4">
139-
<a href="#features" className="text-muted-foreground hover:text-primary transition-colors py-2">
139+
<a href="#features" className="text-muted-foreground hover:text-primary transition-colors py-2 whitespace-nowrap">
140140
{t('nav.features')}
141141
</a>
142-
<a href="#comparison" className="text-muted-foreground hover:text-primary transition-colors py-2">
142+
<a href="#comparison" className="text-muted-foreground hover:text-primary transition-colors py-2 whitespace-nowrap">
143143
{t('nav.comparison')}
144144
</a>
145-
<a href="#quickstart" className="text-muted-foreground hover:text-primary transition-colors py-2">
145+
<a href="#quickstart" className="text-muted-foreground hover:text-primary transition-colors py-2 whitespace-nowrap">
146146
{t('nav.quickstart')}
147147
</a>
148-
<a href="https://doc.fluxmq.com" target="_blank" rel="noopener noreferrer" className="text-muted-foreground hover:text-primary transition-colors py-2">
148+
<a href="https://doc.fluxmq.com" target="_blank" rel="noopener noreferrer" className="text-muted-foreground hover:text-primary transition-colors py-2 whitespace-nowrap">
149149
{t('nav.documentation')}
150150
</a>
151151

src/index.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@
1818
body {
1919
transition: none !important;
2020
}
21+
22+
/* 防止导航栏晃动 */
23+
header {
24+
transition: none !important;
25+
}
26+
27+
nav {
28+
transition: none !important;
29+
}
30+
31+
/* 确保导航项不会因为文本变化而改变布局 */
32+
.nav-item {
33+
transition: none !important;
34+
}
2135

2236
--card: 222 47% 6%;
2337
--card-foreground: 210 40% 98%;

0 commit comments

Comments
 (0)