Skip to content

Commit c593037

Browse files
committed
feat: 优化Hero组件按钮样式,调整内边距和字体大小
1 parent e25385d commit c593037

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

app/components/home/Hero.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,22 @@ export function Hero() {
107107
</div>
108108
</div>
109109

110-
<div className="absolute bottom-[calc(var(--spacing)*4)] left-1/2 -translate-x-1/2 z-[2] flex flex-row border border-[var(--color-fd-border)] rounded-full bg-[var(--color-fd-card)] p-1 shadow-md shadow-[var(--color-fd-background)]">
110+
<div className="absolute bottom-3 md:bottom-[calc(var(--spacing)*4)] left-1/2 -translate-x-1/2 z-[2] flex flex-row border border-[var(--color-fd-border)] rounded-full bg-[var(--color-fd-card)] p-0.5 md:p-1 shadow-md shadow-[var(--color-fd-background)] overflow-x-auto max-w-[calc(100%-2rem)] no-scrollbar">
111111
{imageNames.map((name, index) => (
112112
<button
113-
key={`title-${index}`}
114-
onClick={() => setCurrentImage(index)}
115-
className={`px-4 py-2 rounded-full text-sm font-medium transition-all ${
116-
index === currentImage
117-
? 'bg-[var(--color-fd-accent)] text-[var(--color-fd-accent-foreground)]'
118-
: 'text-[var(--color-fd-muted-foreground)] hover:bg-[var(--color-fd-secondary)] hover:text-[var(--color-fd-secondary-foreground)]'
119-
}`}
120-
aria-label={`查看${name}`}
113+
key={`title-${index}`}
114+
onClick={() => setCurrentImage(index)}
115+
className={`px-2 md:px-4 py-1 md:py-2 rounded-full text-xs md:text-sm font-medium transition-all whitespace-nowrap ${
116+
index === currentImage
117+
? 'bg-[var(--color-fd-accent)] text-[var(--color-fd-accent-foreground)]'
118+
: 'text-[var(--color-fd-muted-foreground)] hover:bg-[var(--color-fd-secondary)] hover:text-[var(--color-fd-secondary-foreground)]'
119+
}`}
120+
aria-label={`查看${name}`}
121121
>
122-
{name}
122+
{name}
123123
</button>
124124
))}
125-
</div>
125+
</div>
126126
</div>
127127
</div>
128128
</div>

0 commit comments

Comments
 (0)