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:
dong.nguyen committed 2026-10-17 20:02:47 +07:00
1 parent ae4a5b9cca
commit 4387f889f5
18 files changed
+885 -490

No files matched your search

+50 -29
View File
@@ -450,7 +450,7 @@
border-radius: var(--radius-md);
cursor: pointer;
text-decoration: none;
transition: all var(--transition-fast);
transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
border: none;
}
@@ -469,12 +469,10 @@
.btn-primary:hover {
background: var(--accent-solid-hover);
color: var(--text-on-accent-solid);
transform: translateY(-2px);
box-shadow: 0 8px 30px var(--accent-glow);
}
.btn-primary:active {
background: var(--accent-solid-active);
transform: translateY(0);
box-shadow: 0 2px 10px var(--accent-glow);
}
@@ -488,10 +486,6 @@
.btn-secondary:hover {
border-color: var(--accent);
background: var(--accent-soft);
transform: translateY(-2px);
}
.btn-secondary:active {
transform: translateY(0);
}
.btn-icon {
@@ -611,12 +605,11 @@
border: 1.5px solid var(--border-strong);
border-radius: 6px;
color: var(--text-primary);
transition: color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
transition: color var(--transition-fast), border-color var(--transition-fast);
}
.social-link:hover {
border-color: var(--accent);
color: var(--accent);
transform: translateY(-3px);
}
.social-link:focus-visible {
outline: 2px solid var(--accent);
@@ -758,26 +751,52 @@
50% { opacity: 0; }
}
/* No mask-image on .hero-particles on purpose: a mask pulls the animated children into
one re-rasterized group, the same cost as filter: blur(). The 12% / 88% opacity ramp in
float-particle dissolves each dot before it reaches the clip edge, so the edges need no
extra softening. */
.hero-particles {
position: absolute;
inset: 0;
overflow: hidden;
pointer-events: none;
}
/* One layer per depth tier. `perspective` belongs on the layer, not on
.hero-particles: overflow: hidden on the container forces its used transform-style
to flat, so a perspective declared there would project only the three layers and
never the particles. Clipping stays on the container. */
.hero-particle-layer {
position: absolute;
inset: 0;
perspective: 700px;
perspective-origin: 50% 78%;
}
.hero-particle {
position: absolute;
width: 4px;
height: 4px;
background: var(--accent);
border-radius: 50%;
opacity: 0.8;
opacity: 0;
animation: float-particle linear infinite;
}
/* Depth cue for the tier closest to the viewer. box-shadow, not filter: blur() —
animating children inside a filtered container re-rasterizes the whole layer every
frame, which is the main takedown risk on iPad. 6 particles; --accent-glow is
declared in all five blocks of index.css. */
.hero-particle-layer--near .hero-particle {
box-shadow: 0 0 10px var(--accent-glow);
}
/* --p-from / --p-to are raw translateY offsets from the top of the layer, tuned per
tier so that after projection (700px, origin 50% 78%) every tier crosses the full
hero box: far z -500 -> -180 projects 0.58x -> 0.80x, mid 0.70x -> 0.92x, near
z -120 -> +120 projects 0.85x -> 1.21x. Equal projected distance with a longer
duration is what makes the far tier read as slower. vh, not dvh: dvh re-resolves
when iOS Safari collapses its toolbar mid-cycle and the whole field jumps. */
@keyframes float-particle {
0% { transform: translateY(100vh) scale(0); opacity: 0; }
10% { opacity: 0.8; }
90% { opacity: 0.8; }
100% { transform: translateY(-100px) scale(1); opacity: 0; }
0% { transform: translate3d(var(--p-drift), var(--p-from), var(--p-z0)); opacity: 0; }
12% { opacity: var(--p-op); }
88% { opacity: var(--p-op); }
100% { transform: translate3d(calc(var(--p-drift) * -1), var(--p-to), var(--p-z1)); opacity: 0; }
}
.scroll-indicator {
@@ -1072,6 +1091,16 @@
.download-resume-lazer-glow {
animation: none;
}
/* Hero particles have no reduced-motion fallback: `.hero-particle` uses the
`animation` shorthand, so animation-fill-mode is `none`. The global clamp in
src/index.css (animation-duration: 0.01ms, animation-iteration-count: 1) ends
`float-particle` instantly and returns every dot to its unanimated style — no
transform, `top: auto` — stacking all of them at the top edge of
`.hero-particles`, behind the fixed nav. Hide the decorative layer instead. */
.hero-particles {
display: none;
}
}
@@ -1117,7 +1146,7 @@
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 24px;
transition: all var(--transition-normal);
transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.expertise-card:hover {
@@ -1530,7 +1559,7 @@
display: flex;
flex-direction: column;
gap: 16px;
transition: all var(--transition-normal);
transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
text-decoration: none;
color: inherit;
}
@@ -1538,7 +1567,6 @@
.project-card:hover {
border-color: var(--accent);
box-shadow: 0 4px 12px var(--shadow);
transform: translateY(-2px);
color: inherit;
}
@@ -1602,7 +1630,7 @@
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 24px;
transition: all var(--transition-normal);
transition: border-color var(--transition-normal);
}
.philosophy-card:hover {
@@ -1666,13 +1694,12 @@
background: var(--bg-surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
transition: all var(--transition-fast);
transition: border-color var(--transition-fast), color var(--transition-fast);
}
.contact-link:hover {
border-color: var(--accent);
color: var(--accent);
transform: translateY(-2px);
}
.contact-link svg {
@@ -1900,16 +1927,10 @@
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transform: translateY(10px);
transition: all var(--transition-normal);
transition: background var(--transition-fast);
z-index: 100;
}
.back-to-top.visible {
opacity: 1;
transform: translateY(0);
}
.back-to-top:hover {
background: var(--accent-hover);
+52 -32
View File
@@ -1,4 +1,5 @@
import { SectionHeading } from '@/components/ui/SectionHeading'
import { motion } from 'motion/react'
import { InView } from '@/components/ui/InView'
import { Tag } from '@/components/ui/Tag'
import { profile } from '@/data/profile'
@@ -9,40 +10,59 @@ export function About() {
const { lang } = useLanguage()
return (
<InView>
<section className="section container-wide" aria-labelledby="about-heading">
<SectionHeading title={strings.about.heading[lang]} tag={strings.about.heading[lang]} />
<p className="prose-lede lede-wide">
{useField(profile.bio, profile.bioEn)}
</p>
<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]} 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.exploringTitle[lang]}
</h3>
<div className="interests-list">
{profile.currentInterests.map((interest) => (
<Tag key={interest} accent>
{interest}
</Tag>
))}
</div>
</section>
<h3 className="subheading">
{strings.about.exploringTitle[lang]}
</h3>
<div className="interests-list">
{profile.currentInterests.map((interest) => (
<Tag key={interest} accent>
{interest}
</Tag>
))}
</div>
</motion.section>
</InView>
)
}
+18 -6
View File
@@ -27,8 +27,12 @@ export function Contact() {
<motion.a
href={`mailto:${profile.email}`}
className="contact-link"
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
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"
@@ -55,8 +59,12 @@ export function Contact() {
target="_blank"
rel="noopener noreferrer"
className="contact-link"
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
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"
@@ -80,8 +88,12 @@ export function Contact() {
target="_blank"
rel="noopener noreferrer"
className="contact-link"
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
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"
+6 -13
View File
@@ -18,10 +18,7 @@ export function Expertise() {
viewport={{ once: true, amount: 0.1 }}
variants={{
hidden: { opacity: 0 },
visible: {
opacity: 1,
transition: { staggerChildren: 0.1 },
},
visible: { opacity: 1, transition: { duration: 0.5 } },
}}
>
<SectionHeading title={strings.expertise.heading[lang]} tag={strings.expertise.heading[lang]} />
@@ -30,15 +27,11 @@ export function Expertise() {
<motion.div
key={group.title}
className="expertise-card"
variants={{
hidden: { opacity: 0, y: 30 },
visible: {
opacity: 1,
y: 0,
transition: { duration: 0.5, delay: i * 0.1 },
},
}}
whileHover={{ scale: 1.05, y: -2 }}
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>
+38 -30
View File
@@ -37,23 +37,26 @@ export function Hero() {
<InView>
<motion.section
className="hero container-wide"
initial={{opacity: 0}}
animate={{opacity: 1}}
transition={{duration: 0.3}}
initial="hidden"
whileInView="visible"
viewport={{once: true, amount: 0.1}}
variants={{
hidden: {opacity: 0},
visible: {opacity: 1, transition: {duration: 0.5}},
}}
aria-labelledby="hero-heading"
>
<div className="hero-bg-grid"/>
<HeroParticles/>
<motion.div
className="hero-content"
initial={{opacity: 0, x: -30}}
animate={{opacity: 1, x: 0}}
transition={{duration: 0.6, delay: 0.2}}
>
{/* Entrance belongs to the items (whileInView + delay 0, 0.08, 0.16, 0.24,
0.32, 0.4 = i * 0.08), exactly like the timeline entries; the wrapper no
longer slides in on its own, so there is one fade, not three. */}
<div className="hero-content">
<motion.div
initial={{opacity: 0, y: 10}}
animate={{opacity: 1, y: 0}}
transition={{duration: 0.4, delay: 0.15}}
initial={{opacity: 0, y: 24}}
whileInView={{opacity: 1, y: 0}}
viewport={{once: true, amount: 0.2}}
transition={{duration: 0.45, ease: "easeOut", delay: 0}}
>
<span className="hero-greeting">
<span className="greeting-dot"/>
@@ -63,32 +66,36 @@ export function Hero() {
<motion.h1
id="hero-heading"
className="hero-name"
initial={{opacity: 0, y: 20}}
animate={{opacity: 1, y: 0}}
transition={{duration: 0.5, delay: 0.3}}
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}}
>
<span className="name-highlight">{useField(profile.name, profile.nameEn)}</span>
</motion.h1>
<motion.p
className="hero-title"
initial={{opacity: 0, y: 20}}
animate={{opacity: 1, y: 0}}
transition={{duration: 0.5, delay: 0.4}}
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}}
>
<Typewriter texts={profile.roles}/>
</motion.p>
<motion.p
className="hero-tagline"
initial={{opacity: 0, y: 20}}
animate={{opacity: 1, y: 0}}
transition={{duration: 0.5, delay: 0.5}}
initial={{opacity: 0, y: 24}}
whileInView={{opacity: 1, y: 0}}
viewport={{once: true, amount: 0.2}}
transition={{duration: 0.45, ease: "easeOut", delay: 0.24}}
dangerouslySetInnerHTML={{__html: useField(profile.tagline, profile.taglineEn)}}
/>
<motion.div
className="hero-cta"
initial={{opacity: 0, y: 20}}
animate={{opacity: 1, y: 0}}
transition={{duration: 0.5, delay: 0.6}}
initial={{opacity: 0, y: 24}}
whileInView={{opacity: 1, y: 0}}
viewport={{once: true, amount: 0.2}}
transition={{duration: 0.45, ease: "easeOut", delay: 0.32}}
>
<Button href="/projects" variant="primary">
{strings.hero.ctaProjects[lang]}
@@ -112,7 +119,7 @@ export function Hero() {
<SocialLinks />
</motion.div>
</motion.div>
</div>
<div className="scroll-indicator" aria-hidden="true">
<div className="scroll-mouse">
<div className="scroll-wheel"/>
@@ -121,15 +128,16 @@ export function Hero() {
</div>
<motion.div
className="hero-visual"
style={{y}}
initial={{opacity: 0, x: 30}}
animate={{opacity: 1, x: 0}}
transition={{duration: 0.6, delay: 0.4}}
initial={{opacity: 0, y: 24}}
whileInView={{opacity: 1, y: 0}}
viewport={{once: true, amount: 0.2}}
transition={{duration: 0.45, ease: "easeOut", delay: 0.4}}
>
<img
<motion.img
src="/profile-photo.webp"
alt="Profile photo"
className="hero-photo"
style={{y}}
/>
</motion.div>
</motion.section>
+134 -22
View File
@@ -1,33 +1,145 @@
import { useMemo } from "react"
import { useMemo, type CSSProperties } from "react"
import { motion, useScroll, useTransform, type MotionValue } from "motion/react"
/**
* The dots read as depth because each tier travels through a perspective-projected
* z range instead of being scaled by hand: a particle at z = -500px is projected at
* 700 / 1200 = 0.58x, one at z = +120px at 700 / 580 = 1.21x — so the near tier grows *and*
* fans out away from the vanishing point, which scale() alone cannot fake.
*
* `from` / `to` are raw translateY offsets from the top of the layer, tuned per tier
* so that after projection every tier crosses the whole hero box (derivation in
* App.css). Same projected distance + longer duration = slower on screen = further away.
*/
interface DepthTier {
id: "far" | "mid" | "near"
/** translateZ at 0% (deep) and 100% (towards the viewer) of one cycle, in px */
z: [number, number]
/** raw translateY at 0% and 100%, in vh from the top of the layer */
from: number
to: number
size: [number, number]
opacity: number
duration: [number, number]
/** ± lateral sweep in px; projection amplifies it, so the near tier sweeps widest */
drift: number
counts: { desktop: number; mobile: number }
/** px of scroll parallax across SCROLL_RANGE; the near tier moves fastest */
scrollShift: number
}
const FAR: DepthTier = {
id: "far",
z: [-500, -180],
from: 121,
to: -29,
size: [6, 9],
opacity: 0.22,
duration: [16, 24],
drift: 14,
counts: { desktop: 12, mobile: 6 },
scrollShift: -30,
}
const MID: DepthTier = {
id: "mid",
z: [-300, -60],
from: 114,
to: -14,
size: [7, 11],
opacity: 0.45,
duration: [11, 17],
drift: 26,
counts: { desktop: 12, mobile: 6 },
scrollShift: -60,
}
const NEAR: DepthTier = {
id: "near",
z: [-120, 120],
from: 103,
to: 17,
size: [7, 12],
opacity: 0.8,
duration: [7, 11],
drift: 40,
counts: { desktop: 6, mobile: 3 },
scrollShift: -100,
}
const depthTiers: DepthTier[] = [FAR, MID, NEAR]
const SCROLL_RANGE: [number, number] = [0, 500]
interface Particle {
id: number
left: number
size: number
duration: number
delay: number
drift: number
opacity: number
}
function createParticles(tier: DepthTier, count: number): Particle[] {
return Array.from({ length: count }, (_, id) => ({
id,
left: Math.random() * 100,
size: tier.size[0] + Math.random() * (tier.size[1] - tier.size[0]),
duration: tier.duration[0] + Math.random() * (tier.duration[1] - tier.duration[0]),
// Applied as a negative animation-delay: every cycle is already in progress at
// mount, so the hero is populated immediately instead of filling in over 10s.
delay: Math.random() * tier.duration[1],
drift: (Math.random() * 2 - 1) * tier.drift,
opacity: tier.opacity * (0.75 + Math.random() * 0.35),
}))
}
function particleStyle(particle: Particle, tier: DepthTier): CSSProperties {
return {
left: `${particle.left}%`,
width: `${particle.size}px`,
height: `${particle.size}px`,
animationDuration: `${particle.duration}s`,
animationDelay: `-${particle.delay}s`,
"--p-from": `${tier.from}vh`,
"--p-to": `${tier.to}vh`,
"--p-z0": `${tier.z[0]}px`,
"--p-z1": `${tier.z[1]}px`,
"--p-drift": `${particle.drift}px`,
"--p-op": particle.opacity,
} as CSSProperties
}
export function HeroParticles() {
const count = typeof window !== "undefined" && window.innerWidth < 768 ? 15 : 30
const particles = useMemo(
const isMobile = typeof window !== "undefined" && window.innerWidth < 768
const { scrollY } = useScroll()
const layerY: Record<DepthTier["id"], MotionValue<number>> = {
far: useTransform(scrollY, SCROLL_RANGE, [0, FAR.scrollShift]),
mid: useTransform(scrollY, SCROLL_RANGE, [0, MID.scrollShift]),
near: useTransform(scrollY, SCROLL_RANGE, [0, NEAR.scrollShift]),
}
const layers = useMemo(
() =>
Array.from({ length: count }, (_, i) => ({
id: i,
left: `${Math.random() * 100}%`,
duration: `${Math.random() * 10 + 6}s`,
delay: `${Math.random() * 10}s`,
size: `${Math.random() * 10 + 6}px`,
depthTiers.map((tier) => ({
tier,
particles: createParticles(tier, isMobile ? tier.counts.mobile : tier.counts.desktop),
})),
[count],
[isMobile],
)
return (
<div className="hero-particles" aria-hidden="true">
{particles.map((p) => (
<div
key={p.id}
className="hero-particle"
style={{
left: p.left,
width: p.size,
height: p.size,
animationDuration: p.duration,
animationDelay: p.delay,
}}
/>
{layers.map(({ tier, particles }) => (
<motion.div
key={tier.id}
className={`hero-particle-layer hero-particle-layer--${tier.id}`}
style={{ y: layerY[tier.id] }}
>
{particles.map((particle) => (
<div key={particle.id} className="hero-particle" style={particleStyle(particle, tier)} />
))}
</motion.div>
))}
</div>
)
+5 -12
View File
@@ -24,10 +24,7 @@ export function Projects() {
viewport={{ once: true, amount: 0.1 }}
variants={{
hidden: { opacity: 0 },
visible: {
opacity: 1,
transition: { staggerChildren: 0.1 },
},
visible: { opacity: 1, transition: { duration: 0.5 } },
}}
>
<SectionHeading title={strings.projects.featured[lang]} tag={strings.projects.featured[lang]} />
@@ -43,14 +40,10 @@ export function Projects() {
key={project.id}
to={`/projects/${project.id}`}
className="project-card"
variants={{
hidden: { opacity: 0, y: 30 },
visible: {
opacity: 1,
y: 0,
transition: { duration: 0.5, delay: i * 0.1 },
},
}}
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 }}
>
-37
View File
@@ -1,37 +0,0 @@
import { motion } from "motion/react"
import { InView } from "@/components/ui/InView"
import type { ReactNode } from "react"
interface AnimatedSectionProps {
direction?: "up" | "right" | "left"
delay?: number
children: ReactNode
}
function getDirection(direction: 'up' | 'right' | 'left') {
switch (direction) {
case 'up': return { y: [40, 0], opacity: [0, 1] }
case 'right': return { x: [-40, 0], opacity: [0, 1] }
case 'left': return { x: [40, 0], opacity: [0, 1] }
}
}
export function AnimatedSection({
direction = "up",
delay = 0,
children,
}: AnimatedSectionProps) {
const { y, opacity } = getDirection(direction)
return (
<InView>
<motion.div
initial={{ y, opacity }}
whileInView={{ y: 0, opacity: 1 }}
viewport={{ once: true, margin: "0px 0px -50px 0px" }}
transition={{ duration: 0.6, delay, ease: [0.25, 0.1, 0.25, 1] }}
>
{children}
</motion.div>
</InView>
)
}
+3
View File
@@ -59,6 +59,7 @@ export const Button = forwardRef<
to={href}
className={classes}
ref={ref as React.Ref<HTMLAnchorElement>}
whileHover={{ y: -2 }}
whileTap={{ scale: 0.95 }}
{...(safeProps as Omit<
React.AnchorHTMLAttributes<HTMLAnchorElement>,
@@ -78,6 +79,7 @@ export const Button = forwardRef<
href={href}
className={classes}
ref={ref as React.Ref<HTMLAnchorElement>}
whileHover={{ y: -2 }}
whileTap={{ scale: 0.95 }}
{...(props as Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof ButtonProps>)}
>
@@ -93,6 +95,7 @@ export const Button = forwardRef<
<motion.button
className={classes}
ref={ref as React.Ref<HTMLButtonElement>}
whileHover={{ y: -2 }}
whileTap={{ scale: 0.95 }}
{...(props as Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof ButtonProps>)}
>
+97 -58
View File
@@ -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>
</>
)
}
+53 -8
View File
@@ -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>
)
}
+46 -33
View File
@@ -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>
)
}
+34 -13
View File
@@ -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
View File
@@ -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>
)
}
+50 -28
View File
@@ -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>
)
}