From 97d700905e725ecb56f46a160faf7d492dbb2234 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Mon, 23 Sep 2024 12:34:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dstarter=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E9=83=A8=E5=88=86=E4=B8=8D=E6=94=AF=E6=8C=81inline=5F?= =?UTF-8?q?config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/starter/components/About.js | 345 +++++++++---------- themes/starter/components/BackToTopButton.js | 60 ++-- themes/starter/components/Banner.js | 44 ++- themes/starter/components/Blog.js | 7 +- themes/starter/components/Brand.js | 54 +-- themes/starter/components/CTA.js | 203 +++++------ themes/starter/components/Contact.js | 9 +- themes/starter/components/FAQ.js | 227 ++++++------ themes/starter/components/Features.js | 229 ++++++------ themes/starter/components/Footer.js | 41 +-- themes/starter/components/Hero.js | 160 +++++---- themes/starter/components/Logo.js | 7 +- themes/starter/components/MenuItem.js | 6 +- themes/starter/components/MenuList.js | 9 +- themes/starter/components/MessageForm.js | 174 +++++----- themes/starter/components/NavBar.js | 100 +++--- themes/starter/components/Pricing.js | 333 +++++++++--------- themes/starter/components/Team.js | 10 +- themes/starter/components/Testimonials.js | 19 +- themes/starter/config.js | 11 + themes/starter/index.js | 76 ++-- 21 files changed, 1025 insertions(+), 1099 deletions(-) diff --git a/themes/starter/components/About.js b/themes/starter/components/About.js index 203205db..db1192e9 100644 --- a/themes/starter/components/About.js +++ b/themes/starter/components/About.js @@ -1,195 +1,178 @@ /* eslint-disable @next/next/no-img-element */ /* eslint-disable react/no-unescaped-entities */ import { siteConfig } from '@/lib/config' -import CONFIG from '../config' /** * 首页的关于模块 */ export const About = () => { - return <> - {/* */} -
-
-
-
+ return ( + <> + {/* */} +
+
+
+
+ {/* 左侧的文字说明板块 */} +
+
+

+ {siteConfig('STARTER_ABOUT_TITLE')} +

+

- {/* 左侧的文字说明板块 */} -
-
-

- {siteConfig('STARTER_ABOUT_TITLE', null, CONFIG)} -

-

- - - {siteConfig('STARTER_ABOUT_BUTTON_TEXT', null, CONFIG)} - -
-
- - {/* 右侧的图片海报 */} -
- -
-
- about image + {/* 右侧的图片海报 */} +
+
+
+
+ about image +
-
-
- - {siteConfig('STARTER_ABOUT_TIPS_1', null, CONFIG)} - - - {siteConfig('STARTER_ABOUT_TIPS_2', null, CONFIG)} - - - {siteConfig('STARTER_ABOUT_TIPS_3', null, CONFIG)} - +
+
+ about image
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
+
+ + {siteConfig('STARTER_ABOUT_TIPS_1')} + + + {siteConfig('STARTER_ABOUT_TIPS_2')} + + + {siteConfig('STARTER_ABOUT_TIPS_3')} + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -197,8 +180,8 @@ export const About = () => {
-
-
- {/* */} +
+ {/* */} + ) } diff --git a/themes/starter/components/BackToTopButton.js b/themes/starter/components/BackToTopButton.js index d44a4add..340b5b31 100644 --- a/themes/starter/components/BackToTopButton.js +++ b/themes/starter/components/BackToTopButton.js @@ -1,41 +1,45 @@ -import throttle from 'lodash.throttle'; +import throttle from 'lodash.throttle' import { useCallback, useEffect } from 'react' +/** + * 回顶按钮 + * @returns + */ export const BackToTopButton = () => { useEffect(() => { // ====== scroll top js function scrollTo(element, to = 0, duration = 500) { - const start = element.scrollTop; - const change = to - start; - const increment = 20; - let currentTime = 0; + const start = element.scrollTop + const change = to - start + const increment = 20 + let currentTime = 0 const animateScroll = () => { - currentTime += increment; + currentTime += increment - const val = Math.easeInOutQuad(currentTime, start, change, duration); + const val = Math.easeInOutQuad(currentTime, start, change, duration) - element.scrollTop = val; + element.scrollTop = val if (currentTime < duration) { - setTimeout(animateScroll, increment); + setTimeout(animateScroll, increment) } - }; + } - animateScroll(); + animateScroll() } Math.easeInOutQuad = function (t, b, c, d) { - t /= d / 2; - if (t < 1) return (c / 2) * t * t + b; - t--; - return (-c / 2) * (t * (t - 2) - 1) + b; - }; + t /= d / 2 + if (t < 1) return (c / 2) * t * t + b + t-- + return (-c / 2) * (t * (t - 2) - 1) + b + } const backToTop = document.querySelector('.back-to-top') if (backToTop) { backToTop.onclick = () => { - scrollTo(document.documentElement); - }; + scrollTo(document.documentElement) + } } window.addEventListener('scroll', navBarScollListener) @@ -48,20 +52,22 @@ export const BackToTopButton = () => { const throttleMs = 200 const navBarScollListener = useCallback( throttle(() => { - const scrollY = window.scrollY; + const scrollY = window.scrollY // 显示或隐藏返回顶部按钮 - const backToTop = document.querySelector('.back-to-top'); + const backToTop = document.querySelector('.back-to-top') if (backToTop) { - backToTop.style.display = scrollY > 50 ? 'flex' : 'none'; + backToTop.style.display = scrollY > 50 ? 'flex' : 'none' } }, throttleMs) ) - return <> - {/* */} - - - - {/* */} + return ( + <> + {/* */} + + + + {/* */} + ) } diff --git a/themes/starter/components/Banner.js b/themes/starter/components/Banner.js index ab89d43c..18370a2d 100644 --- a/themes/starter/components/Banner.js +++ b/themes/starter/components/Banner.js @@ -1,30 +1,25 @@ /** - * 详情页面顶部条 + * 页面顶部宣传栏 * @returns */ export const Banner = ({ title, description }) => { - return <> - {/* */} -
-
-
-
-
-
-

- {title} -

-

- {description} -

+ return ( + <> + {/* */} +
+
+
+
+
+
+

+ {title} +

+

+ {description} +

- {/*
    + {/* */} +
-
- {/* */} + {/* */} + ) } diff --git a/themes/starter/components/Blog.js b/themes/starter/components/Blog.js index ff056741..7ccb5735 100644 --- a/themes/starter/components/Blog.js +++ b/themes/starter/components/Blog.js @@ -1,7 +1,6 @@ /* eslint-disable @next/next/no-img-element */ import { siteConfig } from '@/lib/config' import Link from 'next/link' -import CONFIG from '../config' /** * 博文列表 @@ -19,14 +18,14 @@ export const Blog = ({ posts }) => {
- {siteConfig('STARTER_BLOG_TITLE', null, CONFIG)} + {siteConfig('STARTER_BLOG_TITLE')}

- {siteConfig('STARTER_BLOG_TEXT_1', null, CONFIG)} + {siteConfig('STARTER_BLOG_TEXT_1')}

diff --git a/themes/starter/components/Brand.js b/themes/starter/components/Brand.js index db51823e..06cf9d3e 100644 --- a/themes/starter/components/Brand.js +++ b/themes/starter/components/Brand.js @@ -1,37 +1,39 @@ /* eslint-disable @next/next/no-img-element */ -import CONFIG from '../config' +import { siteConfig } from '@/lib/config' /** * 合作伙伴 * @returns */ export const Brand = () => { - return <> - - {/* */} -
-
-
- {CONFIG.STARTER_BRANDS?.map((item, index) => { - return - {item.TITLE} - {item.TITLE} - - })} + const brands = siteConfig('STARTER_BRANDS') + return ( + <> + {/* */} +
+
+
+ {brands?.map((item, index) => { + return ( + + {item.TITLE} + {item.TITLE} + + ) + })} +
-
-
- {/* */} + + {/* */} + ) } diff --git a/themes/starter/components/CTA.js b/themes/starter/components/CTA.js index 756b1f26..a0797a76 100644 --- a/themes/starter/components/CTA.js +++ b/themes/starter/components/CTA.js @@ -1,106 +1,111 @@ +import { siteConfig } from '@/lib/config' + +/** + * CTA,用于创建一个呼吁用户行动的部分(Call To Action,简称 CTA)。 + * 该组件通过以下方式激励用户进行特定操作 + * 用户的公告栏内容将在此显示 + **/ export const CTA = () => { - return <> - - {/* */} -
-
-
-
-
-
-

- What Are You Looking For? - - Get Started Now - -

-

- There are many variations of passages of Lorem Ipsum but the - majority have suffered in some form. -

- - Start using Play - + if (!siteConfig('STARTER_CTA_ENABLE')) { + return <> + } + return ( + <> + {/* */} +
+
+
+
+
+
+

+ {siteConfig('STARTER_CTA_TITLE')} + + {siteConfig('STARTER_CTA_TITLE_2')} + +

+

+ {siteConfig('STARTER_CTA_DESCRIOTN')} +

+ {siteConfig('STARTER_CTA_BUTTON') && ( + <> + + {siteConfig('STARTER_CTA_BUTTON_TEXT')} + + + )} +
-
-
- - - - - - - - - - - - - - -
-
- {/* */} +
+ + + + + + + + + + + + + + +
+ + {/* */} + ) } diff --git a/themes/starter/components/Contact.js b/themes/starter/components/Contact.js index fccacfde..b592a59b 100644 --- a/themes/starter/components/Contact.js +++ b/themes/starter/components/Contact.js @@ -5,6 +5,7 @@ import { SVGLocation } from './svg/SVGLocation' /* eslint-disable react/no-unescaped-entities */ export const Contact = () => { + const url = siteConfig('STARTER_CONTACT_MSG_EXTERNAL_URL') return ( <> {/* */} @@ -18,10 +19,10 @@ export const Contact = () => {
- {siteConfig('STARTER_CONTACT_TITLE', null, CONFIG)} + {siteConfig('STARTER_CONTACT_TITLE')}

- {siteConfig('STARTER_CONTACT_TEXT', null, CONFIG)} + {siteConfig('STARTER_CONTACT_TEXT')}

@@ -59,7 +60,7 @@ export const Contact = () => { )}

- {siteConfig('STARTER_CONTACT_EMAIL_TEXT', null, CONFIG)} + {siteConfig('STARTER_CONTACT_EMAIL_TEXT')}

@@ -67,7 +68,7 @@ export const Contact = () => {
- {siteConfig('STARTER_CONTACT_MSG_EXTERNAL_URL', null, CONFIG) && ( + {url && url !== '' && ( <> {/* 联系方式右侧留言 */}
diff --git a/themes/starter/components/FAQ.js b/themes/starter/components/FAQ.js index daff2aaf..29f9d595 100644 --- a/themes/starter/components/FAQ.js +++ b/themes/starter/components/FAQ.js @@ -1,137 +1,120 @@ -import { siteConfig } from '@/lib/config'; +import { siteConfig } from '@/lib/config' import { useEffect } from 'react' -import CONFIG from '../config'; -import { SVGQuestion } from './svg/SVGQuestion'; -import { SVGCircleBG } from './svg/SVGCircleBG'; +import { SVGCircleBG } from './svg/SVGCircleBG' +import { SVGQuestion } from './svg/SVGQuestion' export const FAQ = () => { useEffect(() => { // ===== Faq accordion - const faqs = document.querySelectorAll('.single-faq'); - faqs.forEach((el) => { + const faqs = document.querySelectorAll('.single-faq') + faqs.forEach(el => { el.querySelector('.faq-btn').addEventListener('click', () => { - el.querySelector('.icon').classList.toggle('rotate-180'); - el.querySelector('.faq-content').classList.toggle('hidden'); - }); - }); + el.querySelector('.icon').classList.toggle('rotate-180') + el.querySelector('.faq-content').classList.toggle('hidden') + }) + }) }) - return <> + return ( + <> {/* */} -
-
-
-
-
- - {siteConfig('STARTER_FAQ_TITLE', null, CONFIG)} - -

- {siteConfig('STARTER_FAQ_TEXT_1', null, CONFIG)} -

-

- {siteConfig('STARTER_FAQ_TEXT_2', null, CONFIG)} -

+
+
+
+
+
+ + {siteConfig('STARTER_FAQ_TITLE')} + +

+ {siteConfig('STARTER_FAQ_TEXT_1')} +

+

+ {siteConfig('STARTER_FAQ_TEXT_2')} +

+
+
+
+ +
+
+
+
+ +
+
+

+ {siteConfig('STARTER_FAQ_1_QUESTION')} +

+

+
+
+
+
+ +
+
+

+ {siteConfig('STARTER_FAQ_2_QUESTION')} +

+

+
+
+
+ +
+
+
+ +
+
+

+ {siteConfig('STARTER_FAQ_3_QUESTION')} +

+

+
+
+
+
+ +
+
+

+ {siteConfig('STARTER_FAQ_4_QUESTION')} +

+

+
+
-
-
-
-
- -
-
-

- {siteConfig('STARTER_FAQ_1_QUESTION', null, CONFIG)} -

-

-

-
-
-
-
- -
-
-

- {siteConfig('STARTER_FAQ_2_QUESTION', null, CONFIG)} -

-

-

-
-
-
- -
-
-
- -
-
-

- {siteConfig('STARTER_FAQ_3_QUESTION', null, CONFIG)} -

-

-

-
-
-
-
- -
-
-

- {siteConfig('STARTER_FAQ_4_QUESTION', null, CONFIG)} -

-

-

-
-
-
+ {/* 背景图案 */} +
+ + + + + +
-
- - {/* 背景图案 */} -
- - - - - - -
-
- {/* */} +
+ {/* */} + ) } diff --git a/themes/starter/components/Features.js b/themes/starter/components/Features.js index c3306746..ed2e63a3 100644 --- a/themes/starter/components/Features.js +++ b/themes/starter/components/Features.js @@ -1,135 +1,114 @@ -import CONFIG from '../config' -import { siteConfig } from '@/lib/config'; -import { SVGGifts } from './svg/SVGGifts'; -import { SVGTemplate } from './svg/SVGTemplate'; -import { SVGDesign } from './svg/SVGDesign'; -import { SVGEssential } from './svg/SVGEssential'; +import { siteConfig } from '@/lib/config' +import { SVGDesign } from './svg/SVGDesign' +import { SVGEssential } from './svg/SVGEssential' +import { SVGGifts } from './svg/SVGGifts' +import { SVGTemplate } from './svg/SVGTemplate' /** * 产品特性相关,将显示在首页中 * @returns */ export const Features = () => { - return <> - {/* */} -
-
-
-
-
- - {siteConfig('STARTER_FEATURE_TITLE', null, CONFIG)} - -

- {siteConfig('STARTER_FEATURE_TEXT_1', null, CONFIG)} -

-

- {siteConfig('STARTER_FEATURE_TEXT_2', null, CONFIG)} -

+ return ( + <> + {/* */} +
+
+
+
+
+ + {siteConfig('STARTER_FEATURE_TITLE')} + +

+ {siteConfig('STARTER_FEATURE_TEXT_1')} +

+

+ {siteConfig('STARTER_FEATURE_TEXT_2')} +

+
+
+
+
+
+
+
+ + +
+

+ {siteConfig('STARTER_FEATURE_1_TITLE_1')} +

+

+ {siteConfig('STARTER_FEATURE_1_TEXT_1')} +

+ + {siteConfig('STARTER_FEATURE_1_BUTTON_TEXT')} + +
+
+
+
+
+ + +
+

+ {siteConfig('STARTER_FEATURE_2_TITLE_1')} +

+

+ {siteConfig('STARTER_FEATURE_2_TEXT_1')} +

+ + {siteConfig('STARTER_FEATURE_2_BUTTON_TEXT')} + +
+
+
+
+
+ + +
+

+ {siteConfig('STARTER_FEATURE_3_TITLE_1')} +

+

+ {siteConfig('STARTER_FEATURE_3_TEXT_1')} +

+ + {siteConfig('STARTER_FEATURE_3_BUTTON_TEXT')} + +
+
+
+
+
+ + +
+

+ {siteConfig('STARTER_FEATURE_4_TITLE_1')} +

+

+ {siteConfig('STARTER_FEATURE_4_TEXT_1')} +

+ + {siteConfig('STARTER_FEATURE_3_BUTTON_TEXT')} + +
-
-
-
-
- - -
-

- {siteConfig('STARTER_FEATURE_1_TITLE_1', null, CONFIG)} -

-

- {siteConfig('STARTER_FEATURE_1_TEXT_1', null, CONFIG)} -

- - {siteConfig('STARTER_FEATURE_1_BUTTON_TEXT', null, CONFIG)} - -
-
-
-
-
- - -
-

- {siteConfig('STARTER_FEATURE_2_TITLE_1', null, CONFIG)} -

-

- {siteConfig('STARTER_FEATURE_2_TEXT_1', null, CONFIG)} -

- - {siteConfig('STARTER_FEATURE_2_BUTTON_TEXT', null, CONFIG)} - -
-
-
-
-
- - -
-

- {siteConfig('STARTER_FEATURE_3_TITLE_1', null, CONFIG)} -

-

- {siteConfig('STARTER_FEATURE_3_TEXT_1', null, CONFIG)} -

- - {siteConfig('STARTER_FEATURE_3_BUTTON_TEXT', null, CONFIG)} - -
-
-
-
-
- - -
-

- {siteConfig('STARTER_FEATURE_4_TITLE_1', null, CONFIG)} -

-

- {siteConfig('STARTER_FEATURE_4_TEXT_1', null, CONFIG)} -

- - {siteConfig('STARTER_FEATURE_3_BUTTON_TEXT', null, CONFIG)} - -
-
-
-
-
- {/* */} + + {/* */} + ) } diff --git a/themes/starter/components/Footer.js b/themes/starter/components/Footer.js index 5bdc4a81..d901c2c3 100644 --- a/themes/starter/components/Footer.js +++ b/themes/starter/components/Footer.js @@ -1,17 +1,12 @@ import { siteConfig } from '@/lib/config' import SocialButton from '@/themes/fukasawa/components/SocialButton' -import CONFIG from '../config' import { Logo } from './Logo' import { SVGFooterCircleBG } from './svg/SVGFooterCircleBG' /* eslint-disable @next/next/no-img-element */ export const Footer = props => { const latestPosts = props?.latestPosts ? props?.latestPosts.slice(0, 2) : [] - const STARTER_FOOTER_LINK_GROUP = siteConfig( - 'STARTER_FOOTER_LINK_GROUP', - [], - CONFIG - ) + const STARTER_FOOTER_LINK_GROUP = siteConfig('STARTER_FOOTER_LINK_GROUP') return ( <> {/* */} @@ -26,7 +21,7 @@ export const Footer = props => {

- {siteConfig('STARTER_FOOTER_SLOGAN', null, CONFIG)} + {siteConfig('STARTER_FOOTER_SLOGAN')}

@@ -68,7 +63,7 @@ export const Footer = props => {

- {siteConfig('STARTER_FOOTER_BLOG_LATEST_TITLE', null, CONFIG)} + {siteConfig('STARTER_FOOTER_BLOG_LATEST_TITLE')}

{/* 展示两条最新博客文章 */}
@@ -102,42 +97,24 @@ export const Footer = props => {
diff --git a/themes/starter/components/Hero.js b/themes/starter/components/Hero.js index 259c0327..28343ea9 100644 --- a/themes/starter/components/Hero.js +++ b/themes/starter/components/Hero.js @@ -1,96 +1,90 @@ /* eslint-disable @next/next/no-img-element */ import { siteConfig } from '@/lib/config' -import CONFIG from '../config' /** * 英雄大图区块 */ export const Hero = () => { - return <> - {/* */} -
-
-
-
-
- {/* 主标题 */} -

- {siteConfig('STARTER_HERO_TITLE_1', null, CONFIG)} -

- {/* 次标题 */} -

- {siteConfig('STARTER_HERO_TITLE_2', null, CONFIG)} -

- {/* 按钮组 */} - - -
-
- - {/* 产品预览图片 */} - { siteConfig('STARTER_HERO_PREVIEW_IMAGE', null, CONFIG) &&
-
- -
- {/* eslint-disable-next-line @next/next/no-img-element */} - hero -
- - {/* 背景图 */} -
- -
-
- + return ( + <> + {/* */} +
+
+
+
+
+ {/* 主标题 */} +

+ {siteConfig('STARTER_HERO_TITLE_1')} +

+ {/* 次标题 */} +

+ {siteConfig('STARTER_HERO_TITLE_2')} +

+ {/* 按钮组 */} +
-
- } + {/* 产品预览图片 */} + {siteConfig('STARTER_HERO_PREVIEW_IMAGE') && ( +
+
+
+ {/* eslint-disable-next-line @next/next/no-img-element */} + hero +
+ + {/* 背景图 */} +
+ +
+
+ +
+
+
+ )} +
-
- {/* */} + {/* */} + ) } diff --git a/themes/starter/components/Logo.js b/themes/starter/components/Logo.js index 5027b01f..bbbb5144 100644 --- a/themes/starter/components/Logo.js +++ b/themes/starter/components/Logo.js @@ -5,7 +5,6 @@ import { useGlobal } from '@/lib/global' import throttle from 'lodash.throttle' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' -import CONFIG from '../config' /** * 站点图标 @@ -14,7 +13,7 @@ import CONFIG from '../config' export const Logo = ({ white }) => { const router = useRouter() const { isDarkMode } = useGlobal() - const logoWhite = siteConfig('STARTER_LOGO_WHITE', null, CONFIG) + const logoWhite = siteConfig('STARTER_LOGO_WHITE') const [logo, setLogo] = useState(logoWhite) const [logoTextColor, setLogoTextColor] = useState('text-white') @@ -26,10 +25,10 @@ export const Logo = ({ white }) => { // 何时显示浅色或白底的logo const homePageNavBar = router.route === '/' && scrollY < 10 // 在首页并且视窗在页面顶部 if (white || isDarkMode || homePageNavBar) { - setLogo(siteConfig('STARTER_LOGO_WHITE', null, CONFIG)) + setLogo(siteConfig('STARTER_LOGO_WHITE')) setLogoTextColor('text-white') } else { - setLogo(siteConfig('STARTER_LOGO', null, CONFIG)) + setLogo(siteConfig('STARTER_LOGO')) setLogoTextColor('text-black') } }, throttleMs) diff --git a/themes/starter/components/MenuItem.js b/themes/starter/components/MenuItem.js index ec08aa28..ff184f36 100644 --- a/themes/starter/components/MenuItem.js +++ b/themes/starter/components/MenuItem.js @@ -1,6 +1,10 @@ import Link from 'next/link' import { useRouter } from 'next/router' - +/** + * 菜单链接 + * @param {*} param0 + * @returns + */ export const MenuItem = ({ link }) => { const hasSubMenu = link?.subMenus?.length > 0 const router = useRouter() diff --git a/themes/starter/components/MenuList.js b/themes/starter/components/MenuList.js index 38ec04f4..bbfb7925 100644 --- a/themes/starter/components/MenuList.js +++ b/themes/starter/components/MenuList.js @@ -1,7 +1,6 @@ import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { useEffect } from 'react' -import CONFIG from '../config' import { MenuItem } from './MenuItem' /** * 响应式 折叠菜单 @@ -15,25 +14,25 @@ export const MenuList = props => { icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, href: '/archive', - show: siteConfig('HEO_MENU_ARCHIVE', null, CONFIG) + show: siteConfig('HEO_MENU_ARCHIVE') }, { icon: 'fas fa-search', name: locale.NAV.SEARCH, href: '/search', - show: siteConfig('HEO_MENU_SEARCH', null, CONFIG) + show: siteConfig('HEO_MENU_SEARCH') }, { icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, href: '/category', - show: siteConfig('HEO_MENU_CATEGORY', null, CONFIG) + show: siteConfig('HEO_MENU_CATEGORY') }, { icon: 'fas fa-tag', name: locale.COMMON.TAGS, href: '/tag', - show: siteConfig('HEO_MENU_TAG', null, CONFIG) + show: siteConfig('HEO_MENU_TAG') } ] diff --git a/themes/starter/components/MessageForm.js b/themes/starter/components/MessageForm.js index 25bce6eb..718cfcd1 100644 --- a/themes/starter/components/MessageForm.js +++ b/themes/starter/components/MessageForm.js @@ -1,5 +1,4 @@ import { siteConfig } from '@/lib/config' -import CONFIG from '../config' import { useRef, useState } from 'react' /** @@ -16,7 +15,7 @@ export const MessageForm = () => { message: '' }) - const handleChange = (e) => { + const handleChange = e => { const { name, value } = e.target setFormData(prevState => ({ ...prevState, @@ -44,89 +43,90 @@ export const MessageForm = () => { // } // }, [submitComments]) - return <> -

- {siteConfig('STARTER_CONTACT_MSG_TITLE', null, CONFIG)} -

-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - {/* Success message */} - {success &&

{siteConfig('STARTER_CONTACT_MSG_THANKS', null, CONFIG)}

} - -
-
- + return ( + <> +

+ {siteConfig('STARTER_CONTACT_MSG_TITLE')} +

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + {/* Success message */} + {success && ( +

+ {siteConfig('STARTER_CONTACT_MSG_THANKS')} +

+ )} +
+
+ + ) } diff --git a/themes/starter/components/NavBar.js b/themes/starter/components/NavBar.js index 2d4fda41..b11b3cb5 100644 --- a/themes/starter/components/NavBar.js +++ b/themes/starter/components/NavBar.js @@ -1,21 +1,22 @@ /* eslint-disable no-unreachable */ -import throttle from 'lodash.throttle'; +import { siteConfig } from '@/lib/config' +import { useGlobal } from '@/lib/global' +import throttle from 'lodash.throttle' +import { useRouter } from 'next/router' import { useCallback, useEffect, useState } from 'react' -import { MenuList } from './MenuList'; -import { DarkModeButton } from './DarkModeButton'; -import { Logo } from './Logo'; -import { useRouter } from 'next/router'; -import { siteConfig } from '@/lib/config'; -import CONFIG from '../config'; -import { useGlobal } from '@/lib/global'; +import { DarkModeButton } from './DarkModeButton' +import { Logo } from './Logo' +import { MenuList } from './MenuList' /** * 顶部导航栏 */ -export const NavBar = (props) => { +export const NavBar = props => { const router = useRouter() const { isDarkMode } = useGlobal() - const [buttonTextColor, setColor] = useState(router.route === '/' ? 'text-white' : '') + const [buttonTextColor, setColor] = useState( + router.route === '/' ? 'text-white' : '' + ) useEffect(() => { if (isDarkMode || router.route === '/') { setColor('text-white') @@ -33,59 +34,54 @@ export const NavBar = (props) => { const throttleMs = 200 const navBarScollListener = useCallback( throttle(() => { - // eslint-disable-next-line camelcase - const ud_header = document.querySelector('.ud-header'); - const scrollY = window.scrollY; + // eslint-disable-next-line camelcase + const ud_header = document.querySelector('.ud-header') + const scrollY = window.scrollY // 控制台输出当前滚动位置和 sticky 值 if (scrollY > 0) { - ud_header?.classList?.add('sticky'); + ud_header?.classList?.add('sticky') } else { - ud_header?.classList?.remove('sticky'); + ud_header?.classList?.remove('sticky') } }, throttleMs) ) - return <> - {/* */} -
+ return ( + <> + {/* */} +
+
+
+ {/* Logo */} + -
- -
- - {/* Logo */} - - -
- - {/* 中间菜单 */} - - - {/* 右侧功能 */} - +
+ {/* 中间菜单 */} + + {/* 右侧功能 */} +
+ {/* 深色模式切换 */} + + {/* 注册登录功能 */} + +
+
-
- {/* */} +
+ {/* */} + ) } diff --git a/themes/starter/components/Pricing.js b/themes/starter/components/Pricing.js index b75cd366..204bdce5 100644 --- a/themes/starter/components/Pricing.js +++ b/themes/starter/components/Pricing.js @@ -1,178 +1,177 @@ import { siteConfig } from '@/lib/config' -import CONFIG from '../config' /** * 价格板块 * @returns */ export const Pricing = () => { - return <> - {/* */} -
-
-
-
-
- - {siteConfig('STARTER_PRICING_TITLE', null, CONFIG)} - -

- {siteConfig('STARTER_PRICING_TEXT_1', null, CONFIG)} -

-

- {siteConfig('STARTER_PRICING_TEXT_2', null, CONFIG)} -

+ return ( + <> + {/* */} +
+
+
+
+
+ + {siteConfig('STARTER_PRICING_TITLE')} + +

+ {siteConfig('STARTER_PRICING_TEXT_1')} +

+

+ {siteConfig('STARTER_PRICING_TEXT_2')} +

+
+
+
+ +
+ {/* 第一个付费计划 */} +
+
+ + {siteConfig('STARTER_PRICING_1_TITLE')} + +

+ + {siteConfig('STARTER_PRICING_1_PRICE_CURRENCY')} + + + {siteConfig('STARTER_PRICING_1_PRICE')} + + + {siteConfig('STARTER_PRICING_1_PRICE_PERIOD')} + +

+ +
+
+ {siteConfig('STARTER_PRICING_1_HEADER')} +
+
+ {siteConfig('STARTER_PRICING_1_FEATURES') + ?.split(',') + .map((feature, index) => { + return ( +

+ {feature} +

+ ) + })} +
+
+ + {siteConfig('STARTER_PRICING_1_BUTTON_TEXT')} + +
+
+ + {/* 第二个付费计划 */} +
+
+

+ {siteConfig('STARTER_PRICING_2_TAG')} +

+ + {siteConfig('STARTER_PRICING_2_TITLE')} + +

+ + {siteConfig('STARTER_PRICING_2_PRICE_CURRENCY')} + + + {siteConfig('STARTER_PRICING_2_PRICE')} + + + {siteConfig('STARTER_PRICING_2_PRICE_PERIOD')} + +

+ +
+
+ {siteConfig('STARTER_PRICING_2_HEADER')} +
+
+ {siteConfig('STARTER_PRICING_2_FEATURES') + ?.split(',') + .map((feature, index) => { + return ( +

+ {feature} +

+ ) + })} +
+
+ + {siteConfig('STARTER_PRICING_2_BUTTON_TEXT')} + +
+
+ + {/* 第三个付费计划 */} +
+
+ + {siteConfig('STARTER_PRICING_3_TITLE')} + +

+ + {siteConfig('STARTER_PRICING_3_PRICE_CURRENCY')} + + + {siteConfig('STARTER_PRICING_3_PRICE')} + + + {siteConfig('STARTER_PRICING_3_PRICE_PERIOD')} + +

+ +
+
+ {siteConfig('STARTER_PRICING_3_HEADER')} +
+
+ {siteConfig('STARTER_PRICING_3_FEATURES') + ?.split(',') + .map((feature, index) => { + return ( +

+ {feature} +

+ ) + })} +
+
+ + {siteConfig('STARTER_PRICING_3_BUTTON_TEXT')} + +
- -
- - {/* 第一个付费计划 */} -
-
- - {siteConfig('STARTER_PRICING_1_TITLE', null, CONFIG)} - -

- {siteConfig('STARTER_PRICING_1_PRICE_CURRENCY', null, CONFIG)} - {siteConfig('STARTER_PRICING_1_PRICE', null, CONFIG)} - - {siteConfig('STARTER_PRICING_1_PRICE_PERIOD', null, CONFIG)} - -

- -
-
- {siteConfig('STARTER_PRICING_1_HEADER', null, CONFIG)} -
-
- {siteConfig('STARTER_PRICING_1_FEATURES', null, CONFIG)?.split(',').map((feature, index) => { - return

- {feature} -

- })} - -
-
- - {siteConfig('STARTER_PRICING_1_BUTTON_TEXT', null, CONFIG)} - -
-
- - {/* 第二个付费计划 */} -
-
-

- {siteConfig('STARTER_PRICING_2_TAG', null, CONFIG)} -

- - {siteConfig('STARTER_PRICING_2_TITLE', null, CONFIG)} - -

- {siteConfig('STARTER_PRICING_2_PRICE_CURRENCY', null, CONFIG)} - {siteConfig('STARTER_PRICING_2_PRICE', null, CONFIG)} - - {siteConfig('STARTER_PRICING_2_PRICE_PERIOD', null, CONFIG)} - -

- -
-
- {siteConfig('STARTER_PRICING_2_HEADER', null, CONFIG)} -
-
- {siteConfig('STARTER_PRICING_2_FEATURES', null, CONFIG)?.split(',').map((feature, index) => { - return

- {feature} -

- })} - -
-
- - {siteConfig('STARTER_PRICING_2_BUTTON_TEXT', null, CONFIG)} - -
-
- - {/* 第三个付费计划 */} -
-
- - {siteConfig('STARTER_PRICING_3_TITLE', null, CONFIG)} - -

- {siteConfig('STARTER_PRICING_3_PRICE_CURRENCY', null, CONFIG)} - {siteConfig('STARTER_PRICING_3_PRICE', null, CONFIG)} - - {siteConfig('STARTER_PRICING_3_PRICE_PERIOD', null, CONFIG)} - -

- -
-
- {siteConfig('STARTER_PRICING_3_HEADER', null, CONFIG)} -
-
- {siteConfig('STARTER_PRICING_3_FEATURES', null, CONFIG)?.split(',').map((feature, index) => { - return

- {feature} -

- })} - -
-
- - {siteConfig('STARTER_PRICING_3_BUTTON_TEXT', null, CONFIG)} - -
-
-
-
-
- {/* */} - - + + {/* */} + + ) } diff --git a/themes/starter/components/Team.js b/themes/starter/components/Team.js index dab80a43..69eda8a6 100644 --- a/themes/starter/components/Team.js +++ b/themes/starter/components/Team.js @@ -1,9 +1,9 @@ /* eslint-disable @next/next/no-img-element */ import { siteConfig } from '@/lib/config' -import CONFIG from '../config' import { SVGAvatarBG } from './svg/SVGAvatarBG' export const Team = () => { + const STARTER_TEAM_ITEMS = siteConfig('STARTER_TEAM_ITEMS') return ( <> {/* */} @@ -15,14 +15,14 @@ export const Team = () => {
- {siteConfig('STARTER_TEAM_TITLE', null, CONFIG)} + {siteConfig('STARTER_TEAM_TITLE')}

- {siteConfig('STARTER_TEAM_TEXT_1', null, CONFIG)} + {siteConfig('STARTER_TEAM_TEXT_1')}

@@ -31,7 +31,7 @@ export const Team = () => { {/* 团队成员排列矩阵 */}
- {CONFIG.STARTER_TEAM_ITEMS.map((item, index) => { + {STARTER_TEAM_ITEMS?.map((item, index) => { return (
{ }, []) // 用户评分 const ratings = [1, 2, 3, 4, 5] - const STARTER_TESTIMONIALS_ITEMS = siteConfig( - 'STARTER_TESTIMONIALS_ITEMS', - [], - CONFIG - ) + const STARTER_TESTIMONIALS_ITEMS = siteConfig('STARTER_TESTIMONIALS_ITEMS') return ( <> {/* */} @@ -76,13 +71,13 @@ export const Testimonials = () => {
- {siteConfig('STARTER_TESTIMONIALS_TITLE', null, CONFIG)} + {siteConfig('STARTER_TESTIMONIALS_TITLE')}

- {siteConfig('STARTER_TESTIMONIALS_TEXT_1', null, CONFIG)} + {siteConfig('STARTER_TESTIMONIALS_TEXT_1')}

- {siteConfig('STARTER_TESTIMONIALS_TEXT_2', null, CONFIG)} + {siteConfig('STARTER_TESTIMONIALS_TEXT_2')}

@@ -101,11 +96,7 @@ export const Testimonials = () => { star icon ))}
diff --git a/themes/starter/config.js b/themes/starter/config.js index 09321df1..7748e6b0 100644 --- a/themes/starter/config.js +++ b/themes/starter/config.js @@ -358,6 +358,17 @@ const CONFIG = { STARTER_404_TEXT: '抱歉!您要查找的页面不存在。可能已经移动或删除。', STARTER_404_BACK: '回到主页', + // 页面底部的行动呼吁模块 + STARTER_CTA_ENABLE: true, + STARTER_CTA_TITLE: '你还在等待什么呢?', + STARTER_CTA_TITLE_2: '现在开始吧', + STARTER_CTA_DESCRIOTN: + '访问NotionNext的操作文档,我们提供了详细的教程,帮助你即刻搭建站点', + STARTER_CTA_BUTTON: true, // 是否显示按钮 + STARTER_CTA_BUTTON_URL: + 'https://docs.tangly1024.com/article/vercel-deploy-notion-next', + STARTER_CTA_BUTTON_TEXT: '开始体验', + STARTER_POST_REDIRECT_ENABLE: true, // 默認開啟重定向 STARTER_POST_REDIRECT_URL: 'https://blog.tangly1024.com', // 重定向域名 STARTER_NEWSLETTER: process.env.NEXT_PUBLIC_THEME_STARTER_NEWSLETTER || false // 是否开启邮件订阅 请先配置mailchimp功能 https://docs.tangly1024.com/article/notion-next-mailchimp diff --git a/themes/starter/index.js b/themes/starter/index.js index 55d5abd4..5e659341 100644 --- a/themes/starter/index.js +++ b/themes/starter/index.js @@ -31,12 +31,11 @@ import { Testimonials } from './components/Testimonials' import CONFIG from './config' import { Style } from './style' // import { MadeWithButton } from './components/MadeWithButton' -import BLOG from '@/blog.config' import { loadWowJS } from '@/lib/plugins/wow' import Link from 'next/link' import { Banner } from './components/Banner' +import { CTA } from './components/CTA' import { SignInForm } from './components/SignInForm' -import { SignUpForm } from './components/SignUpForm' import { SVG404 } from './components/svg/SVG404' /** @@ -58,7 +57,7 @@ const LayoutBase = props => { return (
+ className={`${siteConfig('FONT_STYLE')} min-h-screen flex flex-col dark:bg-[#212b36] scroll-smooth`}>