首页卡牌样式

This commit is contained in:
tangly
2021-11-07 10:03:41 +08:00
parent a413d85b65
commit e8392ee033
2 changed files with 4 additions and 4 deletions

View File

@@ -5,11 +5,11 @@ import React from 'react'
const BlogPostCard = ({ post }) => {
return (
<div key={post.id} className='2xl:flex animate__animated animate__fadeIn animate__faster shadow-card border dark:border-gray-600 my-2 w-full 2xl:max-w-2xl bg-white bg-opacity-80 dark:bg-gray-800 dark:hover:bg-gray-700 overflow-hidden'>
<div key={post.id} className='2xl:flex animate__animated animate__fadeIn animate__faster shadow-2xl border dark:border-gray-600 my-2 w-full 2xl:max-w-2xl bg-white bg-opacity-80 dark:bg-gray-800 dark:hover:bg-gray-700 overflow-hidden'>
{/* 封面图 */}
{post.page_cover && post.page_cover.length > 1 && (
<Link href={`${BLOG.path}/article/${post.slug}`} className='md:flex-shrink-0 md:w-52 md:h-52 rounded-lg'>
<img className='w-full 2xl:w-80 2xl:h-full h-60 object-cover cursor-pointer transform hover:scale-110 duration-500' src={post.page_cover} alt={post.title} />
<img className='w-full 2xl:w-80 2xl:h-full object-cover cursor-pointer transform hover:scale-110 duration-500' src={post.page_cover} alt={post.title} />
</Link>
)}
@@ -24,7 +24,7 @@ const BlogPostCard = ({ post }) => {
<span className='mt-2 mx-2 text-gray-500 dark:text-gray-300 text-sm leading-4'>{post.date.start_date}</span>
</div>
<div className='flex'> {post.tags.map(tag => (<TagItemMini key={tag} tag={tag} />))}</div>
<p className='mt-2 text-gray-500 dark:text-gray-300 text-sm'>{post.summary}</p>
<p className='mt-2 text-gray-500 dark:text-gray-400 text-sm'>{post.summary}</p>
</div>
</div>
)

View File

@@ -72,7 +72,7 @@ const BlogPostListScroll = ({ posts = [], tags, currentSearch, currentCategory,
)}
{/* 文章列表 */}
<div className='grid 3xl:grid-cols-3 xl:grid-cols-2 grid-cols-1 gap-5'>
<div className='grid 3xl:grid-cols-3 2xl:grid-cols-2 grid-cols-1 gap-5'>
{postsToShow.map(post => (
<BlogPostCard key={post.id} post={post} />
))}