mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
support multi languages
This commit is contained in:
1 parent
ca8ff2f983
commit
72a832c781
24 files changed
+995
-175
No files matched your search
+15
-12
@@ -2,6 +2,7 @@ import './App.css'
|
||||
import { BrowserRouter, Routes, Route } from 'react-router'
|
||||
import { ThemeProvider } from '@/hooks/useTheme'
|
||||
import { Layout } from '@/components/layout/Layout'
|
||||
import { LanguageProvider } from '@/hooks/useLanguage'
|
||||
import {
|
||||
HomePage,
|
||||
AboutPage,
|
||||
@@ -14,21 +15,23 @@ import {
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<ThemeProvider>
|
||||
<BrowserRouter>
|
||||
<Layout>
|
||||
<Routes>
|
||||
<Route path="/" element={<HomePage />} />
|
||||
<Route path="/about" element={<AboutPage />} />
|
||||
<Route path="/experience" element={<ExperiencePage />} />
|
||||
<Route path="/projects" element={<ProjectsListPage />} />
|
||||
<Route path="/projects/:id" element={<ProjectDetailPage />} />
|
||||
<Route path="/engineering" element={<EngineeringPage />} />
|
||||
<Route path="/contact" element={<ContactPage />} />
|
||||
<BrowserRouter>
|
||||
<ThemeProvider>
|
||||
<LanguageProvider>
|
||||
<Layout>
|
||||
<Routes>
|
||||
<Route path="/" element={<HomePage />} />
|
||||
<Route path="/about" element={<AboutPage />} />
|
||||
<Route path="/experience" element={<ExperiencePage />} />
|
||||
<Route path="/projects" element={<ProjectsListPage />} />
|
||||
<Route path="/projects/:id" element={<ProjectDetailPage />} />
|
||||
<Route path="/engineering" element={<EngineeringPage />} />
|
||||
<Route path="/contact" element={<ContactPage />} />
|
||||
</Routes>
|
||||
</Layout>
|
||||
</BrowserRouter>
|
||||
</LanguageProvider>
|
||||
</ThemeProvider>
|
||||
</BrowserRouter>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,31 +1,32 @@
|
||||
import { Link } from 'react-router'
|
||||
import { profile } from '@/data/profile'
|
||||
|
||||
const footerLinks = [
|
||||
{ label: 'Home', path: '/' },
|
||||
{ label: 'About', path: '/about' },
|
||||
{ label: 'Projects', path: '/projects' },
|
||||
{ label: 'Contact', path: '/contact' },
|
||||
]
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
const footerPaths = ['/', '/about', '/projects', '/contact'] as const
|
||||
|
||||
export function Footer() {
|
||||
const year = new Date().getFullYear()
|
||||
const { lang } = useLanguage()
|
||||
|
||||
return (
|
||||
<footer className="footer" role="contentinfo">
|
||||
<div className="footer-container">
|
||||
<p className="footer-text">
|
||||
© {year} {profile.name}. All rights reserved.
|
||||
© {year} {profile.name}. {strings.footer.copyright[lang]}
|
||||
</p>
|
||||
|
||||
<ul className="footer-links">
|
||||
{footerLinks.map((link) => (
|
||||
<li key={link.path}>
|
||||
<Link to={link.path} className="footer-link">
|
||||
{link.label}
|
||||
</Link>
|
||||
</li>
|
||||
))}
|
||||
{footerPaths.map((path) => {
|
||||
const key = path === '/' ? 'home' : path.replace('/', '') as keyof typeof strings.footer.links
|
||||
const label = strings.footer.links[key][lang]
|
||||
return (
|
||||
<li key={path}>
|
||||
<Link to={path} className="footer-link">
|
||||
{label}
|
||||
</Link>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
|
||||
<div className="social-links">
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { Navigation } from './Navigation'
|
||||
import { BackToTop } from '@/components/ui/BackToTop'
|
||||
import { Footer } from './Footer'
|
||||
@@ -7,10 +9,11 @@ interface LayoutProps {
|
||||
}
|
||||
|
||||
export function Layout({ children }: LayoutProps) {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<>
|
||||
<a href="#main-content" className="skip-link">
|
||||
Skip to content
|
||||
{strings.common.skipLink[lang]}
|
||||
</a>
|
||||
<Navigation />
|
||||
<main id="main-content" style={{ flex: 1 }}>
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import { Link, useLocation } from 'react-router'
|
||||
import { useTheme } from '@/hooks/useTheme'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { RollingTextLink } from '@/components/ui/RollingTextLink'
|
||||
|
||||
const navItems = [
|
||||
{ label: 'Home', path: '/' },
|
||||
{ label: 'About', path: '/about' },
|
||||
{ label: 'Experience', path: '/experience' },
|
||||
{ label: 'Projects', path: '/projects' },
|
||||
{ label: 'Engineering', path: '/engineering' },
|
||||
{ label: 'Contact', path: '/contact' },
|
||||
]
|
||||
|
||||
const navPaths = ['/', '/about', '/experience', '/projects', '/engineering', '/contact'] as const
|
||||
export function Navigation() {
|
||||
const { cycleTheme, resolvedTheme } = useTheme()
|
||||
const { lang, toggleLang } = useLanguage()
|
||||
const [mobileOpen, setMobileOpen] = useState(false)
|
||||
const location = useLocation()
|
||||
|
||||
@@ -43,16 +37,20 @@ export function Navigation() {
|
||||
</Link>
|
||||
|
||||
<ul className="nav-menu">
|
||||
{navItems.map((item) => (
|
||||
<li key={item.path}>
|
||||
<RollingTextLink
|
||||
to={item.path}
|
||||
className={item.path === location.pathname ? 'nav-link active' : 'nav-link'}
|
||||
>
|
||||
{item.label}
|
||||
</RollingTextLink>
|
||||
</li>
|
||||
))}
|
||||
{navPaths.map((path) => {
|
||||
const navKey = path === '/' ? 'home' : path.replace('/', '') as keyof typeof strings.nav
|
||||
const label = strings.nav[navKey][lang]
|
||||
return (
|
||||
<li key={path}>
|
||||
<RollingTextLink
|
||||
to={path}
|
||||
className={path === location.pathname ? 'nav-link active' : 'nav-link'}
|
||||
>
|
||||
{label}
|
||||
</RollingTextLink>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
|
||||
<div className="nav-actions">
|
||||
@@ -74,6 +72,14 @@ export function Navigation() {
|
||||
)}
|
||||
</button>
|
||||
|
||||
<button
|
||||
className="lang-toggle"
|
||||
onClick={toggleLang}
|
||||
aria-label="Switch language"
|
||||
title={`Switch to ${lang === 'en' ? 'Tiếng Việt' : 'English'}`}
|
||||
>
|
||||
{lang === 'en' ? 'VI' : 'EN'}
|
||||
</button>
|
||||
<button
|
||||
className="mobile-menu-btn"
|
||||
onClick={() => setMobileOpen(!mobileOpen)}
|
||||
@@ -96,17 +102,21 @@ export function Navigation() {
|
||||
|
||||
<div className={`mobile-menu ${mobileOpen ? 'open' : ''}`} role="dialog" aria-label="Mobile navigation">
|
||||
<ul className="mobile-menu-list">
|
||||
{navItems.map((item) => (
|
||||
<li key={item.path}>
|
||||
<RollingTextLink
|
||||
to={item.path}
|
||||
className={item.path === location.pathname ? 'mobile-menu-link active' : 'mobile-menu-link'}
|
||||
onClick={() => setMobileOpen(false)}
|
||||
>
|
||||
{item.label}
|
||||
</RollingTextLink>
|
||||
</li>
|
||||
))}
|
||||
{navPaths.map((path) => {
|
||||
const navKey = path === '/' ? 'home' : path.replace('/', '') as keyof typeof strings.nav
|
||||
const label = strings.nav[navKey][lang]
|
||||
return (
|
||||
<li key={path}>
|
||||
<RollingTextLink
|
||||
to={path}
|
||||
className={path === location.pathname ? 'mobile-menu-link active' : 'mobile-menu-link'}
|
||||
onClick={() => setMobileOpen(false)}
|
||||
>
|
||||
{label}
|
||||
</RollingTextLink>
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
</ul>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -2,21 +2,23 @@ import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { InView } from '@/components/ui/InView'
|
||||
import { Tag } from '@/components/ui/Tag'
|
||||
import { profile } from '@/data/profile'
|
||||
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { useField } from '@/i18n/useField'
|
||||
export function About() {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<InView>
|
||||
<section className="section container-wide" aria-labelledby="about-heading">
|
||||
<SectionHeading title="About Me" tag="01 - About" />
|
||||
<SectionHeading title={strings.about.heading[lang]} tag="01 - About" />
|
||||
<div style={{ maxWidth: '700px' }}>
|
||||
<p style={{ fontSize: '18px', marginBottom: '32px' }}>
|
||||
{profile.bio}
|
||||
{useField(profile.bio, profile.bioEn)}
|
||||
</p>
|
||||
|
||||
<h3 style={{ fontSize: '20px', marginBottom: '16px', color: 'var(--text-primary)' }}>
|
||||
How I Think About Engineering
|
||||
{strings.about.engineeringTitle[lang]}
|
||||
</h3>
|
||||
|
||||
<div className="philosophy-grid">
|
||||
{profile.philosophy.map((point) => (
|
||||
<div key={point.title} className="philosophy-card">
|
||||
@@ -32,7 +34,7 @@ export function About() {
|
||||
</div>
|
||||
|
||||
<h3 style={{ fontSize: '20px', marginTop: '32px', marginBottom: '12px', color: 'var(--text-primary)' }}>
|
||||
What I'm Exploring
|
||||
{strings.about.exploringTitle[lang]}
|
||||
</h3>
|
||||
<div className="interests-list">
|
||||
{profile.currentInterests.map((interest) => (
|
||||
|
||||
@@ -3,8 +3,10 @@ import { DownloadResume } from "@/components/sections/DownloadResume"
|
||||
import { SectionHeading } from "@/components/ui/SectionHeading"
|
||||
import { profile } from "@/data/profile"
|
||||
import { InView } from "@/components/ui/InView"
|
||||
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
export function Contact() {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<InView>
|
||||
<motion.section
|
||||
@@ -18,7 +20,7 @@ export function Contact() {
|
||||
visible: { opacity: 1, transition: { duration: 0.5 } },
|
||||
}}
|
||||
>
|
||||
<SectionHeading title="Contact" tag="06 - Contact" />
|
||||
<SectionHeading title={strings.contact.heading[lang]} tag={`06 - ${strings.common.contactTag[lang]}`} />
|
||||
<div style={{ maxWidth: '700px' }}>
|
||||
<div className="contact-links">
|
||||
<motion.a
|
||||
@@ -40,7 +42,7 @@ export function Contact() {
|
||||
</svg>
|
||||
<div>
|
||||
<div style={{ fontWeight: 500, color: "var(--text-primary)" }}>
|
||||
Email
|
||||
{strings.contact.email[lang]}
|
||||
</div>
|
||||
<div style={{ fontSize: "14px", color: "var(--text-muted)" }}>
|
||||
{profile.email}
|
||||
@@ -65,7 +67,7 @@ export function Contact() {
|
||||
</svg>
|
||||
<div>
|
||||
<div style={{ fontWeight: 500, color: "var(--text-primary)" }}>
|
||||
GitHub
|
||||
{strings.contact.github[lang]}
|
||||
</div>
|
||||
<div style={{ fontSize: "14px", color: "var(--text-muted)" }}>
|
||||
@yourusername
|
||||
@@ -90,7 +92,7 @@ export function Contact() {
|
||||
</svg>
|
||||
<div>
|
||||
<div style={{ fontWeight: 500, color: "var(--text-primary)" }}>
|
||||
LinkedIn
|
||||
{strings.contact.linkedin[lang]}
|
||||
</div>
|
||||
<div style={{ fontSize: "14px", color: "var(--text-muted)" }}>
|
||||
Your Name
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { resumeAvailable, resumeUrlFor, resumeLanguages } from '@/data/resume'
|
||||
import type { Language } from '@/types'
|
||||
import { useState, useRef, useEffect } from 'react'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
|
||||
const langLabels: Record<Language, string> = {
|
||||
en: 'English',
|
||||
@@ -8,6 +10,7 @@ const langLabels: Record<Language, string> = {
|
||||
}
|
||||
|
||||
function DownloadButton({ lang }: { lang: Language }) {
|
||||
const { lang: currentLang } = useLanguage()
|
||||
return (
|
||||
<a
|
||||
href={resumeUrlFor(lang)}
|
||||
@@ -28,7 +31,7 @@ function DownloadButton({ lang }: { lang: Language }) {
|
||||
<path d="M12 2a1 1 0 0 1 1 1v9.586l2.707-2.707a1 1 0 1 1 1.414 1.414l-4.5 4.5a1 1 0 0 1-1.414 0l-4.5-4.5a1 1 0 1 1 1.414-1.414L11 12.586V3a1 1 0 0 1 1-1zm-7 16a1 1 0 1 1 0 2h14a1 1 0 1 1 0-2H5z" />
|
||||
</svg>
|
||||
<div>
|
||||
<div style={{ fontWeight: 500, color: 'var(--text-primary)' }}>Download Resume</div>
|
||||
<div style={{ fontWeight: 500, color: 'var(--text-primary)' }}>{strings.common.resumeDownload[currentLang]}</div>
|
||||
<div style={{ fontSize: '14px', color: 'var(--text-muted)' }}>{langLabels[lang]}</div>
|
||||
</div>
|
||||
</a>
|
||||
@@ -36,6 +39,7 @@ function DownloadButton({ lang }: { lang: Language }) {
|
||||
}
|
||||
|
||||
function DownloadDropdown() {
|
||||
const { lang } = useLanguage()
|
||||
const [open, setOpen] = useState(false)
|
||||
const ref = useRef<HTMLDivElement>(null)
|
||||
|
||||
@@ -70,7 +74,7 @@ function DownloadDropdown() {
|
||||
<path d="M12 3v10m0 0l-3-3m3 3l3-3" />
|
||||
<path d="M3 17h18" />
|
||||
</svg>
|
||||
<span>Download Resume</span>
|
||||
<span>{strings.common.resumeDownload[lang]}</span>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" width="16" height="16" className="chevron">
|
||||
<polyline points="6 9 12 15 18 9" />
|
||||
</svg>
|
||||
@@ -99,18 +103,11 @@ export function DownloadResume() {
|
||||
|
||||
return (
|
||||
<div style={{ marginTop: '32px' }}>
|
||||
{/* Desktop: dropdown */}
|
||||
<div className="download-resume-desktop">
|
||||
{resumeLanguages.length > 1 ? (
|
||||
<DownloadDropdown />
|
||||
</div>
|
||||
{/* Mobile: 2 buttons */}
|
||||
<div className="download-resume-mobile">
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
|
||||
{resumeLanguages.map(lang => (
|
||||
<DownloadButton key={lang} lang={lang} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<DownloadButton lang={resumeLanguages[0]} />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -2,8 +2,11 @@ import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { motion } from "motion/react"
|
||||
import { experiences } from "@/data/experience"
|
||||
import { InView } from "@/components/ui/InView"
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
|
||||
export function Experience() {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<InView>
|
||||
<motion.section
|
||||
@@ -20,7 +23,7 @@ export function Experience() {
|
||||
},
|
||||
}}
|
||||
>
|
||||
<SectionHeading title="Experience" tag="03 - Experience" />
|
||||
<SectionHeading title={strings.experience.heading[lang]} tag="03 - Experience" />
|
||||
<div style={{ maxWidth: '700px' }}>
|
||||
<div className="timeline">
|
||||
{experiences.map((exp, i) => (
|
||||
@@ -40,7 +43,7 @@ export function Experience() {
|
||||
>
|
||||
<div className="timeline-marker" />
|
||||
<div className="timeline-header">
|
||||
<div className="timeline-title">{exp.title}</div>
|
||||
<div className="timeline-title">{lang === 'vi' ? exp.title : exp.titleEn}</div>
|
||||
<div className="timeline-company">{exp.company}</div>
|
||||
<div className="timeline-duration">{exp.duration}</div>
|
||||
{exp.location && (
|
||||
@@ -48,7 +51,7 @@ export function Experience() {
|
||||
)}
|
||||
</div>
|
||||
<ul className="timeline-responsibilities">
|
||||
{exp.responsibilities.map((r) => (
|
||||
{(lang === 'vi' ? exp.responsibilities : exp.responsibilitiesEn ?? []).map((r) => (
|
||||
<li key={r}>{r}</li>
|
||||
))}
|
||||
</ul>
|
||||
@@ -58,7 +61,7 @@ export function Experience() {
|
||||
{achievement.title}
|
||||
</div>
|
||||
<div className="achievement-context">
|
||||
{achievement.context}
|
||||
{lang === 'vi' ? achievement.context : achievement.contextEn}
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
@@ -67,7 +70,7 @@ export function Experience() {
|
||||
marginBottom: "8px",
|
||||
}}
|
||||
>
|
||||
{achievement.impact}
|
||||
{lang === 'vi' ? achievement.impact : achievement.impactEn}
|
||||
</div>
|
||||
{achievement.metrics &&
|
||||
achievement.metrics.length > 0 && (
|
||||
|
||||
@@ -2,8 +2,11 @@ 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'
|
||||
|
||||
export function Expertise() {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<InView>
|
||||
<motion.section
|
||||
@@ -20,7 +23,7 @@ export function Expertise() {
|
||||
},
|
||||
}}
|
||||
>
|
||||
<SectionHeading title="Core Expertise" tag="02 - Expertise" />
|
||||
<SectionHeading title={strings.expertise.heading[lang]} tag="02 - Expertise" />
|
||||
<div className="expertise-grid">
|
||||
{skillGroups.map((group, i) => (
|
||||
<motion.div
|
||||
@@ -37,7 +40,7 @@ export function Expertise() {
|
||||
whileHover={{ scale: 1.05, y: -2 }}
|
||||
whileTap={{ scale: 0.98 }}
|
||||
>
|
||||
<h3>{group.title}</h3>
|
||||
<h3>{lang === 'vi' ? group.title : group.titleEn}</h3>
|
||||
<ul className="expertise-skills">
|
||||
{group.skills.map((skill) => (
|
||||
<li key={skill} className="expertise-skill">
|
||||
|
||||
@@ -3,12 +3,15 @@ import { motion, useScroll, useTransform } from "motion/react"
|
||||
import { InView } from "@/components/ui/InView"
|
||||
import { resumeAvailable, resumeLanguages, resumeUrlFor } from "@/data/resume"
|
||||
import type { Language } from '@/types'
|
||||
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { useField } from '@/i18n/useField'
|
||||
const langLabels: Record<Language, string> = {
|
||||
en: 'English',
|
||||
vi: 'Tiếng Việt',
|
||||
}
|
||||
function HeroDownloadDropdown() {
|
||||
const { lang } = useLanguage()
|
||||
const [open, setOpen] = useState(false)
|
||||
const ref = useRef<HTMLDivElement>(null)
|
||||
|
||||
@@ -43,7 +46,7 @@ function HeroDownloadDropdown() {
|
||||
<path d="M12 3v10m0 0l-3-3m3 3l3-3" />
|
||||
<path d="M3 17h18" />
|
||||
</svg>
|
||||
<span>Download Resume</span>
|
||||
<span>{strings.common.resumeDownload[lang]}</span>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" width="14" height="14" className="chevron">
|
||||
<polyline points="6 9 12 15 18 9" />
|
||||
</svg>
|
||||
@@ -122,6 +125,7 @@ const socialLinks = [
|
||||
|
||||
export function Hero() {
|
||||
const { scrollY } = useScroll()
|
||||
const { lang } = useLanguage()
|
||||
const y = useTransform(scrollY, [0, 300], [0, -80])
|
||||
return (
|
||||
<InView>
|
||||
@@ -147,7 +151,7 @@ export function Hero() {
|
||||
>
|
||||
<span className="hero-greeting">
|
||||
<span className="greeting-dot" />
|
||||
Hi, I'm
|
||||
{strings.hero.greeting[lang]}
|
||||
</span>
|
||||
</motion.div>
|
||||
<motion.h1
|
||||
@@ -173,7 +177,7 @@ export function Hero() {
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.5, delay: 0.5 }}
|
||||
>
|
||||
{profile.tagline}
|
||||
{useField(profile.tagline, profile.taglineEn)}
|
||||
</motion.p>
|
||||
<motion.div
|
||||
className="hero-cta"
|
||||
@@ -182,10 +186,10 @@ export function Hero() {
|
||||
transition={{ duration: 0.5, delay: 0.6 }}
|
||||
>
|
||||
<Button href="/projects" variant="primary">
|
||||
View Projects
|
||||
{strings.hero.ctaProjects[lang]}
|
||||
</Button>
|
||||
<Button href="/contact" variant="primary">
|
||||
Contact Me
|
||||
{strings.hero.ctaContact[lang]}
|
||||
</Button>
|
||||
{resumeAvailable && (
|
||||
<>
|
||||
@@ -206,7 +210,7 @@ export function Hero() {
|
||||
<div className="scroll-mouse">
|
||||
<div className="scroll-wheel" />
|
||||
</div>
|
||||
<span>Scroll</span>
|
||||
<span>{strings.hero.scroll[lang]}</span>
|
||||
</div>
|
||||
<motion.div
|
||||
className="hero-visual"
|
||||
|
||||
@@ -4,18 +4,13 @@ import { motion } from "motion/react"
|
||||
import { Badge } from "@/components/ui/Badge"
|
||||
import { projects } from "@/data/projects"
|
||||
import { InView } from "@/components/ui/InView"
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
|
||||
const MotionLink = motion.create(Link)
|
||||
|
||||
const categoryLabels: Record<string, string> = {
|
||||
"software-engineering": "Software Engineering",
|
||||
logistics: "Logistics",
|
||||
"ai-ml": "AI / ML",
|
||||
"computer-vision": "Computer Vision",
|
||||
architecture: "Architecture",
|
||||
experiment: "Experiment",
|
||||
}
|
||||
|
||||
export function Projects() {
|
||||
const { lang } = useLanguage()
|
||||
const featured = projects.filter((p) => p.featured).slice(0, 4)
|
||||
|
||||
return (
|
||||
@@ -34,12 +29,12 @@ export function Projects() {
|
||||
},
|
||||
}}
|
||||
>
|
||||
<SectionHeading title="Featured Projects" tag="04 - Projects" />
|
||||
<SectionHeading title={strings.projects.featured[lang]} tag="04 - Projects" />
|
||||
<Link
|
||||
to="/projects"
|
||||
style={{ fontSize: "14px", fontWeight: 500, color: "var(--accent)", display: "block", marginBottom: "24px" }}
|
||||
>
|
||||
View All →
|
||||
{strings.projects.viewAll[lang]} →
|
||||
</Link>
|
||||
<div className="projects-grid">
|
||||
{featured.map((project, i) => (
|
||||
@@ -62,10 +57,10 @@ export function Projects() {
|
||||
<div className="project-card-header">
|
||||
<h3>{project.title}</h3>
|
||||
<Badge variant="outline">
|
||||
{categoryLabels[project.category] || project.category}
|
||||
{strings.projects.categories[project.category][lang]}
|
||||
</Badge>
|
||||
</div>
|
||||
<p className="project-card-summary">{project.summary}</p>
|
||||
<p className="project-card-summary">{lang === 'vi' ? project.summary : project.summaryEn}</p>
|
||||
<div className="project-card-techs">
|
||||
{project.technologies.slice(0, 4).map((tech) => (
|
||||
<span key={tech} className="tag">
|
||||
@@ -82,7 +77,7 @@ export function Projects() {
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<span className="project-card-cta">View Details →</span>
|
||||
<span className="project-card-cta">{strings.projects.viewDetails[lang]} →</span>
|
||||
</div>
|
||||
</MotionLink>
|
||||
))}
|
||||
|
||||
+4
-4
@@ -7,14 +7,14 @@ export const profile: Profile = {
|
||||
title: "Senior Software Engineer",
|
||||
titleEn: "Senior Software Engineer",
|
||||
tagline:
|
||||
"Building scalable software systems,\nintelligent logistics solutions,\nand practical AI applications.",
|
||||
"Xây dựng hệ thống phần mềm có khả năng mở rộng,\ngiải pháp logistics thông minh,\nvà ứng dụng AI thực tiễn.",
|
||||
taglineEn:
|
||||
"Building scalable software systems,\nintelligent logistics solutions,\nand practical AI applications.",
|
||||
bio: "Senior Software Engineer với kinh nghiệm xây dựng hệ thống phân tán, logistics technology, và ứng dụng AI/ML vào bài toán thực tế. Tập trung vào system architecture, integration, và production-grade solutions.",
|
||||
bioEn: "Senior Software Engineer with experience building distributed systems, logistics technology, and AI/ML applications for real-world problems. Focused on system architecture, integration, and production-grade solutions.",
|
||||
email: "your.email@example.com",
|
||||
githubUrl: "https://github.com/yourusername",
|
||||
linkedinUrl: "https://linkedin.com/in/yourusername",
|
||||
email: "nguyendong_bkdn@yahoo.com",
|
||||
githubUrl: "https://github.com/dong-nz",
|
||||
linkedinUrl: "https://www.linkedin.com/in/dong-nz",
|
||||
currentInterests: [
|
||||
"AI in logistics",
|
||||
"Digital twins",
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { SkillGroup } from "@/types";
|
||||
export const skillGroups: SkillGroup[] = [
|
||||
{
|
||||
title: "Software Engineering",
|
||||
titleEn: "Software Engineering",
|
||||
skills: [
|
||||
"Java",
|
||||
"Go",
|
||||
@@ -14,6 +15,7 @@ export const skillGroups: SkillGroup[] = [
|
||||
},
|
||||
{
|
||||
title: "System Architecture",
|
||||
titleEn: "System Architecture",
|
||||
skills: [
|
||||
"System Design",
|
||||
"Integration Architecture",
|
||||
@@ -24,6 +26,7 @@ export const skillGroups: SkillGroup[] = [
|
||||
},
|
||||
{
|
||||
title: "Logistics Technology",
|
||||
titleEn: "Logistics Technology",
|
||||
skills: [
|
||||
"Sortation",
|
||||
"Warehouse / Facility Operations",
|
||||
@@ -34,6 +37,7 @@ export const skillGroups: SkillGroup[] = [
|
||||
},
|
||||
{
|
||||
title: "AI / ML",
|
||||
titleEn: "AI / ML",
|
||||
skills: [
|
||||
"Computer Vision",
|
||||
"Object Detection",
|
||||
@@ -45,10 +49,12 @@ export const skillGroups: SkillGroup[] = [
|
||||
},
|
||||
{
|
||||
title: "Infrastructure",
|
||||
titleEn: "Infrastructure",
|
||||
skills: ["Docker", "Linux", "CI/CD", "Networking", "Middleware"],
|
||||
},
|
||||
{
|
||||
title: "Engineering Practices",
|
||||
titleEn: "Engineering Practices",
|
||||
skills: [
|
||||
"Agile / Scrum",
|
||||
"Technical Documentation",
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import {createContext, useCallback, useContext, useEffect, useState} from 'react'
|
||||
|
||||
type Language = 'en' | 'vi'
|
||||
|
||||
interface LanguageContextValue {
|
||||
lang: Language
|
||||
setLang: (lang: Language) => void
|
||||
toggleLang: () => void
|
||||
}
|
||||
|
||||
const STORAGE_KEY = 'portfolio-lang'
|
||||
|
||||
function getInitialLanguage(): Language {
|
||||
try {
|
||||
const stored = localStorage.getItem(STORAGE_KEY)
|
||||
if (stored === 'en' || stored === 'vi') {
|
||||
return stored
|
||||
}
|
||||
} catch {
|
||||
// localStorage unavailable
|
||||
}
|
||||
// Detect browser language
|
||||
return navigator.language?.toLowerCase().startsWith('vi') ? 'vi' : 'en'
|
||||
}
|
||||
|
||||
const LanguageContext = createContext<LanguageContextValue | undefined>(undefined)
|
||||
|
||||
export function LanguageProvider({ children }: { children: React.ReactNode }) {
|
||||
const [lang, setLangState] = useState<Language>(getInitialLanguage)
|
||||
|
||||
// Set <html lang> during render (synchronous, before paint)
|
||||
document.documentElement.setAttribute('lang', lang)
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY, lang)
|
||||
} catch {
|
||||
// localStorage unavailable
|
||||
}
|
||||
}, [lang])
|
||||
|
||||
const setLang = useCallback((newLang: Language) => {
|
||||
setLangState(newLang)
|
||||
}, [])
|
||||
|
||||
const toggleLang = useCallback(() => {
|
||||
setLangState((prev) => (prev === 'en' ? 'vi' : 'en'))
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<LanguageContext.Provider value={{ lang, setLang, toggleLang }}>
|
||||
{children}
|
||||
</LanguageContext.Provider>
|
||||
)
|
||||
}
|
||||
|
||||
export function useLanguage() {
|
||||
const context = useContext(LanguageContext)
|
||||
if (!context) {
|
||||
throw new Error('useLanguage must be used within LanguageProvider')
|
||||
}
|
||||
return context
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
export const strings = {
|
||||
nav: {
|
||||
home: { en: 'Home', vi: 'Trang chủ' },
|
||||
about: { en: 'About', vi: 'Giới thiệu' },
|
||||
experience: { en: 'Experience', vi: 'Kinh nghiệm' },
|
||||
projects: { en: 'Projects', vi: 'Dự án' },
|
||||
engineering: { en: 'Engineering', vi: 'Kỹ sư' },
|
||||
contact: { en: 'Contact', vi: 'Liên hệ' },
|
||||
},
|
||||
footer: {
|
||||
copyright: { en: 'All rights reserved', vi: 'Bảo lưu mọi quyền' },
|
||||
links: {
|
||||
home: { en: 'Home', vi: 'Trang chủ' },
|
||||
about: { en: 'About', vi: 'Giới thiệu' },
|
||||
projects: { en: 'Projects', vi: 'Dự án' },
|
||||
contact: { en: 'Contact', vi: 'Liên hệ' },
|
||||
},
|
||||
},
|
||||
hero: {
|
||||
greeting: { en: "Hi, I'm", vi: 'Xin chào, tôi là' },
|
||||
ctaProjects: { en: 'View Projects', vi: 'Xem dự án' },
|
||||
ctaContact: { en: 'Contact Me', vi: 'Liên hệ' },
|
||||
downloadResume: { en: 'Download Resume', vi: 'Tải CV' },
|
||||
scroll: { en: 'Scroll', vi: 'Cuộn' },
|
||||
},
|
||||
about: {
|
||||
heading: { en: 'About Me', vi: 'Giới thiệu' },
|
||||
subtitle: { en: 'Senior Software Engineer with deep expertise in distributed systems, logistics technology, and practical AI applications.', vi: 'Kỹ sư phần mềm cao cấp với chuyên môn sâu về hệ thống phân tán, công nghệ logistics và ứng dụng AI thực tiễn.' },
|
||||
engineeringTitle: { en: 'How I Think About Engineering', vi: 'Cách tôi tư duy về kỹ thuật' },
|
||||
exploringTitle: { en: "What I'm Exploring", vi: 'Những điều tôi đang tìm hiểu' },
|
||||
exploringTitlePage: { en: "What I'm Currently Exploring", vi: 'Những điều tôi đang tìm hiểu' },
|
||||
expertise: { en: 'Core Expertise', vi: 'Chuyên môn' },
|
||||
},
|
||||
expertise: {
|
||||
heading: { en: 'Core Expertise', vi: 'Chuyên môn' },
|
||||
},
|
||||
experience: {
|
||||
heading: { en: 'Experience', vi: 'Kinh nghiệm' },
|
||||
},
|
||||
projects: {
|
||||
featured: { en: 'Featured Projects', vi: 'Dự án nổi bật' },
|
||||
all: { en: 'Projects', vi: 'Dự án' },
|
||||
viewAll: { en: 'View All', vi: 'Xem tất cả' },
|
||||
viewDetails: { en: 'View Details', vi: 'Xem chi tiết' },
|
||||
categories: {
|
||||
'software-engineering': { en: 'Software Engineering', vi: 'Kỹ thuật phần mềm' },
|
||||
logistics: { en: 'Logistics', vi: 'Logistics' },
|
||||
'ai-ml': { en: 'AI / ML', vi: 'AI / ML' },
|
||||
'computer-vision': { en: 'Computer Vision', vi: 'Computer Vision' },
|
||||
architecture: { en: 'Architecture', vi: 'Kiến trúc' },
|
||||
experiment: { en: 'Experiment', vi: 'Thử nghiệm' },
|
||||
},
|
||||
},
|
||||
contact: {
|
||||
heading: { en: 'Contact', vi: 'Liên hệ' },
|
||||
email: { en: 'Email', vi: 'Email' },
|
||||
github: { en: 'GitHub', vi: 'GitHub' },
|
||||
linkedin: { en: 'LinkedIn', vi: 'LinkedIn' },
|
||||
},
|
||||
projectDetail: {
|
||||
notFound: { en: 'Project Not Found', vi: 'Không tìm thấy dự án' },
|
||||
backToProjects: { en: 'Back to Projects', vi: 'Quay lại dự án' },
|
||||
impact: { en: 'Impact', vi: 'Tác động' },
|
||||
role: { en: 'Role', vi: 'Vai trò' },
|
||||
technologies: { en: 'Technologies', vi: 'Công nghệ' },
|
||||
experiments: { en: 'Engineering Experiments', vi: 'Thí nghiệm kỹ thuật' },
|
||||
},
|
||||
engineering: {
|
||||
heading: { en: 'Engineering', vi: 'Kỹ sư' },
|
||||
categories: {
|
||||
architecture: { en: 'Architecture', vi: 'Kiến trúc' },
|
||||
ai_ml: { en: 'AI / ML', vi: 'AI / ML' },
|
||||
experiments: { en: 'Experiments', vi: 'Thử nghiệm' },
|
||||
},
|
||||
comingSoon: { en: 'Content coming soon. This section will showcase deep technical exploration in %s.', vi: 'Nội dung sắp ra mắt. Phần này sẽ giới thiệu các khám phá kỹ thuật chuyên sâu về %s.' },
|
||||
},
|
||||
common: {
|
||||
backTo: { en: 'Back to %s', vi: 'Quay lại %s' },
|
||||
skipLink: { en: 'Skip to content', vi: 'Bỏ qua nội dung' },
|
||||
resumeDownload: { en: 'Download Resume', vi: 'Tải CV' },
|
||||
socialAriaLabels: {
|
||||
github: { en: 'View GitHub profile', vi: 'Xem hồ sơ GitHub' },
|
||||
linkedin: { en: 'View LinkedIn profile', vi: 'Xem hồ sơ LinkedIn' },
|
||||
email: { en: 'Send email', vi: 'Gửi email' },
|
||||
},
|
||||
contactTag: { en: 'Contact', vi: 'Liên hệ' },
|
||||
experienceTag: { en: 'Experience', vi: 'Kinh nghiệm' },
|
||||
},
|
||||
} as const
|
||||
@@ -0,0 +1,17 @@
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
|
||||
/**
|
||||
* React hook: select field by language. Must be called at component top level.
|
||||
*/
|
||||
export function useField<T>(value: T, valueEn: T | undefined): T {
|
||||
const { lang } = useLanguage()
|
||||
return lang === 'vi' ? value : (valueEn ?? value)
|
||||
}
|
||||
|
||||
/**
|
||||
* React hook: select array field by language. Must be called at component top level.
|
||||
*/
|
||||
export function useFieldArray<T>(value: T[], valueEn: T[] | undefined): T[] {
|
||||
const { lang } = useLanguage()
|
||||
return lang === 'vi' ? value : (valueEn ?? value)
|
||||
}
|
||||
@@ -277,3 +277,22 @@ pre code {
|
||||
.skip-link:focus {
|
||||
top: 16px;
|
||||
}
|
||||
|
||||
/* Language toggle button */
|
||||
.lang-toggle {
|
||||
background: transparent;
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-primary);
|
||||
padding: 6px 10px;
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.5px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.lang-toggle:hover {
|
||||
border-color: var(--accent);
|
||||
color: var(--accent);
|
||||
}
|
||||
+13
-10
@@ -3,24 +3,28 @@ import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { Tag } from '@/components/ui/Tag'
|
||||
import { profile } from '@/data/profile'
|
||||
import { skillGroups } from '@/data/skills'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
import { useField } from '@/i18n/useField'
|
||||
|
||||
export function AboutPage() {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<>
|
||||
<AnimatedSection>
|
||||
<section className="section container-content" aria-labelledby="about-heading">
|
||||
<SectionHeading
|
||||
title="About Me"
|
||||
subtitle="Senior Software Engineer with deep expertise in distributed systems, logistics technology, and practical AI applications."
|
||||
tag="01 - About"
|
||||
title={strings.about.heading[lang]}
|
||||
subtitle={strings.about.subtitle[lang]}
|
||||
tag="About"
|
||||
/>
|
||||
<div style={{ maxWidth: '700px' }}>
|
||||
<p style={{ fontSize: '18px', marginBottom: '32px' }}>
|
||||
{profile.bio}
|
||||
{useField(profile.bio, profile.bioEn)}
|
||||
</p>
|
||||
|
||||
<h3 style={{ fontSize: '20px', marginBottom: '16px', color: 'var(--text-primary)' }}>
|
||||
How I Think About Engineering
|
||||
{strings.about.engineeringTitle[lang]}
|
||||
</h3>
|
||||
<div className="philosophy-grid">
|
||||
{profile.philosophy.map((point) => (
|
||||
@@ -37,7 +41,7 @@ export function AboutPage() {
|
||||
</div>
|
||||
|
||||
<h3 style={{ fontSize: '20px', marginTop: '32px', marginBottom: '12px', color: 'var(--text-primary)' }}>
|
||||
What I'm Currently Exploring
|
||||
{strings.about.exploringTitlePage[lang]}
|
||||
</h3>
|
||||
<div className="interests-list">
|
||||
{profile.currentInterests.map((interest) => (
|
||||
@@ -49,14 +53,13 @@ export function AboutPage() {
|
||||
</div>
|
||||
</section>
|
||||
</AnimatedSection>
|
||||
|
||||
<AnimatedSection>
|
||||
<section className="section container-wide" aria-labelledby="expertise-heading">
|
||||
<SectionHeading title="Core Expertise" />
|
||||
<SectionHeading title={strings.about.expertise[lang]} />
|
||||
<div className="expertise-grid">
|
||||
{skillGroups.map((group: { title: string; skills: string[] }) => (
|
||||
{skillGroups.map((group) => (
|
||||
<div key={group.title} className="expertise-card">
|
||||
<h3>{group.title}</h3>
|
||||
<h3>{lang === 'vi' ? group.title : group.titleEn}</h3>
|
||||
<ul className="expertise-skills">
|
||||
{group.skills.map((skill: string) => (
|
||||
<li key={skill} className="expertise-skill">
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { DownloadResume } from '@/components/sections/DownloadResume'
|
||||
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">
|
||||
<SectionHeading title="Contact" tag="06 - Contact" />
|
||||
<SectionHeading title={strings.contact.heading[lang]} tag={strings.common.contactTag[lang]} />
|
||||
<div className="contact-links">
|
||||
<a href={`mailto:${profile.email}`} className="contact-link">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" width="24" height="24">
|
||||
@@ -13,7 +15,7 @@ export function ContactPage() {
|
||||
<path d="M22 4l-10 8L2 4" />
|
||||
</svg>
|
||||
<div>
|
||||
<div style={{ fontWeight: 500, color: 'var(--text-primary)' }}>Email</div>
|
||||
<div style={{ fontWeight: 500, color: 'var(--text-primary)' }}>{strings.contact.email[lang]}</div>
|
||||
<div style={{ fontSize: '14px', color: 'var(--text-muted)' }}>{profile.email}</div>
|
||||
</div>
|
||||
</a>
|
||||
@@ -22,7 +24,7 @@ export function ContactPage() {
|
||||
<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>
|
||||
<div>
|
||||
<div style={{ fontWeight: 500, color: 'var(--text-primary)' }}>GitHub</div>
|
||||
<div style={{ fontWeight: 500, color: 'var(--text-primary)' }}>{strings.contact.github[lang]}</div>
|
||||
<div style={{ fontSize: '14px', color: 'var(--text-muted)' }}>@yourusername</div>
|
||||
</div>
|
||||
</a>
|
||||
@@ -31,7 +33,7 @@ export function ContactPage() {
|
||||
<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>
|
||||
<div>
|
||||
<div style={{ fontWeight: 500, color: 'var(--text-primary)' }}>LinkedIn</div>
|
||||
<div style={{ fontWeight: 500, color: 'var(--text-primary)' }}>{strings.contact.linkedin[lang]}</div>
|
||||
<div style={{ fontSize: '14px', color: 'var(--text-muted)' }}>Your Name</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -2,22 +2,26 @@ import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { Tag } from '@/components/ui/Tag'
|
||||
import { profile } from '@/data/profile'
|
||||
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
const engineeringCategoryKeys = ['architecture', 'ai_ml', 'experiments'] as const
|
||||
export function EngineeringPage() {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<section className="section container-content" aria-labelledby="engineering-heading">
|
||||
<SectionHeading title="Engineering" tag="05 - Engineering" />
|
||||
<SectionHeading title={strings.engineering.heading[lang]} tag="Engineering" />
|
||||
|
||||
{['Architecture', 'AI / ML', 'Experiments'].map((category) => (
|
||||
<div key={category} style={{ marginBottom: '48px' }}>
|
||||
{engineeringCategoryKeys.map((catKey) => (
|
||||
<div key={catKey} style={{ marginBottom: '48px' }}>
|
||||
<h3 style={{ fontSize: '20px', marginBottom: '24px', color: 'var(--text-primary)' }}>
|
||||
{category}
|
||||
{strings.engineering.categories[catKey][lang]}
|
||||
</h3>
|
||||
{/* Placeholder for expanded content */}
|
||||
<p style={{ color: 'var(--text-secondary)' }}>
|
||||
Content coming soon. This section will showcase deep technical exploration in {category.toLowerCase()}.
|
||||
{strings.engineering.comingSoon[lang].replace('%s', strings.engineering.categories[catKey][lang])}
|
||||
</p>
|
||||
<div className="philosophy-keywords" style={{ marginTop: '16px' }}>
|
||||
{profile.currentInterests.filter((i) => i.includes(category)).map((kw) => (
|
||||
{profile.currentInterests.filter((i) => i.includes(catKey)).map((kw) => (
|
||||
<Tag key={kw} accent>{kw}</Tag>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { experiences } from '@/data/experience'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
|
||||
export function ExperiencePage() {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<section className="section container-content" aria-labelledby="experience-heading">
|
||||
<SectionHeading title="Experience" tag="03 - Experience" />
|
||||
<SectionHeading title={strings.experience.heading[lang]} tag={strings.common.experienceTag[lang]} />
|
||||
<div className="timeline">
|
||||
{experiences.map((exp) => (
|
||||
<div key={exp.id} className="timeline-entry">
|
||||
<div className="timeline-marker" />
|
||||
<div className="timeline-header">
|
||||
<div className="timeline-title">{exp.title}</div>
|
||||
<div className="timeline-title">{lang === 'vi' ? exp.title : exp.titleEn}</div>
|
||||
<div className="timeline-company">{exp.company}</div>
|
||||
<div className="timeline-duration">{exp.duration}</div>
|
||||
{exp.location && (
|
||||
@@ -18,16 +21,16 @@ export function ExperiencePage() {
|
||||
)}
|
||||
</div>
|
||||
<ul className="timeline-responsibilities">
|
||||
{exp.responsibilities.map((r) => (
|
||||
{(lang === 'vi' ? exp.responsibilities : exp.responsibilitiesEn ?? []).map((r) => (
|
||||
<li key={r}>{r}</li>
|
||||
))}
|
||||
</ul>
|
||||
{exp.achievements?.map((achievement) => (
|
||||
<div key={achievement.id} className="achievement">
|
||||
<div className="achievement-title">{achievement.title}</div>
|
||||
<div className="achievement-context">{achievement.context}</div>
|
||||
<div className="achievement-context">{lang === 'vi' ? achievement.context : achievement.contextEn}</div>
|
||||
<div style={{ fontSize: '14px', color: 'var(--text-secondary)', marginBottom: '8px' }}>
|
||||
{achievement.impact}
|
||||
{lang === 'vi' ? achievement.impact : achievement.impactEn}
|
||||
</div>
|
||||
{achievement.metrics && achievement.metrics.length > 0 && (
|
||||
<div style={{ marginBottom: '8px' }}>
|
||||
|
||||
@@ -2,26 +2,21 @@ import { useParams, Link } from 'react-router'
|
||||
import { Badge } from '@/components/ui/Badge'
|
||||
import { Tag } from '@/components/ui/Tag'
|
||||
import { projects } from '@/data/projects'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
|
||||
const categoryLabels: Record<string, string> = {
|
||||
'software-engineering': 'Software Engineering',
|
||||
logistics: 'Logistics',
|
||||
'ai-ml': 'AI / ML',
|
||||
'computer-vision': 'Computer Vision',
|
||||
architecture: 'Architecture',
|
||||
experiment: 'Experiment',
|
||||
}
|
||||
|
||||
export function ProjectDetailPage() {
|
||||
const { id } = useParams<{ id: string }>()
|
||||
const { lang } = useLanguage()
|
||||
const project = projects.find((p) => p.id === id)
|
||||
|
||||
if (!project) {
|
||||
return (
|
||||
<section className="section container-content">
|
||||
<h2>Project Not Found</h2>
|
||||
<h2>{strings.projectDetail.notFound[lang]}</h2>
|
||||
<p>
|
||||
<Link to="/projects">← Back to Projects</Link>
|
||||
<Link to="/projects">{strings.projectDetail.backToProjects[lang]} ←</Link>
|
||||
</p>
|
||||
</section>
|
||||
)
|
||||
@@ -30,21 +25,21 @@ export function ProjectDetailPage() {
|
||||
return (
|
||||
<section className="section container-content" aria-labelledby="project-title">
|
||||
<Link to="/projects" style={{ fontSize: '14px', fontWeight: 500, color: 'var(--accent)', marginBottom: '32px', display: 'inline-block' }}>
|
||||
← Back to Projects
|
||||
{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">{categoryLabels[project.category] || project.category}</Badge>
|
||||
<Badge variant="outline">{strings.projects.categories[project.category][lang]}</Badge>
|
||||
</div>
|
||||
|
||||
<p style={{ fontSize: '18px', color: 'var(--text-secondary)', marginBottom: '32px' }}>
|
||||
{project.summary}
|
||||
{lang === 'vi' ? project.summary : project.summaryEn}
|
||||
</p>
|
||||
|
||||
{project.metrics && project.metrics.length > 0 && (
|
||||
<div style={{ marginBottom: '32px' }}>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>Impact</h3>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>{strings.projectDetail.impact[lang]}</h3>
|
||||
<div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap' }}>
|
||||
{project.metrics.map((m) => (
|
||||
<span key={m} className="achievement-metric">
|
||||
@@ -56,12 +51,12 @@ export function ProjectDetailPage() {
|
||||
)}
|
||||
|
||||
<div style={{ marginBottom: '32px' }}>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>Role</h3>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>{strings.projectDetail.role[lang]}</h3>
|
||||
<p>{project.role}</p>
|
||||
</div>
|
||||
|
||||
<div style={{ marginBottom: '32px' }}>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>Technologies</h3>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>{strings.projectDetail.technologies[lang]}</h3>
|
||||
<div className="philosophy-keywords">
|
||||
{project.technologies.map((tech) => (
|
||||
<Tag key={tech}>{tech}</Tag>
|
||||
@@ -71,11 +66,11 @@ export function ProjectDetailPage() {
|
||||
|
||||
{project.sections && project.sections.length > 0 && (
|
||||
<div style={{ marginBottom: '32px' }}>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>Engineering Experiments</h3>
|
||||
<h3 style={{ fontSize: '16px', marginBottom: '12px', color: 'var(--text-primary)' }}>{strings.projectDetail.experiments[lang]}</h3>
|
||||
{project.sections.map((section, idx) => (
|
||||
<div key={idx} style={{ marginBottom: '16px', padding: '16px', background: 'var(--bg-surface)', borderRadius: '8px' }}>
|
||||
<h4 style={{ fontSize: '14px', marginBottom: '4px', color: 'var(--text-primary)' }}>{section.title}</h4>
|
||||
<p style={{ fontSize: '14px', color: 'var(--text-secondary)' }}>{section.content}</p>
|
||||
<h4 style={{ fontSize: '14px', marginBottom: '4px', color: 'var(--text-primary)' }}>{lang === 'vi' ? section.title : section.titleEn}</h4>
|
||||
<p style={{ fontSize: '14px', color: 'var(--text-secondary)' }}>{lang === 'vi' ? section.content : section.contentEn}</p>
|
||||
<Tag accent>{section.type}</Tag>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -1,34 +1,30 @@
|
||||
import { SectionHeading } from '@/components/ui/SectionHeading'
|
||||
import { Badge } from '@/components/ui/Badge'
|
||||
import { projects } from '@/data/projects'
|
||||
import { useLanguage } from '@/hooks/useLanguage'
|
||||
import { strings } from '@/i18n/strings'
|
||||
|
||||
const categoryLabels: Record<string, string> = {
|
||||
'software-engineering': 'Software Engineering',
|
||||
logistics: 'Logistics',
|
||||
'ai-ml': 'AI / ML',
|
||||
'computer-vision': 'Computer Vision',
|
||||
architecture: 'Architecture',
|
||||
experiment: 'Experiment',
|
||||
}
|
||||
import { Link } from 'react-router'
|
||||
|
||||
export function ProjectsListPage() {
|
||||
const { lang } = useLanguage()
|
||||
return (
|
||||
<section className="section container-wide" aria-labelledby="projects-heading">
|
||||
<SectionHeading title="Projects" tag="04 - Projects" />
|
||||
<SectionHeading title={strings.projects.all[lang]} tag="04 - Projects" />
|
||||
<div className="projects-grid">
|
||||
{projects.map((project) => (
|
||||
<a
|
||||
<Link
|
||||
key={project.id}
|
||||
href={`/projects/${project.id}`}
|
||||
to={`/projects/${project.id}`}
|
||||
className="project-card"
|
||||
>
|
||||
<div className="project-card-header">
|
||||
<h3>{project.title}</h3>
|
||||
<Badge variant="outline">
|
||||
{categoryLabels[project.category] || project.category}
|
||||
{strings.projects.categories[project.category][lang]}
|
||||
</Badge>
|
||||
</div>
|
||||
<p className="project-card-summary">{project.summary}</p>
|
||||
<p className="project-card-summary">{lang === 'vi' ? project.summary : project.summaryEn}</p>
|
||||
<div className="project-card-techs">
|
||||
{project.technologies.slice(0, 4).map((tech) => (
|
||||
<span key={tech} className="tag">
|
||||
@@ -36,8 +32,8 @@ export function ProjectsListPage() {
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<span className="project-card-cta">View Details →</span>
|
||||
</a>
|
||||
<span className="project-card-cta">{strings.projects.viewDetails[lang]} →</span>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in new issue
Block a user