-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
150 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
import Card from '@/components/Card' | ||
import Reveal from '@/components/Reveal' | ||
import projectsData from '@/data/projectsData' | ||
import { genPageMetadata } from 'app/seo' | ||
|
||
export const metadata = genPageMetadata({ title: 'Projects' }) | ||
|
||
export default function Projects() { | ||
return ( | ||
|
||
<div> | ||
<div className="space-y-2 pb-8 pt-6 md:space-y-5"> | ||
<h1 className="text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-6xl md:leading-14"> | ||
lalala~ | ||
</h1> | ||
<p className="text-lg leading-7 text-gray-500 dark:text-gray-400"> | ||
一些小项目,希望能帮你少写几行代码😊 | ||
</p> | ||
</div> | ||
<div className="container py-12"> | ||
<div className="-m-4 flex flex-wrap"> | ||
{projectsData.map(d => ( | ||
<Card | ||
key={d.title} | ||
title={d.title} | ||
description={d.description} | ||
imgSrc={d.imgSrc} | ||
href={d.href} | ||
/> | ||
))} | ||
<Reveal> | ||
<div> | ||
<div className="space-y-2 pb-8 pt-6 md:space-y-5"> | ||
<h1 className="text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-6xl md:leading-14"> | ||
lalala~ | ||
</h1> | ||
<p className="text-lg leading-7 text-gray-500 dark:text-gray-400"> | ||
一些小项目,希望能帮你少写几行代码😊 | ||
</p> | ||
</div> | ||
<div className="container py-12"> | ||
<div className="-m-4 flex flex-wrap"> | ||
{projectsData.map(d => ( | ||
<Card | ||
key={d.title} | ||
title={d.title} | ||
description={d.description} | ||
imgSrc={d.imgSrc} | ||
href={d.href} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</Reveal> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use client' | ||
|
||
import type { ReactNode } from 'react' | ||
import { motion, useAnimation, useInView } from 'framer-motion' | ||
import React, { useEffect, useRef } from 'react' | ||
|
||
interface RevealProps { | ||
children: ReactNode | ||
width?: string | ||
} | ||
|
||
export default function Reveal({ children, width = '100%' }: RevealProps) { | ||
const ref = useRef(null) | ||
|
||
const isInView = useInView(ref, { once: true }) | ||
|
||
const mainControls = useAnimation() | ||
|
||
useEffect(() => { | ||
if (isInView) { | ||
mainControls.start('visible') | ||
} | ||
}, [isInView, mainControls]) | ||
|
||
return ( | ||
<div ref={ref} style={{ position: 'relative', width, overflow: 'hidden' }}> | ||
|
||
<motion.div | ||
variants={{ | ||
hidden: { opacity: 0, y: 75 }, | ||
visible: { opacity: 1, y: 0 }, | ||
}} | ||
initial="hidden" | ||
animate={mainControls} | ||
transition={{ duration: 0.5, delay: 0.25 }} | ||
> | ||
{children} | ||
</motion.div> | ||
|
||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters