Files
NotionNext/themes/landing/components/Features.js
tangly1024.com 194cd7ac7d MailChimp
2023-07-04 12:39:18 +08:00

172 lines
9.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* eslint-disable @next/next/no-img-element */
'use client'
import { useState, useRef, useEffect } from 'react'
import { Transition } from '@headlessui/react'
// import FeaturesElement from '@/public/images/features-element.png'
export default function Features() {
const [tab, setTab] = useState(1)
const tabs = useRef(null)
const heightFix = () => {
if (tabs.current && tabs.current.parentElement) tabs.current.parentElement.style.height = `${tabs.current.clientHeight}px`
}
useEffect(() => {
heightFix()
}, [])
return (
<section className="relative">
{/* Section background (needs .relative class on parent and next sibling elements) */}
<div className="absolute inset-0 bg-gray-100 pointer-events-none mb-16" aria-hidden="true"></div>
<div className="absolute left-0 right-0 m-auto w-px p-px h-20 bg-gray-200 transform -translate-y-1/2"></div>
<div className="relative max-w-6xl mx-auto px-4 sm:px-6">
<div className="pt-12 md:pt-20">
{/* Section header */}
<div className="max-w-3xl mx-auto text-center pb-12 md:pb-16">
<h1 className="h2 mb-4">探索解决方案</h1>
<p className="text-xl text-gray-600">如何搭建自己的门户网站塑造一个品牌展示中心<br/>以前它是系统<strong className='font-bold'>繁重</strong>Wordpress<strong className='font-bold'></strong>Hexo<strong className='font-bold'></strong>Notion</p>
</div>
{/* Section content */}
<div className="md:grid md:grid-cols-12 md:gap-6">
{/* Content */}
<div className="max-w-xl md:max-w-none md:w-full mx-auto md:col-span-7 lg:col-span-6 md:mt-6" data-aos="fade-right">
<div className="md:pr-4 lg:pr-12 xl:pr-16 mb-8">
<h3 className="h3 mb-3">Notion+NextJs组合方案</h3>
<p className="text-xl text-gray-600">Notion作为CMS管理您的站点配置和网页数据NextJs作为渲染博客的脚本借助第三方的Vercel等托管平台提供网络服务</p>
</div>
{/* Tabs buttons */}
<div className="mb-8 md:mb-0">
<a
className={`flex items-center text-lg p-5 rounded border transition duration-300 ease-in-out mb-3 ${tab !== 1 ? 'bg-white shadow-md border-gray-200 hover:shadow-lg' : 'bg-gray-200 border-transparent'}`}
href="#0"
onClick={(e) => { e.preventDefault(); setTab(1) }}
>
<div>
<div className="font-bold leading-snug tracking-tight mb-1">简单快速的系统</div>
<div className="text-gray-600">在Notion中写下一篇文章内容立刻在您的网站首页中呈现给互联网</div>
</div>
<div className="flex justify-center items-center w-8 h-8 bg-white rounded-full shadow flex-shrink-0 ml-3">
<svg className="w-3 h-3 fill-current" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
<path d="M11.953 4.29a.5.5 0 00-.454-.292H6.14L6.984.62A.5.5 0 006.12.173l-6 7a.5.5 0 00.379.825h5.359l-.844 3.38a.5.5 0 00.864.445l6-7a.5.5 0 00.075-.534z" />
</svg>
</div>
</a>
<a
className={`flex items-center text-lg p-5 rounded border transition duration-300 ease-in-out mb-3 ${tab !== 2 ? 'bg-white shadow-md border-gray-200 hover:shadow-lg' : 'bg-gray-200 border-transparent'}`}
href="#0"
onClick={(e) => { e.preventDefault(); setTab(2) }}
>
<div>
<div className="font-bold leading-snug tracking-tight mb-1">高效传播的媒介</div>
<div className="text-gray-600">优质的SEO快速的响应速度让您的产品和宣传触达到更多的受众</div>
</div>
<div className="flex justify-center items-center w-8 h-8 bg-white rounded-full shadow flex-shrink-0 ml-3">
<svg className="w-3 h-3 fill-current" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
<path d="M11.854.146a.5.5 0 00-.525-.116l-11 4a.5.5 0 00-.015.934l4.8 1.921 1.921 4.8A.5.5 0 007.5 12h.008a.5.5 0 00.462-.329l4-11a.5.5 0 00-.116-.525z" fillRule="nonzero" />
</svg>
</div>
</a>
<a
className={`flex items-center text-lg p-5 rounded border transition duration-300 ease-in-out mb-3 ${tab !== 3 ? 'bg-white shadow-md border-gray-200 hover:shadow-lg' : 'bg-gray-200 border-transparent'}`}
href="#0"
onClick={(e) => { e.preventDefault(); setTab(3) }}
>
<div>
<div className="font-bold leading-snug tracking-tight mb-1">人性化的定制工具</div>
<div className="text-gray-600">多款主题供您挑选可以搭建各种不同风格和作用的网站未来还会有更多的主题加入</div>
</div>
<div className="flex justify-center items-center w-8 h-8 bg-white rounded-full shadow flex-shrink-0 ml-3">
<svg className="w-3 h-3 fill-current" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
<path d="M11.334 8.06a.5.5 0 00-.421-.237 6.023 6.023 0 01-5.905-6c0-.41.042-.82.125-1.221a.5.5 0 00-.614-.586 6 6 0 106.832 8.529.5.5 0 00-.017-.485z" fill="#191919" fillRule="nonzero" />
</svg>
</div>
</a>
</div>
</div>
{/* Tabs items */}
<div className="max-w-xl md:max-w-none md:w-full mx-auto md:col-span-5 lg:col-span-6 mb-8 md:mb-0 md:order-1 pt-24">
<div className="transition-all">
<div className="relative flex flex-col text-center lg:text-right" data-aos="zoom-y-out" ref={tabs}>
{/* Item 1 */}
<Transition
show={tab === 1}
appear={true}
className="w-full"
enter="transition ease-in-out duration-700 transform order-first"
enterFrom="opacity-0 translate-y-16"
enterTo="opacity-100 translate-y-0"
leave="transition ease-in-out duration-300 transform absolute"
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-0 -translate-y-16"
beforeEnter={() => heightFix()}
unmount={false}
>
<div className="relative inline-flex flex-col">
{/* <Image className="md:max-w-none mx-auto rounded" src={FeaturesBg} width={500} height="462" alt="Features bg" /> */}
{/* <Image className="md:max-w-none absolute w-full left-0 transform animate-float" src={FeaturesElement} width={500} height="44" alt="Element" style={{ top: '30%' }} /> */}
<img src='/images/feature-1.webp'></img>
</div>
</Transition>
{/* Item 2 */}
<Transition
show={tab === 2}
appear={true}
className="w-full"
enter="transition ease-in-out duration-700 transform order-first"
enterFrom="opacity-0 translate-y-16"
enterTo="opacity-100 translate-y-0"
leave="transition ease-in-out duration-300 transform absolute"
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-0 -translate-y-16"
beforeEnter={() => heightFix()}
unmount={false}
>
<div className="relative inline-flex flex-col">
{/* <Image className="md:max-w-none mx-auto rounded" src={FeaturesBg} width={500} height="462" alt="Features bg" />
<Image className="md:max-w-none absolute w-full left-0 transform animate-float" src={FeaturesElement} width={500} height="44" alt="Element" style={{ top: '30%' }} /> */}
<img src='/images/feature-2.webp'></img>
</div>
</Transition>
{/* Item 3 */}
<Transition
show={tab === 3}
appear={true}
className="w-full"
enter="transition ease-in-out duration-700 transform order-first"
enterFrom="opacity-0 translate-y-16"
enterTo="opacity-100 translate-y-0"
leave="transition ease-in-out duration-300 transform absolute"
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-0 -translate-y-16"
beforeEnter={() => heightFix()}
unmount={false}
>
<div className="relative inline-flex flex-col">
{/* <Image className="md:max-w-none mx-auto rounded" src={FeaturesBg} width={500} height="462" alt="Features bg" />
<Image className="md:max-w-none absolute w-full left-0 transform animate-float" src={FeaturesElement} width={500} height="44" alt="Element" style={{ top: '30%' }} /> */}
<img src='/images/feature-3.webp'></img>
</div>
</Transition>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
)
}