mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
feat(motion): standardize animation recipes across sections and pages
- Replace the AnimatedSection wrapper with the per-section recipe: InView
wrapping motion.section with initial="hidden" whileInView="visible" and
viewport={{ once: true, amount: 0.1 }}; delete AnimatedSection.tsx
- Apply the item recipe (opacity/y 24, amount 0.2, delay i * 0.08) to timeline
entries, philosophy/expertise/project cards, hero blocks, contact links and
project-detail blocks
- Move transforms into motion: whileHover/whileTap on cards, links and Button;
CSS :hover keeps only colour/border/shadow, and `transition: all` becomes an
explicit property list so motion owns the transform
- Rebuild HeroParticles as perspective-projected depth tiers with scroll-linked
transforms, no mask-image, plus a documented reduced-motion caveat
- Update AGENTS.md motion section and spec-v3-ui-enhancements /
spec-v3-mobile-navigation progress notes
This commit is contained in:
1 parent
ae4a5b9cca
commit
4387f889f5
18 files changed
+885
-490
No files matched your search
+97
-58
@@ -1,6 +1,7 @@
|
||||
import { AnimatedSection } from '@/components/ui/AnimatedSection'
|
||||
import { motion } from 'motion/react'
|
||||
import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { Tag } from '@/components/ui/Tag'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { profile } from '@/data/profile'
|
||||
import { skillGroups } from '@/data/skills'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
@@ -11,65 +12,103 @@ export function AboutPage() {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<>
|
||||
<AnimatedSection>
|
||||
<section className="section container-wide" aria-labelledby="about-heading">
|
||||
<SectionHeading
|
||||
title={strings.about.heading[lang]}
|
||||
subtitle={strings.about.subtitle[lang]}
|
||||
tag={strings.about.heading[lang]}
|
||||
/>
|
||||
<p className="prose-lede lede-wide">
|
||||
{useField(profile.bio, profile.bioEn)}
|
||||
</p>
|
||||
<InView>
|
||||
<motion.section
|
||||
className="section container-wide"
|
||||
aria-labelledby="about-heading"
|
||||
initial="hidden"
|
||||
whileInView="visible"
|
||||
viewport={{ once: true, amount: 0.1 }}
|
||||
variants={{
|
||||
hidden: { opacity: 0 },
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading
|
||||
title={strings.about.heading[lang]}
|
||||
subtitle={strings.about.subtitle[lang]}
|
||||
tag={strings.about.heading[lang]}
|
||||
/>
|
||||
<p className="prose-lede lede-wide">
|
||||
{useField(profile.bio, profile.bioEn)}
|
||||
</p>
|
||||
|
||||
<h3 className="subheading">
|
||||
{strings.about.engineeringTitle[lang]}
|
||||
</h3>
|
||||
<div className="philosophy-grid">
|
||||
{profile.philosophy.map((point) => (
|
||||
<div key={point.title} className="philosophy-card">
|
||||
<h3>{point.title}</h3>
|
||||
<p>{point.description}</p>
|
||||
<div className="philosophy-keywords">
|
||||
{point.keywords.map((kw) => (
|
||||
<Tag key={kw}>{kw}</Tag>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<h3 className="subheading">
|
||||
{strings.about.engineeringTitle[lang]}
|
||||
</h3>
|
||||
<div className="philosophy-grid">
|
||||
{profile.philosophy.map((point, i) => (
|
||||
<motion.div
|
||||
key={point.title}
|
||||
className="philosophy-card"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={{ duration: 0.45, ease: 'easeOut', delay: i * 0.08 }}
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<h3>{point.title}</h3>
|
||||
<p>{point.description}</p>
|
||||
<div className="philosophy-keywords">
|
||||
{point.keywords.map((kw) => (
|
||||
<Tag key={kw}>{kw}</Tag>
|
||||
))}
|
||||
</div>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<h3 className="subheading">
|
||||
{strings.about.exploringTitlePage[lang]}
|
||||
</h3>
|
||||
<div className="interests-list">
|
||||
{profile.currentInterests.map((interest) => (
|
||||
<Tag key={interest} accent>
|
||||
{interest}
|
||||
</Tag>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
</AnimatedSection>
|
||||
<AnimatedSection>
|
||||
<section className="section container-wide" aria-labelledby="expertise-heading">
|
||||
<SectionHeading title={strings.about.expertise[lang]} />
|
||||
<div className="expertise-grid">
|
||||
{skillGroups.map((group) => (
|
||||
<div key={group.title} className="expertise-card">
|
||||
<h3>{useField(group.title, group.titleEn)}</h3>
|
||||
<ul className="expertise-skills">
|
||||
{group.skills.map((skill: string) => (
|
||||
<li key={skill} className="expertise-skill">
|
||||
{skill}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
</AnimatedSection>
|
||||
<h3 className="subheading">
|
||||
{strings.about.exploringTitlePage[lang]}
|
||||
</h3>
|
||||
<div className="interests-list">
|
||||
{profile.currentInterests.map((interest) => (
|
||||
<Tag key={interest} accent>
|
||||
{interest}
|
||||
</Tag>
|
||||
))}
|
||||
</div>
|
||||
</motion.section>
|
||||
</InView>
|
||||
<InView>
|
||||
<motion.section
|
||||
className="section container-wide"
|
||||
aria-labelledby="expertise-heading"
|
||||
initial="hidden"
|
||||
whileInView="visible"
|
||||
viewport={{ once: true, amount: 0.1 }}
|
||||
variants={{
|
||||
hidden: { opacity: 0 },
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title={strings.about.expertise[lang]} />
|
||||
<div className="expertise-grid">
|
||||
{skillGroups.map((group, i) => (
|
||||
<motion.div
|
||||
key={group.title}
|
||||
className="expertise-card"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={{ duration: 0.45, ease: 'easeOut', delay: i * 0.08 }}
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<h3>{useField(group.title, group.titleEn)}</h3>
|
||||
<ul className="expertise-skills">
|
||||
{group.skills.map((skill: string) => (
|
||||
<li key={skill} className="expertise-skill">
|
||||
{skill}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
</motion.section>
|
||||
</InView>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -1,15 +1,37 @@
|
||||
import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { DownloadResume } from '@/components/sections/DownloadResume'
|
||||
import { motion } from 'motion/react'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { profile } from '@/data/profile'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
export function ContactPage() {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<section className="section container-content" aria-labelledby="contact-heading">
|
||||
<InView>
|
||||
<motion.section
|
||||
className="section container-content"
|
||||
aria-labelledby="contact-heading"
|
||||
initial="hidden"
|
||||
whileInView="visible"
|
||||
viewport={{ once: true, amount: 0.1 }}
|
||||
variants={{
|
||||
hidden: { opacity: 0 },
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title={strings.contact.heading[lang]} tag={strings.common.contactTag[lang]} />
|
||||
<div className="contact-links">
|
||||
<a href={`mailto:${profile.email}`} className="contact-link">
|
||||
<motion.a
|
||||
href={`mailto:${profile.email}`}
|
||||
className="contact-link"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={{ duration: 0.45, ease: 'easeOut', delay: 0 }}
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" width="24" height="24">
|
||||
<rect x="2" y="4" width="20" height="16" rx="2" />
|
||||
<path d="M22 4l-10 8L2 4" />
|
||||
@@ -18,8 +40,19 @@ export function ContactPage() {
|
||||
<div className="link-label">{strings.contact.email[lang]}</div>
|
||||
<div className="contact-link-sub">{profile.email}</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href={profile.githubUrl} target="_blank" rel="noopener noreferrer" className="contact-link">
|
||||
</motion.a>
|
||||
<motion.a
|
||||
href={profile.githubUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="contact-link"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={{ duration: 0.45, ease: 'easeOut', delay: 0.08 }}
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<svg viewBox="0 0 24 24" fill="currentColor" width="24" height="24">
|
||||
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z" />
|
||||
</svg>
|
||||
@@ -27,8 +60,19 @@ export function ContactPage() {
|
||||
<div className="link-label">{strings.contact.github[lang]}</div>
|
||||
<div className="contact-link-sub">@dong-nz</div>
|
||||
</div>
|
||||
</a>
|
||||
<a href={profile.linkedinUrl} target="_blank" rel="noopener noreferrer" className="contact-link">
|
||||
</motion.a>
|
||||
<motion.a
|
||||
href={profile.linkedinUrl}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="contact-link"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={{ duration: 0.45, ease: 'easeOut', delay: 0.16 }}
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<svg viewBox="0 0 24 24" fill="currentColor" width="24" height="24">
|
||||
<path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" />
|
||||
</svg>
|
||||
@@ -36,9 +80,10 @@ export function ContactPage() {
|
||||
<div className="link-label">{strings.contact.linkedin[lang]}</div>
|
||||
<div className="contact-link-sub">@dong-nz</div>
|
||||
</div>
|
||||
</a>
|
||||
</motion.a>
|
||||
</div>
|
||||
<DownloadResume />
|
||||
</section>
|
||||
</motion.section>
|
||||
</InView>
|
||||
)
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { motion } from 'motion/react'
|
||||
import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { experiences } from '@/data/experience'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
@@ -8,40 +9,52 @@ import { useField, useFieldArray } from '@/i18n/useField'
|
||||
export function ExperiencePage() {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<section className="section container-content" aria-labelledby="experience-heading">
|
||||
<SectionHeading title={strings.experience.heading[lang]} tag={strings.common.experienceTag[lang]} />
|
||||
<div className="timeline">
|
||||
{experiences.map((exp, i) => (
|
||||
<motion.div
|
||||
key={exp.id}
|
||||
className={exp.variant ? `timeline-entry timeline-entry-${exp.variant}` : 'timeline-entry'}
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={{ duration: 0.45, ease: 'easeOut', delay: i * 0.08 }}
|
||||
>
|
||||
<div className="timeline-marker" />
|
||||
<div className="timeline-header">
|
||||
<div className="timeline-title">{useField(exp.title, exp.titleEn)}</div>
|
||||
<div className="timeline-company">{exp.company}</div>
|
||||
<div className="timeline-meta">
|
||||
<span className="timeline-duration">{exp.duration}</span>
|
||||
{exp.location && <span className="timeline-location">{exp.location}</span>}
|
||||
<InView>
|
||||
<motion.section
|
||||
className="section container-content"
|
||||
aria-labelledby="experience-heading"
|
||||
initial="hidden"
|
||||
whileInView="visible"
|
||||
viewport={{ once: true, amount: 0.1 }}
|
||||
variants={{
|
||||
hidden: { opacity: 0 },
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title={strings.experience.heading[lang]} tag={strings.common.experienceTag[lang]} />
|
||||
<div className="timeline">
|
||||
{experiences.map((exp, i) => (
|
||||
<motion.div
|
||||
key={exp.id}
|
||||
className={exp.variant ? `timeline-entry timeline-entry-${exp.variant}` : 'timeline-entry'}
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={{ duration: 0.45, ease: 'easeOut', delay: i * 0.08 }}
|
||||
>
|
||||
<div className="timeline-marker" />
|
||||
<div className="timeline-header">
|
||||
<div className="timeline-title">{useField(exp.title, exp.titleEn)}</div>
|
||||
<div className="timeline-company">{exp.company}</div>
|
||||
<div className="timeline-meta">
|
||||
<span className="timeline-duration">{exp.duration}</span>
|
||||
{exp.location && <span className="timeline-location">{exp.location}</span>}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul className="timeline-responsibilities">
|
||||
{useFieldArray(exp.responsibilities, exp.responsibilitiesEn).map((r) => (
|
||||
<li key={r}>{r}</li>
|
||||
))}
|
||||
</ul>
|
||||
</motion.div>
|
||||
))}
|
||||
<div className="timeline-tldr">
|
||||
<span className="timeline-tldr-marker" aria-hidden="true" />
|
||||
<span className="timeline-tldr-chip">{strings.experience.tldr[lang]}</span>
|
||||
<p className="timeline-tldr-text">{strings.experience.tldrText[lang]}</p>
|
||||
<ul className="timeline-responsibilities">
|
||||
{useFieldArray(exp.responsibilities, exp.responsibilitiesEn).map((r) => (
|
||||
<li key={r}>{r}</li>
|
||||
))}
|
||||
</ul>
|
||||
</motion.div>
|
||||
))}
|
||||
<div className="timeline-tldr">
|
||||
<span className="timeline-tldr-marker" aria-hidden="true" />
|
||||
<span className="timeline-tldr-chip">{strings.experience.tldr[lang]}</span>
|
||||
<p className="timeline-tldr-text">{strings.experience.tldrText[lang]}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</motion.section>
|
||||
</InView>
|
||||
)
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
import {SectionHeading} from '@/components/ui/SectionHeading'
|
||||
import {motion} from 'motion/react'
|
||||
import {InView} from '@/components/ui/InView'
|
||||
|
||||
import {useLanguage} from '@/hooks/useLanguage'
|
||||
import {strings} from '@/i18n/strings'
|
||||
@@ -6,18 +8,37 @@ import {strings} from '@/i18n/strings'
|
||||
export function PhilosophyPage() {
|
||||
const {lang} = useLanguage()
|
||||
return (
|
||||
<section className="section container-content" aria-labelledby="philosophy-heading">
|
||||
<SectionHeading id="philosophy-heading" title={strings.philosophy.heading[lang]} tag={strings.philosophy.heading[lang]}/>
|
||||
<div className="prose prose-wide">
|
||||
{strings.philosophy.quotes.map((quote) => (
|
||||
<div key={quote.title[lang]} className="philosophy-quote">
|
||||
<h3>
|
||||
{quote.title[lang]}
|
||||
</h3>
|
||||
<div dangerouslySetInnerHTML={{__html: quote.details[lang]}}/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
<InView>
|
||||
<motion.section
|
||||
className="section container-content"
|
||||
aria-labelledby="philosophy-heading"
|
||||
initial="hidden"
|
||||
whileInView="visible"
|
||||
viewport={{once: true, amount: 0.1}}
|
||||
variants={{
|
||||
hidden: {opacity: 0},
|
||||
visible: {opacity: 1, transition: {duration: 0.5}},
|
||||
}}
|
||||
>
|
||||
<SectionHeading id="philosophy-heading" title={strings.philosophy.heading[lang]} tag={strings.philosophy.heading[lang]}/>
|
||||
<div className="prose prose-wide">
|
||||
{strings.philosophy.quotes.map((quote, i) => (
|
||||
<motion.div
|
||||
key={quote.title[lang]}
|
||||
className="philosophy-quote"
|
||||
initial={{opacity: 0, y: 24}}
|
||||
whileInView={{opacity: 1, y: 0}}
|
||||
viewport={{once: true, amount: 0.2}}
|
||||
transition={{duration: 0.45, ease: 'easeOut', delay: i * 0.08}}
|
||||
>
|
||||
<h3>
|
||||
{quote.title[lang]}
|
||||
</h3>
|
||||
<div dangerouslySetInnerHTML={{__html: quote.details[lang]}}/>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
</motion.section>
|
||||
</InView>
|
||||
)
|
||||
}
|
||||
+125
-55
@@ -1,11 +1,23 @@
|
||||
import { useParams, Link } from 'react-router'
|
||||
import { motion, type Transition } from 'motion/react'
|
||||
import { Badge } from '@/components/ui/Badge'
|
||||
import { Tag } from '@/components/ui/Tag'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { projects } from '@/data/projects'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { useField } from '@/i18n/useField'
|
||||
|
||||
const sectionVariants = {
|
||||
hidden: { opacity: 0 },
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}
|
||||
|
||||
const itemTransition = (delay: number): Transition => ({
|
||||
duration: 0.45,
|
||||
ease: 'easeOut',
|
||||
delay,
|
||||
})
|
||||
|
||||
export function ProjectDetailPage() {
|
||||
const { id } = useParams<{ id: string }>()
|
||||
@@ -14,71 +26,129 @@ export function ProjectDetailPage() {
|
||||
|
||||
if (!project) {
|
||||
return (
|
||||
<section className="section container-content">
|
||||
<h2>{strings.projectDetail.notFound[lang]}</h2>
|
||||
<p>
|
||||
<Link to="/projects">{strings.projectDetail.backToProjects[lang]} ←</Link>
|
||||
</p>
|
||||
</section>
|
||||
<InView>
|
||||
<motion.section
|
||||
className="section container-content"
|
||||
initial="hidden"
|
||||
whileInView="visible"
|
||||
viewport={{ once: true, amount: 0.1 }}
|
||||
variants={sectionVariants}
|
||||
>
|
||||
<h2>{strings.projectDetail.notFound[lang]}</h2>
|
||||
<p>
|
||||
<Link to="/projects">{strings.projectDetail.backToProjects[lang]} ←</Link>
|
||||
</p>
|
||||
</motion.section>
|
||||
</InView>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<section className="section container-content" aria-labelledby="project-title">
|
||||
<Link to="/projects" className="back-link">
|
||||
{strings.projectDetail.backToProjects[lang]} ←
|
||||
</Link>
|
||||
<InView>
|
||||
<motion.section
|
||||
className="section container-content"
|
||||
aria-labelledby="project-title"
|
||||
initial="hidden"
|
||||
whileInView="visible"
|
||||
viewport={{ once: true, amount: 0.1 }}
|
||||
variants={sectionVariants}
|
||||
>
|
||||
<Link to="/projects" className="back-link">
|
||||
{strings.projectDetail.backToProjects[lang]} ←
|
||||
</Link>
|
||||
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: '16px', marginBottom: '16px' }}>
|
||||
<h1 id="project-title" style={{ flex: 1 }}>{project.title}</h1>
|
||||
<Badge variant="outline">{strings.projects.categories[project.category][lang]}</Badge>
|
||||
</div>
|
||||
<motion.div
|
||||
style={{ display: 'flex', alignItems: 'center', gap: '16px', marginBottom: '16px' }}
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0)}
|
||||
>
|
||||
<h1 id="project-title" style={{ flex: 1 }}>{project.title}</h1>
|
||||
<Badge variant="outline">{strings.projects.categories[project.category][lang]}</Badge>
|
||||
</motion.div>
|
||||
|
||||
<p className="prose-lede">
|
||||
{useField(project.summary, project.summaryEn)}
|
||||
</p>
|
||||
<motion.p
|
||||
className="prose-lede"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.08)}
|
||||
>
|
||||
{useField(project.summary, project.summaryEn)}
|
||||
</motion.p>
|
||||
|
||||
<div className="prose">
|
||||
{project.metrics && project.metrics.length > 0 && (
|
||||
<div>
|
||||
<h3>{strings.projectDetail.impact[lang]}</h3>
|
||||
<div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap' }}>
|
||||
{project.metrics.map((m) => (
|
||||
<span key={m} className="achievement-metric">
|
||||
{m}
|
||||
</span>
|
||||
<div className="prose">
|
||||
{project.metrics && project.metrics.length > 0 && (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.16)}
|
||||
>
|
||||
<h3>{strings.projectDetail.impact[lang]}</h3>
|
||||
<div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap' }}>
|
||||
{project.metrics.map((m) => (
|
||||
<span key={m} className="achievement-metric">
|
||||
{m}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</motion.div>
|
||||
)}
|
||||
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.24)}
|
||||
>
|
||||
<h3>{strings.projectDetail.role[lang]}</h3>
|
||||
<p>{project.role}</p>
|
||||
</motion.div>
|
||||
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.32)}
|
||||
>
|
||||
<h3>{strings.projectDetail.technologies[lang]}</h3>
|
||||
<div className="philosophy-keywords">
|
||||
{project.technologies.map((tech) => (
|
||||
<Tag key={tech}>{tech}</Tag>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
|
||||
<div>
|
||||
<h3>{strings.projectDetail.role[lang]}</h3>
|
||||
<p>{project.role}</p>
|
||||
{project.sections && project.sections.length > 0 && (
|
||||
<div>
|
||||
<motion.h3
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.4)}
|
||||
>
|
||||
{strings.projectDetail.experiments[lang]}
|
||||
</motion.h3>
|
||||
{project.sections.map((section, idx) => (
|
||||
<motion.div
|
||||
key={idx}
|
||||
className="project-section"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={itemTransition(0.48 + idx * 0.08)}
|
||||
>
|
||||
<h4>{useField(section.title, section.titleEn)}</h4>
|
||||
<p>{useField(section.content, section.contentEn)}</p>
|
||||
<Tag accent>{section.type}</Tag>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3>{strings.projectDetail.technologies[lang]}</h3>
|
||||
<div className="philosophy-keywords">
|
||||
{project.technologies.map((tech) => (
|
||||
<Tag key={tech}>{tech}</Tag>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{project.sections && project.sections.length > 0 && (
|
||||
<div>
|
||||
<h3>{strings.projectDetail.experiments[lang]}</h3>
|
||||
{project.sections.map((section, idx) => (
|
||||
<div key={idx} className="project-section">
|
||||
<h4>{useField(section.title, section.titleEn)}</h4>
|
||||
<p>{useField(section.content, section.contentEn)}</p>
|
||||
<Tag accent>{section.type}</Tag>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
</motion.section>
|
||||
</InView>
|
||||
)
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { Badge } from '@/components/ui/Badge'
|
||||
import { motion } from 'motion/react'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { projects } from '@/data/projects'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
@@ -7,36 +9,56 @@ import { useField } from '@/i18n/useField'
|
||||
|
||||
import { Link } from 'react-router'
|
||||
|
||||
const MotionLink = motion.create(Link)
|
||||
|
||||
export function ProjectsListPage() {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<section className="section container-wide" aria-labelledby="projects-heading">
|
||||
<SectionHeading title={strings.projects.all[lang]} tag={strings.projects.all[lang]} />
|
||||
<div className="projects-grid">
|
||||
{projects.map((project) => (
|
||||
<Link
|
||||
key={project.id}
|
||||
to={`/projects/${project.id}`}
|
||||
className="project-card"
|
||||
>
|
||||
<div className="project-card-header">
|
||||
<h3>{project.title}</h3>
|
||||
<Badge variant="outline">
|
||||
{strings.projects.categories[project.category][lang]}
|
||||
</Badge>
|
||||
</div>
|
||||
<p className="project-card-summary">{useField(project.summary, project.summaryEn)}</p>
|
||||
<div className="project-card-techs">
|
||||
{project.technologies.slice(0, 4).map((tech) => (
|
||||
<span key={tech} className="tag">
|
||||
{tech}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<span className="project-card-cta">{strings.projects.viewDetails[lang]} →</span>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
<InView>
|
||||
<motion.section
|
||||
className="section container-wide"
|
||||
aria-labelledby="projects-heading"
|
||||
initial="hidden"
|
||||
whileInView="visible"
|
||||
viewport={{ once: true, amount: 0.1 }}
|
||||
variants={{
|
||||
hidden: { opacity: 0 },
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title={strings.projects.all[lang]} tag={strings.projects.all[lang]} />
|
||||
<div className="projects-grid">
|
||||
{projects.map((project, i) => (
|
||||
<MotionLink
|
||||
key={project.id}
|
||||
to={`/projects/${project.id}`}
|
||||
className="project-card"
|
||||
initial={{ opacity: 0, y: 24 }}
|
||||
whileInView={{ opacity: 1, y: 0 }}
|
||||
viewport={{ once: true, amount: 0.2 }}
|
||||
transition={{ duration: 0.45, ease: 'easeOut', delay: i * 0.08 }}
|
||||
whileHover={{ scale: 1.02, y: -4 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<div className="project-card-header">
|
||||
<h3>{project.title}</h3>
|
||||
<Badge variant="outline">
|
||||
{strings.projects.categories[project.category][lang]}
|
||||
</Badge>
|
||||
</div>
|
||||
<p className="project-card-summary">{useField(project.summary, project.summaryEn)}</p>
|
||||
<div className="project-card-techs">
|
||||
{project.technologies.slice(0, 4).map((tech) => (
|
||||
<span key={tech} className="tag">
|
||||
{tech}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<span className="project-card-cta">{strings.projects.viewDetails[lang]} →</span>
|
||||
</MotionLink>
|
||||
))}
|
||||
</div>
|
||||
</motion.section>
|
||||
</InView>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user