From 005d8923e4fa9431936d43876be6f8dbd45bfd98 Mon Sep 17 00:00:00 2001 From: Ad-closeNN <1709301095@qq.com> Date: Sat, 2 May 2026 13:34:18 +0800 Subject: [PATCH] =?UTF-8?q?feat(theme):=20=E5=9B=BE=E7=89=87=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=8A=A8=E7=94=BB=E3=80=81Blur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PostCard.astro | 2 +- src/components/misc/ImageWrapper.astro | 6 +- src/layouts/Layout.astro | 82 ++++++++++++++++++++++++++ src/layouts/MainGridLayout.astro | 2 +- src/pages/posts/[...slug].astro | 4 +- src/styles/main.css | 44 ++++++++++++++ 6 files changed, 134 insertions(+), 6 deletions(-) diff --git a/src/components/PostCard.astro b/src/components/PostCard.astro index 35dfdcf..534125f 100644 --- a/src/components/PostCard.astro +++ b/src/components/PostCard.astro @@ -110,7 +110,7 @@ const { remarkPluginFrontmatter } = await render(entry); + class="w-full h-full" loader> } diff --git a/src/components/misc/ImageWrapper.astro b/src/components/misc/ImageWrapper.astro index 5fb3b3e..c4e0fee 100644 --- a/src/components/misc/ImageWrapper.astro +++ b/src/components/misc/ImageWrapper.astro @@ -8,12 +8,14 @@ interface Props { alt?: string; position?: string; basePath?: string; + loader?: boolean; + blur?: boolean; } import { Image } from "astro:assets"; import { url } from "../../utils/url-utils"; -const { id, src, alt, position = "center", basePath = "/" } = Astro.props; +const { id, src, alt, position = "center", basePath = "/", loader = false, blur = false } = Astro.props; const className = Astro.props.class; const isLocal = !( @@ -51,7 +53,7 @@ const originalSrc = isLocal && img ? img.src : isPublic ? url(normalizedPublicSr const originalWidth = isLocal && img ? img.width : undefined; const originalHeight = isLocal && img ? img.height : undefined; --- -
+
{isLocal && img && {alt} {!isLocal && {alt} diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index afdbe10..3e0782c 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -679,6 +679,88 @@ window.onresize = () => { } + +