夜间模式适配,移除react-canvas-nest,CPU消耗有点高

This commit is contained in:
tangly1024
2021-11-01 14:48:52 +08:00
parent 2412bc65f9
commit 6562b6a341
6 changed files with 23 additions and 27 deletions

View File

@@ -4,8 +4,7 @@ import Link from 'next/link'
const BlogPost = ({ post }) => {
return (
<article key={post.id}
className='animate__animated animate__slideInUp animate__faster inline-block border dark:border-gray-600 my-2 w-full md:max-w-md bg-white dark:bg-gray-700 dark:hover:bg-gray-600 overflow-hidden'>
<div key={post.id} className='z-10 animate__animated animate__slideInUp animate__faster inline-block border dark:border-gray-600 my-2 w-full md:max-w-md bg-white bg-opacity-80 dark:bg-gray-700 dark:hover:bg-gray-600 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'>
@@ -14,9 +13,8 @@ const BlogPost = ({ post }) => {
)}
<div className='px-8 py-6'>
<Link href={`${BLOG.path}/article/${post.slug}`}
className='block my-3 text-2xl leading-tight font-bold text-black dark:text-gray-100 hover:underline'>
{post.title}
<Link href={`${BLOG.path}/article/${post.slug}`}>
<div className='cursor-pointer my-3 text-2xl leading-tight font-bold text-black dark:text-gray-100 hover:underline'>{post.title}</div>
</Link>
<div className='flex flex-nowrap'>
{post.tags.map(tag => (<TagItemMini key={tag} tag={tag} />))}
@@ -24,7 +22,7 @@ const BlogPost = ({ post }) => {
</div>
<p className='mt-2 text-gray-500 dark:text-gray-300 text-sm'>{post.summary}</p>
</div>
</article>
</div>
)
}