From 5fc8a9aeebcc32a89caa81e14021ab6e533b08fc Mon Sep 17 00:00:00 2001 From: xfy Date: Wed, 24 Jun 2026 15:49:53 +0800 Subject: [PATCH] =?UTF-8?q?style(card):=20=E5=8D=A1=E7=89=87=E5=B0=81?= =?UTF-8?q?=E9=9D=A2=E5=9B=BE=E6=AF=94=E4=BE=8B=E4=BB=8E=204:3=20=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=2016:9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - input.css: .blur-img.post-card-cover-blur 的 aspect-ratio 4/3 → 16/9 - post_card.rs: 缩略图请求 thumb=400x300 → 400x225 匹配 16:9 --- input.css | 6 +++--- src/components/post_card.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/input.css b/input.css index 73a1ece..14661a9 100644 --- a/input.css +++ b/input.css @@ -526,12 +526,12 @@ text-underline-offset: 0.3rem; } - /* 卡片封面:blur-img 结构,固定 4:3 比例,hover 缩放。 - 用属性选择器提升特异性,可靠覆盖 .blur-img 的 aspect-ratio: var(--ar) + /* 卡片封面:blur-img 结构,固定 16:9 比例,hover 缩放。 + 双类选择器提升特异性,可靠覆盖 .blur-img 的 aspect-ratio: var(--ar) (卡片不写 --ar,var(--ar) 解析为空会导致高度塌陷)。 */ .blur-img.post-card-cover-blur { margin: 0; - aspect-ratio: 4 / 3; + aspect-ratio: 16 / 9; } .post-card-cover-blur img { width: 100%; diff --git a/src/components/post_card.rs b/src/components/post_card.rs index 49ebd6d..0bce2c3 100644 --- a/src/components/post_card.rs +++ b/src/components/post_card.rs @@ -47,7 +47,7 @@ pub fn PostCard(post: PostListItem) -> Element { } img { class: "blur-img-full is-loaded", - src: "{cover_src}?thumb=400x300", + src: "{cover_src}?thumb=400x225", alt: "{post.title}", } }