Skip to content

Commit 7d808a1

Browse files
fix(home): 社区版块改紧凑横向布局,修复稀疏难读
原版照搬归档的高卡片:3 宽栏配短描述 + flex-1 把链接顶到底,中间大片留白、 阅读性差。改成横向紧凑卡:NET 编号左置基线对齐,标题内联箭头,描述紧跟其下, 去掉强制拉伸和底部空白,描述对比度提到 neutral-300。内容自然高度、不再空旷。
1 parent 2eb00f4 commit 7d808a1

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

app/components/Hero.tsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Link from "next/link";
22
import { Suspense } from "react";
3+
import { ArrowRight } from "lucide-react";
34
import { getTranslations } from "next-intl/server";
45
import ZoteroFeedLazy from "@/app/components/ZoteroFeedLazy";
56
import { Contribute } from "@/app/components/Contribute";
@@ -163,31 +164,33 @@ export async function Hero() {
163164
<li
164165
key={s.title}
165166
className={cn(
166-
"group border-b border-[var(--foreground)] md:border-r last:border-r-0 h-full",
167+
"group border-b border-[var(--foreground)] md:border-r last:border-r-0",
167168
idx === 2 && "md:border-r-0",
168169
)}
169170
>
170171
<a
171172
href={s.href}
172173
target="_blank"
173174
rel="noopener noreferrer"
174-
className="p-8 hover:bg-neutral-100 dark:hover:bg-neutral-900 transition-colors h-full flex flex-col hard-shadow-hover"
175+
className="flex items-baseline gap-4 p-6 hover:bg-neutral-100 dark:hover:bg-neutral-900 transition-colors hard-shadow-hover"
175176
data-umami-event="community_click"
176177
data-umami-event-target={s.key}
177178
data-umami-event-location="hero"
178179
>
179-
<div className="font-mono text-[10px] text-neutral-400 mb-4">
180+
<span className="font-mono text-[10px] text-neutral-400 pt-1 shrink-0">
180181
NET-0{idx + 1}
181-
</div>
182-
<div className="text-2xl font-serif font-bold mb-2 uppercase text-[var(--foreground)]">
183-
{s.title}
184-
</div>
185-
<p className="text-sm font-body text-neutral-600 dark:text-neutral-400 flex-1 leading-relaxed">
186-
{s.desc}
187-
</p>
188-
<div className="mt-6 font-sans text-[10px] uppercase tracking-widest font-bold text-[var(--foreground)] group-hover:text-[#CC0000]">
189-
Visit &rarr;
190-
</div>
182+
</span>
183+
<span className="min-w-0">
184+
<span className="flex items-center gap-2 mb-1.5">
185+
<span className="text-xl font-serif font-bold uppercase text-[var(--foreground)]">
186+
{s.title}
187+
</span>
188+
<ArrowRight className="h-4 w-4 shrink-0 text-neutral-400 group-hover:translate-x-1 group-hover:text-[#CC0000] transition-all" />
189+
</span>
190+
<span className="block text-sm font-body text-neutral-600 dark:text-neutral-300 leading-relaxed">
191+
{s.desc}
192+
</span>
193+
</span>
191194
</a>
192195
</li>
193196
))}

0 commit comments

Comments
 (0)