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
@@ -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>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user