mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-13 23:16:47 +00:00
starter 加快首屏
This commit is contained in:
@@ -4,7 +4,8 @@ import { siteConfig } from '@/lib/config'
|
||||
/**
|
||||
* 英雄大图区块
|
||||
*/
|
||||
export const Hero = () => {
|
||||
export const Hero = props => {
|
||||
const CONFIG = props?.NOTION_CONFIG || CONFIG
|
||||
return (
|
||||
<>
|
||||
{/* <!-- ====== Hero Section Start --> */}
|
||||
@@ -19,37 +20,49 @@ export const Hero = () => {
|
||||
data-wow-delay='.2s'>
|
||||
{/* 主标题 */}
|
||||
<h1 className='mb-6 text-3xl font-bold leading-snug text-white sm:text-4xl sm:leading-snug lg:text-5xl lg:leading-[1.2]'>
|
||||
{siteConfig('STARTER_HERO_TITLE_1')}
|
||||
{siteConfig('STARTER_HERO_TITLE_1', null, CONFIG)}
|
||||
</h1>
|
||||
{/* 次标题 */}
|
||||
<p className='mx-auto mb-9 max-w-[600px] text-base font-medium text-white sm:text-lg sm:leading-[1.44]'>
|
||||
{siteConfig('STARTER_HERO_TITLE_2')}
|
||||
{siteConfig('STARTER_HERO_TITLE_2', null, CONFIG)}
|
||||
</p>
|
||||
{/* 按钮组 */}
|
||||
<ul className='mb-10 flex flex-wrap items-center justify-center gap-5'>
|
||||
{siteConfig('STARTER_HERO_BUTTON_1_TEXT') && (
|
||||
{siteConfig('STARTER_HERO_BUTTON_1_TEXT', null, CONFIG) && (
|
||||
<li>
|
||||
<a
|
||||
href={siteConfig('STARTER_HERO_BUTTON_1_URL')}
|
||||
className='inline-flex items-center justify-center rounded-md bg-white px-7 py-[14px] text-center text-base font-medium text-dark shadow-1 transition duration-300 ease-in-out hover:bg-gray-2 hover:text-body-color'>
|
||||
{siteConfig('STARTER_HERO_BUTTON_1_TEXT')}
|
||||
{siteConfig('STARTER_HERO_BUTTON_1_TEXT', null, CONFIG)}
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
{siteConfig('STARTER_HERO_BUTTON_2_TEXT') && (
|
||||
{siteConfig('STARTER_HERO_BUTTON_2_TEXT', null, CONFIG) && (
|
||||
<li>
|
||||
<a
|
||||
href={siteConfig('STARTER_HERO_BUTTON_2_URL')}
|
||||
href={siteConfig(
|
||||
'STARTER_HERO_BUTTON_2_URL',
|
||||
null,
|
||||
CONFIG
|
||||
)}
|
||||
target='_blank'
|
||||
className='flex items-center rounded-md bg-white/[0.12] px-6 py-[14px] text-base font-medium text-white transition duration-300 ease-in-out hover:bg-white hover:text-dark'
|
||||
rel='noreferrer'>
|
||||
{siteConfig('STARTER_HERO_BUTTON_2_ICON') && (
|
||||
{siteConfig(
|
||||
'STARTER_HERO_BUTTON_2_ICON',
|
||||
null,
|
||||
CONFIG
|
||||
) && (
|
||||
<img
|
||||
className='mr-4'
|
||||
src={siteConfig('STARTER_HERO_BUTTON_2_ICON')}
|
||||
src={siteConfig(
|
||||
'STARTER_HERO_BUTTON_2_ICON',
|
||||
null,
|
||||
CONFIG
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
{siteConfig('STARTER_HERO_BUTTON_2_TEXT')}
|
||||
{siteConfig('STARTER_HERO_BUTTON_2_TEXT', null, CONFIG)}
|
||||
</a>
|
||||
</li>
|
||||
)}
|
||||
@@ -58,7 +71,7 @@ export const Hero = () => {
|
||||
</div>
|
||||
|
||||
{/* 产品预览图片 */}
|
||||
{siteConfig('STARTER_HERO_PREVIEW_IMAGE') && (
|
||||
{siteConfig('STARTER_HERO_PREVIEW_IMAGE', null, CONFIG) && (
|
||||
<div className='w-full px-4'>
|
||||
<div
|
||||
className='wow fadeInUp relative z-10 mx-auto max-w-[845px]'
|
||||
@@ -66,9 +79,13 @@ export const Hero = () => {
|
||||
<div className='mt-16'>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
src={siteConfig('STARTER_HERO_PREVIEW_IMAGE')}
|
||||
alt={siteConfig('TITLE')}
|
||||
title={siteConfig('TITLE')}
|
||||
src={siteConfig(
|
||||
'STARTER_HERO_PREVIEW_IMAGE',
|
||||
null,
|
||||
CONFIG
|
||||
)}
|
||||
alt={siteConfig('TITLE', null, CONFIG)}
|
||||
title={siteConfig('TITLE', null, CONFIG)}
|
||||
className='mx-auto max-w-full rounded-t-xl rounded-tr-xl'
|
||||
/>
|
||||
</div>
|
||||
@@ -87,11 +104,16 @@ export const Hero = () => {
|
||||
</div>
|
||||
</div>
|
||||
{/* 横幅图片 */}
|
||||
{siteConfig('STARTER_HERO_BANNER_IMAGE') && (
|
||||
{siteConfig('STARTER_HERO_BANNER_IMAGE', null, CONFIG) && (
|
||||
<div className='container'>
|
||||
<LazyImage
|
||||
priority
|
||||
className='w-full'
|
||||
src={siteConfig('STARTER_HERO_BANNER_IMAGE')}></LazyImage>
|
||||
src={siteConfig(
|
||||
'STARTER_HERO_BANNER_IMAGE',
|
||||
null,
|
||||
CONFIG
|
||||
)}></LazyImage>
|
||||
</div>
|
||||
)}
|
||||
{/* <!-- ====== Hero Section End --> */}
|
||||
|
||||
@@ -25,7 +25,6 @@ import CONFIG from './config'
|
||||
import { Style } from './style'
|
||||
// import { MadeWithButton } from './components/MadeWithButton'
|
||||
import Comment from '@/components/Comment'
|
||||
import LoadingCover from '@/components/LoadingCover'
|
||||
import ShareBar from '@/components/ShareBar'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import { loadWowJS } from '@/lib/plugins/wow'
|
||||
@@ -85,25 +84,26 @@ const LayoutIndex = props => {
|
||||
const posts = props?.allNavPages ? props.allNavPages.slice(0, count) : []
|
||||
return (
|
||||
<>
|
||||
<LoadingCover />
|
||||
{/* 英雄区 */}
|
||||
{siteConfig('STARTER_HERO_ENABLE') && <Hero />}
|
||||
{siteConfig('STARTER_HERO_ENABLE', true, CONFIG) && <Hero {...props} />}
|
||||
{/* 合作伙伴 */}
|
||||
{siteConfig('STARTER_BRANDS_ENABLE') && <Brand />}
|
||||
{siteConfig('STARTER_BRANDS_ENABLE', true, CONFIG) && <Brand />}
|
||||
{/* 产品特性 */}
|
||||
{siteConfig('STARTER_FEATURE_ENABLE') && <Features />}
|
||||
{siteConfig('STARTER_FEATURE_ENABLE', true, CONFIG) && <Features />}
|
||||
{/* 关于 */}
|
||||
{siteConfig('STARTER_ABOUT_ENABLE') && <About />}
|
||||
{siteConfig('STARTER_ABOUT_ENABLE', true, CONFIG) && <About />}
|
||||
{/* 价格 */}
|
||||
{siteConfig('STARTER_PRICING_ENABLE') && <Pricing />}
|
||||
{siteConfig('STARTER_PRICING_ENABLE', true, CONFIG) && <Pricing />}
|
||||
{/* 评价展示 */}
|
||||
{siteConfig('STARTER_TESTIMONIALS_ENABLE') && <Testimonials />}
|
||||
{siteConfig('STARTER_TESTIMONIALS_ENABLE', true, CONFIG) && (
|
||||
<Testimonials />
|
||||
)}
|
||||
{/* 常见问题 */}
|
||||
{siteConfig('STARTER_FAQ_ENABLE') && <FAQ />}
|
||||
{siteConfig('STARTER_FAQ_ENABLE', true, CONFIG) && <FAQ />}
|
||||
{/* 团队介绍 */}
|
||||
{siteConfig('STARTER_TEAM_ENABLE') && <Team />}
|
||||
{siteConfig('STARTER_TEAM_ENABLE', true, CONFIG) && <Team />}
|
||||
{/* 博文列表 */}
|
||||
{siteConfig('STARTER_BLOG_ENABLE') && (
|
||||
{siteConfig('STARTER_BLOG_ENABLE', true, CONFIG) && (
|
||||
<>
|
||||
<Blog posts={posts} />
|
||||
<div className='container mx-auto flex justify-end mb-4'>
|
||||
@@ -115,10 +115,10 @@ const LayoutIndex = props => {
|
||||
</>
|
||||
)}
|
||||
{/* 联系方式 */}
|
||||
{siteConfig('STARTER_CONTACT_ENABLE') && <Contact />}
|
||||
{siteConfig('STARTER_CONTACT_ENABLE', true, CONFIG) && <Contact />}
|
||||
|
||||
{/* 行动呼吁 */}
|
||||
{siteConfig('STARTER_CTA_ENABLE') && <CTA />}
|
||||
{siteConfig('STARTER_CTA_ENABLE', true, CONFIG) && <CTA />}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user