Files
cv/src/components/sections/Expertise.tsx
T
dong.nguyen 4387f889f5 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
2026-10-17 20:02:47 +07:00

52 lines
1.8 KiB
TypeScript

import { motion } from "motion/react"
import { SectionHeading } from "@/components/ui/SectionHeading"
import { skillGroups } from "@/data/skills"
import { InView } from "@/components/ui/InView"
import { useLanguage } from '@/hooks/useLanguage'
import { strings } from '@/i18n/strings'
import { useField } from '@/i18n/useField'
export function Expertise() {
const { lang } = useLanguage()
return (
<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.expertise.heading[lang]} tag={strings.expertise.heading[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) => (
<li key={skill} className="expertise-skill">
{skill}
</li>
))}
</ul>
</motion.div>
))}
</div>
</motion.section>
</InView>
)
}