mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-23 00:20: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>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user