Redesign news article cards with clean image-first layout and proper spacing

This commit is contained in:
openhands committed 2026-07-07 19:29:22 +02:00
1 parent 4d4d9bc1cd
commit e53a9dc838
1 file changed
+16 -16
+16 -16
View File
@@ -44,19 +44,14 @@ export default async function NewsPage() {
key={a.slug} key={a.slug}
href={`/news/${a.slug}`} href={`/news/${a.slug}`}
className="card hover" className="card hover"
style={{ display: "flex", flexDirection: "column", textDecoration: "none" }} style={{
display: "flex",
flexDirection: "column",
textDecoration: "none",
padding: 0,
overflow: "hidden",
}}
> >
<div
style={{
background: "linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 10%, var(--color-navbar)), color-mix(in srgb, var(--color-primary) 5%, var(--color-navbar)))",
borderBottom: "1px solid color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
padding: "0.6rem 0.75rem",
fontSize: "0.78rem",
color: "var(--color-text-muted)",
}}
>
📰 {t("title")} &middot; {formatDate(a.createdAt)}
</div>
{a.image ? ( {a.image ? (
<img <img
src={a.image} src={a.image}
@@ -65,14 +60,19 @@ export default async function NewsPage() {
/> />
) : ( ) : (
<div <div
style={{ width: "100%", aspectRatio: "16/9", backgroundColor: "var(--color-navbar)" }} style={{ width: "100%", aspectRatio: "16/9", backgroundColor: "color-mix(in srgb, var(--color-primary) 10%, var(--color-navbar))" }}
/> />
)} )}
<div style={{ padding: "0.75rem" }}> <div style={{ padding: "1rem 1.1rem", flex: 1, display: "flex", flexDirection: "column" }}>
<h3 style={{ margin: "0 0 0.25rem", fontSize: "1rem", color: "var(--color-text)" }}> <h3 style={{ margin: 0, fontSize: "1.05rem", color: "var(--color-text)", lineHeight: 1.4 }}>
{a.title} {a.title}
</h3> </h3>
<p style={{ margin: 0, color: "var(--color-text)" }}>{excerpt(a.shortStory, 200)}</p> <p className="muted" style={{ margin: "0.35rem 0 0.6rem", fontSize: "0.78rem" }}>
{formatDate(a.createdAt)}
</p>
<p style={{ margin: 0, color: "var(--color-text)", fontSize: "0.88rem", lineHeight: 1.55 }}>
{excerpt(a.shortStory, 150)}
</p>
</div> </div>
</Link> </Link>
))} ))}