From 493dff4ddb60adea9db4deff09271d3a1d4e7ab5 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 19 Sep 2023 14:11:22 +0800 Subject: [PATCH] feat: short image adaptive size --- src/app/site/[site]/[slug]/page.tsx | 8 ++++---- src/components/common/PostCard.tsx | 2 +- src/components/home/PostCover.tsx | 16 +++++++++------- src/css/tailwind.css | 8 ++++++++ 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/app/site/[site]/[slug]/page.tsx b/src/app/site/[site]/[slug]/page.tsx index e79ce6aa..1c3baea3 100644 --- a/src/app/site/[site]/[slug]/page.tsx +++ b/src/app/site/[site]/[slug]/page.tsx @@ -156,22 +156,22 @@ export default async function SitePagePage({ />
{type === "short" ? ( -
+ <> {page?.metadata?.content?.title && ( -

+

{page?.metadata?.content?.title}

)}
{page?.metadata?.content?.content}
-
+ ) : ( <> {!onlyContent && ( diff --git a/src/components/common/PostCard.tsx b/src/components/common/PostCard.tsx index 1644107b..70190380 100644 --- a/src/components/common/PostCard.tsx +++ b/src/components/common/PostCard.tsx @@ -76,7 +76,7 @@ const Card = ({ uniqueKey={`${post.characterId}-${post.noteId}`} images={post.metadata?.content.images} title={post.metadata?.content?.title} - className={isShort ? "rounded-b-2xl aspect-square" : ""} + className={isShort ? "rounded-b-2xl aspect-square border-b-0" : ""} />
{images?.map((image) => ( - cover +
+ cover +
))} diff --git a/src/css/tailwind.css b/src/css/tailwind.css index d147abe5..9f6fcfd5 100644 --- a/src/css/tailwind.css +++ b/src/css/tailwind.css @@ -442,6 +442,14 @@ textarea.input { @apply flex justify-end; } +.swiper { + @apply bg-zinc-50; +} + .swiper-button { @apply absolute top-1/2 -translate-y-1/2 bg-white rounded-full z-[1] w-6 h-6 flex items-center justify-center opacity-80; } + +.swiper-wrapper { + @apply flex items-center; +} \ No newline at end of file