mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-15 15:09:25 +00:00
82 lines
3.7 KiB
JavaScript
82 lines
3.7 KiB
JavaScript
/* eslint-disable @next/next/no-img-element */
|
|
import LazyImage from '@/components/LazyImage'
|
|
import { siteConfig } from '@/lib/config'
|
|
import Link from 'next/link'
|
|
|
|
/**
|
|
* 博文列表
|
|
* @param {*} param0
|
|
* @returns
|
|
*/
|
|
export const Blog = ({ posts }) => {
|
|
return (
|
|
<>
|
|
{/* <!-- ====== Blog Section Start --> */}
|
|
<section className='bg-white pt-20 dark:bg-dark lg:pt-[120px]'>
|
|
<div className='container mx-auto'>
|
|
{/* 区块标题文字 */}
|
|
<div className='-mx-4 flex flex-wrap justify-center wow fadeInUp' data-wow-delay='.2s'>
|
|
<div className='w-full px-4 py-4'>
|
|
<div className='mx-auto max-w-[485px] text-center space-y-4'>
|
|
<span className='px-3 py-0.5 rounded-2xl mb-2 dark:bg-dark-1 border border-gray-200 dark:border-[#333333] dark:text-white'>
|
|
{siteConfig('PROXIO_BLOG_TITLE')}
|
|
</span>
|
|
|
|
<h2 className='text-3xl font-bold text-dark dark:text-white sm:text-4xl md:text-[40px] md:leading-[1.2]'>
|
|
{siteConfig('PROXIO_BLOG_TEXT_1')}
|
|
</h2>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/* 博客列表 此处优先展示3片文章 */}
|
|
<div className='-mx-4 grid md:grid-cols-2 grid-cols-1'>
|
|
{posts?.map((item, index) => {
|
|
return (
|
|
<div key={index} className='w-full px-4'>
|
|
<div
|
|
className='wow fadeInUp group mb-10 relative overflow-hidden'
|
|
data-wow-delay='.1s'>
|
|
<div className='relative rounded-xl border overflow-hidden shadow-md dark:border-gray-700 dark:bg-gray-800'>
|
|
{item.pageCoverThumbnail && (
|
|
<Link href={item?.href} className='block'>
|
|
{/* 图片半透明 */}
|
|
<LazyImage
|
|
src={item.pageCoverThumbnail}
|
|
alt={item.title}
|
|
className='w-full h-80 object-cover transition-transform duration-500 rounded-xl'
|
|
/>
|
|
</Link>
|
|
)}
|
|
{/* 遮罩层,仅覆盖图片部分 */}
|
|
<div className='absolute inset-0 bg-gray-100 dark:bg-hexo-black-gray transition-all duration-500 group-hover:opacity-50 group-hover:bg-black' />
|
|
{/* 鼠标悬停时显示的文字内容 */}
|
|
<div className='absolute inset-0 flex items-center justify-center group-hover:scale-110 duration-200 group-hover:text-white'>
|
|
<p className='max-w-[370px] text-base text-body-color dark:text-dark-6 flex items-center justify-center duration-200 group-hover:text-white '>
|
|
{item.summary}
|
|
</p></div>
|
|
</div>
|
|
{/* 内容部分 */}
|
|
<div className='relative z-10 p-4'>
|
|
<span className='inline-blocktext-center text-xs font-medium leading-loose text-white'>
|
|
{item.publishDay}
|
|
</span>
|
|
<h3>
|
|
<Link
|
|
href={item?.href}
|
|
className='mb-4 inline-block text-xl font-semibold text-dark hover:text-primary dark:text-white dark:hover:text-primary sm:text-2xl lg:text-xl xl:text-2xl'>
|
|
{item.title}
|
|
</Link>
|
|
</h3>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
})}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
{/* <!-- ====== Blog Section End --> */}
|
|
</>
|
|
)
|
|
} |