夜间模式适配,移除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>
)
}

View File

@@ -66,7 +66,7 @@ const BlogPostListScroll = ({ posts = [], tags }) => {
if (!postsToShow || postsToShow.length === 0) {
return <BlogPostListEmpty />
} else {
return <div id='post-list-wrapper' className='pt-28 md:pt-32 px-2 md:px-20 dark:bg-gray-900' ref={targetRef}>
return <div id='post-list-wrapper' className='mt-28 md:mt-32 mx-2 md:mx-20' ref={targetRef}>
<div>
{/* 文章列表 */}
<div className='grid 2xl:grid-cols-4 xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2 grid-cols-1 gap-3'>

View File

@@ -4,7 +4,7 @@ import React from 'react'
const Logo = () => {
return <Link href='/'>
<div title={BLOG.title} className='mx-auto border text-center cursor-pointer text-xl dark:text-gray-300 font-semibold dark:hover:bg-gray-600 text-white p-2 hover:scale-105 hover:shadow-2xl duration-200 transform'>
<div title={BLOG.title} className='mx-auto border dark:border-gray-600 text-center cursor-pointer text-xl dark:text-gray-300 font-semibold dark:hover:bg-gray-600 text-white p-2 hover:scale-105 hover:shadow-2xl duration-200 transform'>
<span className='text-red-600'>Tangly</span>
<span className='text-blue-400'>1024</span>
</div>