diff --git a/AGENTS.md b/AGENTS.md index 7581d25..05d8c43 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -66,13 +66,13 @@ Personal engineering portfolio — multi-page SPA built with React + TypeScript ## Data Layer -- `src/data/profile.ts` — name, title, bio, links, social handles (`githubHandle`, `linkedinHandle`) — the Contact cards render `@{profile.githubHandle}`, never a literal +- `src/data/profile.ts` — name, title, bio, links, social handles (`githubHandle`, `linkedinHandle`, `telegramHandle`), messaging URLs (`telegramUrl`, `zaloUrl`) — the Contact cards render `@{profile.githubHandle}`, never a literal - `src/data/skills.ts` — skill groups → skills - `src/data/experience.ts` — work history entries; optional `variant: 'current' | 'gap'` selects the timeline decoration (live node / career break) - `src/data/projects.ts` — project cards with categories - `src/data/resume.ts` — resume availability, supported languages, URL generation - `src/data/navigation.ts` — `navPaths` (bar + sheet order: Home, About, Experience, Projects, Contact, Philosophy), `footerPaths` -- `src/data/social.ts` — social tiles as `{id, href, external}`; `email` is a `mailto:` link with `external: false`, so it renders no `target`/`rel` +- `src/data/social.ts` — social tiles as `{id, href, external}` (github, linkedin, email, telegram, zalo); `email` is a `mailto:` link with `external: false`, so it renders no `target`/`rel` - `src/i18n/strings.ts` — every chrome string as `{en, vi}`; the sheet's group labels, the Mode options, the language names (`langEn` / `langVi`, each named in its own language) and the language action labels (`langSwitch`, `switchTo`) live in `strings.nav`, the social `aria-label`s in `strings.social` - `src/data/site.ts` — `siteUrl` (the canonical origin) and `siteName`; every absolute URL the site publishes — canonical, Open Graph, JSON-LD, `robots.txt`, `sitemap.xml` — derives from it - `src/i18n/field.ts` — `field(lang, value, valueEn)` is a plain function, not a hook: `lang` is read once at component top level with `useLanguage()`, so bilingual selection is legal inside `.map()` callbacks. Convention: `value` is Vietnamese, `valueEn` English @@ -84,7 +84,7 @@ src/ components/ layout/ — Layout.tsx, Navigation.tsx, MobileMenu.tsx, Footer.tsx, ThemePaletteMenu.tsx sections/ — Hero, About, Expertise, Experience, Projects, Contact, HeroParticles, DownloadResume - ui/ — Badge, Button, LanguageIcon, SectionHeading, SocialLinks, Tag, Typewriter, InView, RollingTextLink, BackToTop + ui/ — Badge, Button, ContactLinks, LanguageIcon, SectionHeading, SocialLinks, Tag, Typewriter, InView, RollingTextLink, BackToTop, icons data/ — profile, skills, experience, projects, resume, palettes, navigation, social, site (TS modules) hooks/ — useTheme.tsx, useLanguage.tsx, useClickOutside.ts pages/ — HomePage, AboutPage, ExperiencePage, ProjectsListPage, ProjectDetailPage, PhilosophyPage, ContactPage @@ -107,6 +107,8 @@ src/ - `public/fonts/` — Source Sans 3 woff2 (Regular, Medium, Semibold, Bold); used by the resume generator only — the SPA renders `system-ui` - `public/resume-template.html` — HTML template for resume PDF generation +- `public/resume-logos/` — official company logo SVGs (Lazada, SAP from Wikimedia Commons), embedded in the resume timeline via `ExperienceEntry.logo` +- `public/resume-qr/` — owner-supplied QR images (`telegram.png`, `zalo.png`) embedded in the resume header via `resumeQr` in `src/data/resume.ts`; private assets, NOT committed — a missing file prints a warning and the QR is skipped - `public/profile-photo.webp` — profile photo - `public/robots.txt` — allow-all crawler rules plus the `Sitemap:` pointer to the canonical origin @@ -167,7 +169,7 @@ All specification documents are in `docs/design/`: | `spec-v2.md` | v2 index — overview, implementation order, feature list | | `specs/ui/spec-ui-*.md` | UI specs per section (hero, about, expertise, etc.) | | `specs/v2/spec-v2-*.md` | v2 feature specs (resume, seo, blog, analytics, testing, cicd) | -| `specs/v3/spec-v3-*.md` | v3 feature specs (theme colors, theme switch, theme palette switch, palette reference, UI enhancements, mobile navigation, nav & CTA enhancements, nav swatch & hamburger, typography, i18n, resume improvements, review fixes) | +| `specs/v3/spec-v3-*.md` | v3 feature specs (theme colors, theme switch, theme palette switch, palette reference, UI enhancements, mobile navigation, nav & CTA enhancements, nav swatch & hamburger, typography, i18n, resume improvements, resume redesign, review fixes) | Read `spec.md` first for product context. Read `spec-v2.md` for current feature scope. diff --git a/docs/design/specs/v3/spec-v3-resume-redesign.md b/docs/design/specs/v3/spec-v3-resume-redesign.md new file mode 100644 index 0000000..c200c9f --- /dev/null +++ b/docs/design/specs/v3/spec-v3-resume-redesign.md @@ -0,0 +1,115 @@ +# Specification — v3 Resume PDF Redesign + +> **Document:** `spec-v3-resume-redesign.md` +> **Version:** 1.6.0 (owner follow-up 6: website icon sync DONE; resume QR block wired, awaiting owner's QR images) +> **Parent:** `spec-v3-resume-improvements.md` +> **Priority:** P1 +> **Status:** DONE (visual verification by owner pending) + +--- + +## Problem + +Review of `scripts/generate-resume.ts` + `public/resume-template.html` (2026-10-19) found: + +| # | Issue | Evidence | +|---|-------|----------| +| 1 | PDF margins were **0mm** — `@page { margin: 20mm 18mm }` never applied: Playwright `page.pdf` defaults `preferCSSPageSize = false`, margins default to 0 (`playwright-core@1.64` `crPdf.ts`: `marginTop = convert(margin.top) \|\| 0`) | verified in `node_modules/.pnpm/playwright-core@1.64.0/.../coreBundle.js` | +| 2 | `.avoid-break` emitted by every renderer but **no CSS rule defined**; no `orphans`/`widows`, no `page-break-*` anywhere in the template | grep: 0 matches | +| 3 | ~56 lines of dead CSS `.achievement*` — `achievements` dropped from `experience.ts` 2026-10-16 | old template lines 127-182 | +| 4 | `{{ABOUT_ME_LABEL}}` replaced by the script but absent from the template — dead placeholder | old template body | +| 5 | `page.pdf` `title`/`author` options **do not exist in Playwright's API** — silently ignored dead options; PDF metadata was never set | `tsc` excess-property check against `PDFPageOptions` | +| 6 | Contact printed full URLs (`https://github.com/dong-nz`); `githubHandle`/`linkedinHandle` unused; no clickable links in the PDF | old template lines 264-268 | +| 7 | `variant: 'current' \| 'gap'` unused by the resume — career break rendered identically to a real job | `types/index.ts` | +| 8 | No brand identity: resume palette was generic warm-gray; site accent (light mode) is `#b04138` | `src/index.css` | +| 9 | `siteUrl` (`cv.vugado.com`) never linked from the PDF | `src/data/site.ts` | +| 10 | `build:resume-all` launched Chromium twice | `package.json` | + +## Goal + +Modern, elegant, brand-consistent A4 resume: correct print geometry, timeline experience, accent system mirroring the site's light-mode red palette, clickable contact links, single-launch bilingual generation. Open-to-work is excluded from the PDF (owner decision 2026-10-19). + +## Implementation + +### `public/resume-template.html` — full rewrite + +- Brand tokens in `:root`: `--ink #151914`, `--muted #4b4f4a`, `--meta #756b62`, `--accent #b04138`, `--accent-soft rgba(176,65,56,.35)`, `--hairline #d9d6d0`, `--paper #ffffff` — mirrors `src/index.css` light-mode red palette. +- `@page { size: A4; margin: 16mm 15mm 14mm 15mm }` — now actually applied (see script). +- Print hygiene: `p, li { orphans: 2; widows: 2 }`, `.avoid-break { break-inside: avoid }`, `.section-title { break-after: avoid }`. +- Header: 72px circular photo with 2px accent ring, `object-position: center top` — the 3:4 portrait is anchored to the frame top so the head is never cropped (overflow cropped from the bottom, i.e. shoulders); `.header-info` offset 12px from the photo; name 20pt/700/`-0.01em`; title 11pt accent; contact as a two-column grid (`12px 1fr`, 8px column gap) — lucide stroke icons (mail, globe, github, linkedin, `currentColor`, 2px round joins, matching the site's line-art language icons) in the left column, full clickable addresses left-aligned in the right column, order email → website → github → linkedin. Text labels removed. Right end of the header: `.header-qr` block (`margin-left: auto`, 18px gap) — up to two 18mm QR images from `public/resume-qr/` (Telegram, Zalo) with 7pt uppercase `--meta` captions; assets are owner-exported from the apps, private (not committed); a missing file warns and skips (build never blocks). +- Summary: bio directly under header, no section title (modern convention; the dead `ABOUT_ME_LABEL` placeholder removed from the script). +- Experience: `.timeline` 2px hairline + node dots — filled ink for jobs, hollow `--meta` ring + italic for `variant: 'gap'`; duration pill inline right after the title (`flex-wrap`, 8px gap — no right-margin column); company line is a flex row — official company logo (`` 12px, from `ExperienceEntry.logo`) + `Company · Location`; `::marker` accent bullets. +- Timeline TL;DR: final panel on the spine — accent diamond node, `TL;DR` chip (8pt uppercase letterspaced accent) + lede text on `#f5f3ef` surface with hairline border; text imported from `src/i18n/strings.ts` (`strings.experience.tldr` / `tldrText`), the same content as the site timeline. +- Projects: outline tech chips (accent text + `--accent-soft` border, radius 999px); metrics removed from the resume (owner decision 2026-10-19; data and site cards unchanged). +- Skills: 2-column grid, hairline `border-top` per group, accent group titles. +- Footer: `{{UPDATED_LABEL}}: {{UPDATED_DATE}}` only — the website link moved up into the header contact block. + +### `scripts/generate-resume.ts` — full rewrite + +- `--lang=all` → `['en','vi']` in **one** Chromium launch, one page, loop `page.pdf`; rejected with `--preview`. +- `escapeHtml()` applied to every data-derived string before template injection. +- Placeholder fill via literal `split/join` (avoids regex + `$` pitfalls of `String.replace`); **placeholder guard**: any unresolved `{{KEY}}` after fill → `console.error` + `exit(1)` before browser launch (prevents the dead-placeholder bug class recorded in `spec-v3-resume-improvements.md`). +- `renderExperience` filters `variant === 'current'` — the open-to-work entry is excluded from the resume PDF entirely (owner decision 2026-10-19; site timeline untouched). The earlier status-pill design was removed: `renderStatus`, `OPEN_TO_WORK` labels, and the `{{STATUS}}` placeholder no longer exist. `renderTldr` reads the shared `strings` module — no duplicated TL;DR copy. +- `resolveField(en, vi, lang)` now takes the language explicitly (script handles multiple languages per run). +- `page.pdf`: added `preferCSSPageSize: true` (activates `@page`) and `tagged: true` (tagged/accessibility PDF); removed the non-existent `title`/`author` options — PDF Title metadata now comes from the HTML `` (`Resume - {NAME}` per language). +- `mkdirSync(dirname(outputPath), { recursive: true })` before writing. + +### `package.json` + +- `build:resume-all` → `pnpm tsx scripts/generate-resume.ts --lang=all` (single launch). + +## Affected Files + +| File | Action | +|---|---| +| `public/resume-template.html` | Rewritten (302 → ~300 lines, all placeholders re-keyed) | +| `scripts/generate-resume.ts` | Rewritten (~240 lines) | +| `package.json` | 1 line (`build:resume-all`) | +| `AGENTS.md` | Design Specs table: + "resume redesign" | +| `docs/design/specs/v3/spec-v3-resume-redesign.md` | New (this file) | +| `src/data/*`, site components | **Unchanged** — resume only reads existing data (`variant`, handles, `siteUrl`) | + +## Acceptance Criteria + +| # | Requirement | Status | +|---|-------------|--------| +| 1 | `pnpm build:resume-all` generates `dist/resume.pdf` + `dist/resume-vi.pdf` in one Chromium launch | ✅ (1.5s, both files written) | +| 2 | `@page` margin applied via `preferCSSPageSize: true` | ✅ option set; visual ✅ pending owner check | +| 3 | No unresolved `{{PLACEHOLDER}}` reaches the renderer | ✅ guard exits 1 on leftover; run passed | +| 4 | Contact rows render as icon + full clickable address, icons and values column-aligned, order email → website → github → linkedin | ✅ grid `12px 1fr`, lucide inline SVGs | +| 5 | Open-to-work fully excluded from the resume — no pill, no experience entry | ✅ filter verified; pill removed 2026-10-19 | +| 6 | Gap entry renders hollow node + italic | ✅ `.gap` variant class emitted from data | +| 7 | Company logos render inline for entries with `logo`; entries without logo render unchanged; missing asset file fails the build with a clear error | ✅ logo loader validates, alt="" decorative | +| 8 | `pnpm lint` introduces no new warnings | ✅ (only pre-existing warnings in unrelated files) | +| 9 | Script type-checks clean | ✅ via throwaway tsconfig (bundler resolution + `@/*` paths); `scripts/` is **not** covered by `tsc -b` — known gap, see Tradeoffs | +| 10 | Tagged PDF enabled | ✅ `tagged: true` accepted by Playwright 1.64 types | + +## Tradeoffs + +| Aspect | Detail | +|---|---| +| PDF author metadata | `printToPDF` has no author parameter; Playwright has no `author` option — author metadata is not set. Title comes from HTML `<title>`. | +| Open-to-work | The `variant: 'current'` entry is excluded from the PDF entirely (owner decision); full text remains on the site timeline. | +| ATS | Single-column, real bullets, text-first markup kept — chips/pills are visual only, extraction-safe. | +| `scripts/` type coverage | `tsconfig.node.json` includes only `vite.config.ts`; the resume script is type-checked only ad hoc. Left as-is (config change out of scope). | +| Palette | Resume is locked to the light-mode red palette (print default); no `--palette=` flag. | + +## Progress + +- [x] Template rewrite (tokens, header, timeline, chips, skills grid, footer, print hygiene) +- [x] Script rewrite (renderers, escapeHtml, split/join fill, placeholder guard, `--lang=all`, `preferCSSPageSize`, `tagged`, mkdir) +- [x] `package.json` `build:resume-all` → `--lang=all` +- [x] `pnpm lint` — no new warnings +- [x] `pnpm build:resume-all` — both PDFs generated, guard passed +- [x] Owner follow-up (2026-10-19): open-to-work pill removed end-to-end; photo `object-position: center top`; both PDFs regenerated +- [x] Owner follow-up 2 (2026-10-19): contact stacked one full URL per line + website line added; duration pill inline after title; footer reduced to date only; both PDFs regenerated +- [x] Owner follow-up 3 (2026-10-19): contact labelled + reordered (email, website, github, linkedin); TL;DR panel added to resume timeline (shared strings); project metrics removed from resume +- [x] Owner follow-up 4 (2026-10-19): text labels replaced with lucide mail/globe/github/linkedin line icons; contact re-aligned as a two-column grid; label plumbing removed from script +- [x] Owner follow-up 5 (2026-10-19): company logos in resume timeline — `public/resume-logos/lazada.svg` (Commons "Lazada (2019)", wordmark + heart) + `sap.svg` (Commons "SAP-Logo", blue box wordmark), data-driven via new `ExperienceEntry.logo?: string` (`"lazada"`, `"sap"`); site components NOT touched — owner reviews resume first, site sync is a separate follow-up +- [x] Owner follow-up 6a (2026-10-19): website icon sync — new shared `src/components/ui/icons.tsx` (lucide stroke mail/github/linkedin, `currentColor`, 2px round joins — same set as the resume header); `SocialLinks.tsx` tiles (20px) + `Contact.tsx` cards (24px) now import it; filled github octocat / linkedin square marks removed. Resume QR (telegram/zalo) = follow-up 6b, pending owner inputs; website QR gated on owner review +- [x] Owner follow-up 6b (2026-10-19): resume QR block wired end-to-end — `resumeQr` descriptors in `src/data/resume.ts`, loader + `renderQr` in the script, `{{QR_CODES}}` placeholder + `.header-qr` CSS in the template; dummy-PNG pipeline test then real assets landed: owner supplied `public/resume-qr/telegram.jpg` + `zalo.jpg` (owner also flipped the data to `.jpg`); payloads decoded locally (pyzbar): `https://t.me/dongdn`, `https://zaloapp.com/qr/p/14ic4cmkuegf`. Both `resume.pdf` and `resume-vi.pdf` now rebuilt with the QR block embedded (verified: 630×630 + 512×512 JPEG XObjects in both). Website QR display gated on owner review +- [x] Owner follow-up 7 (2026-10-19): (a) **contact page icons missed in 6a** — `src/pages/ContactPage.tsx` is a third copy of the contact cards with its own inline fill SVGs; now imports the shared `icons.tsx` set too (bundle chunk 3.52 → 2.04 kB proves the inline paths are gone); (b) resume photo 64 → 72px; (c) `.header-info` `margin-left: 12px`; (d) QR gap 10 → 18px. `resume.pdf` rebuilt with all four; `resume-vi.pdf` blocked by owner's locked viewer (EBUSY ×2) — re-run `pnpm build:resume-all` after closing it. NOTE: while a `dist/resume*.pdf` is open in a viewer, `pnpm build` also fails (vite `emptyDir` EPERM on the locked PDF) +- [x] Owner follow-up 8 (2026-10-19): Telegram + Zalo added to website social links — `SocialId` extended (`telegram`, `zalo`), `Profile.telegramUrl` (`https://t.me/dongdn`) + `Profile.zaloUrl` (`https://zaloapp.com/qr/p/14ic4cmkuegf`, same target as the resume QR), two entries appended in `social.ts`, aria labels en/vi in `strings.social.aria`; new `TelegramIcon` + `ZaloIcon` in `icons.tsx` as **simple-icons brand glyphs** (monochrome `currentColor`; lucide dropped brand icons — `lucide:telegram` 404s) — so the tiles are stroke lucide (mail/github/linkedin) + filled brand glyphs (telegram/zalo). Hero, footer, and the mobile sheet pick up all 5 tiles automatically via `SocialLinks`. Verified: `tsc -b` pass, bundle contains both hrefs + both aria labels exactly once, lint unchanged +- [x] Throwaway strict typecheck of `scripts/generate-resume.ts` — clean (temp config removed) +- [x] Owner follow-up 9 (2026-10-19): Telegram + Zalo cards added to contact — new shared `src/components/ui/ContactLinks.tsx` renders all 5 cards (email, github, linkedin, telegram, zalo) from `profile` + `strings.contact` (new labels `telegram`/`zalo`, new `Profile.telegramHandle`); **`Contact.tsx` (98→34 lines) and `ContactPage.tsx` (83→29 lines) deduplicated** — the two hand-copied card lists (root cause of the follow-up 7 miss) are gone, both consumers render `<ContactLinks />`; Zalo card sub is `zaloapp.com/qr/p/14ic4cmkuegf` (URL minus protocol; swap to `zalo.me/<phone>` if owner supplies the number). Proof: throwaway SSR render → exactly 5 `contact-link` anchors with correct href/target/rel (mailto has none) incl. `t.me/dongdn` + `@dongdn`; `pnpm build` + sitemap clean (ContactPage chunk 2.04 → 0.53 kB), lint unchanged. Also unblocked: viewer closed → both resume PDFs rebuilt (14:34) +- [ ] Owner visual check of `dist/resume.pdf` / `dist/resume-vi.pdf` in a real browser/PDF viewer diff --git a/package.json b/package.json index b45b973..e7f9923 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "dev": "vite", "build": "tsc -b && vite build && pnpm tsx scripts/generate-sitemap.ts", "build:resume": "pnpm tsx scripts/generate-resume.ts", - "build:resume-all": "pnpm tsx scripts/generate-resume.ts --lang=en && pnpm tsx scripts/generate-resume.ts --lang=vi", + "build:resume-all": "pnpm tsx scripts/generate-resume.ts --lang=all", "build:resume-preview": "pnpm tsx scripts/generate-resume.ts --preview", "lint": "oxlint", "sitemap": "pnpm tsx scripts/generate-sitemap.ts", diff --git a/public/resume-logos/lazada.svg b/public/resume-logos/lazada.svg new file mode 100644 index 0000000..ac8129e --- /dev/null +++ b/public/resume-logos/lazada.svg @@ -0,0 +1,425 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="410.28354mm" + height="107.51025mm" + viewBox="0 0 410.28354 107.51025" + version="1.1" + id="svg8" + inkscape:version="0.92.3 (2405546, 2018-03-11)" + sodipodi:docname="Lazada (2019) alternate.svg"> + <defs + id="defs2"> + <linearGradient + inkscape:collect="always" + id="linearGradient953"> + <stop + style="stop-color:#6fc4ea;stop-opacity:1;" + offset="0" + id="stop949" /> + <stop + style="stop-color:#bce4f5;stop-opacity:1" + offset="1" + id="stop951" /> + </linearGradient> + <linearGradient + id="linearGradient935" + inkscape:collect="always"> + <stop + id="stop931" + offset="0" + style="stop-color:#f8ad1b;stop-opacity:1;" /> + <stop + id="stop933" + offset="1" + style="stop-color:#fec80d;stop-opacity:1" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + id="linearGradient921"> + <stop + style="stop-color:#4eb745;stop-opacity:1;" + offset="0" + id="stop917" /> + <stop + style="stop-color:#c8db30;stop-opacity:1" + offset="1" + id="stop919" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + id="linearGradient905"> + <stop + style="stop-color:#f6a51f;stop-opacity:1;" + offset="0" + id="stop901" /> + <stop + style="stop-color:#ffd42a;stop-opacity:1" + offset="1" + id="stop903" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient905" + id="linearGradient907" + x1="-255.75984" + y1="-233.08481" + x2="86.394669" + y2="-177.40373" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.42357423,0,0,0.42357423,-295.80831,-17.824806)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient921" + id="linearGradient923" + x1="-10.753736" + y1="-328.9754" + x2="-35.028603" + y2="-350.76373" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.42357423,0,0,0.42357423,-295.80831,-17.824806)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient935" + id="linearGradient929" + gradientUnits="userSpaceOnUse" + x1="38.123863" + y1="-84.518074" + x2="71.749847" + y2="-83.43483" + gradientTransform="matrix(0.41803401,0,0,0.42424576,-351.52509,-5.9749175)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient953" + id="linearGradient955" + x1="-51.219757" + y1="-391.34869" + x2="-105.01648" + y2="-389.83679" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.42357423,0,0,0.42357423,-295.80831,-17.824806)" /> + <linearGradient + id="gradient1" + y2="0.49999899" + x2="1.00081" + y1="0.49999899" + x1="-0.00059854198" + gradientUnits="userSpaceOnUse"> + <stop + id="stop4" + stop-opacity="1" + stop-color="#ff9200" + offset="1e-07" /> + <stop + id="stop6" + stop-opacity="1" + stop-color="#f36d00" + offset="0.29" /> + <stop + id="stop8" + stop-opacity="1" + stop-color="#f4680b" + offset="0.32" /> + <stop + id="stop10" + stop-opacity="1" + stop-color="#f83c72" + offset="0.57" /> + <stop + id="stop12" + stop-opacity="1" + stop-color="#fc1cbe" + offset="0.78" /> + <stop + id="stop14" + stop-opacity="1" + stop-color="#fe08ed" + offset="0.93" /> + <stop + id="stop16" + stop-opacity="1" + stop-color="#ff00ff" + offset="1" /> + </linearGradient> + <linearGradient + gradientUnits="userSpaceOnUse" + x1="-0.00059854198" + y1="0.49999899" + x2="1.00081" + y2="0.49999899" + id="linearGradient966"> + <stop + style="stop-color:#ffb900;stop-opacity:1" + offset="1e-07" + stop-color="#ff9200" + stop-opacity="1" + id="stop952" /> + <stop + style="stop-color:#f38000;stop-opacity:1" + offset="0.33755317" + stop-color="#f36d00" + stop-opacity="1" + id="stop954" /> + <stop + offset="0.56728965" + stop-color="#f83c72" + stop-opacity="1" + id="stop958" /> + <stop + offset="0.78" + stop-color="#fc1cbe" + stop-opacity="1" + id="stop960" /> + <stop + offset="0.93" + stop-color="#fe08ed" + stop-opacity="1" + id="stop962" /> + <stop + offset="1" + stop-color="#ff00ff" + stop-opacity="1" + id="stop964" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + id="linearGradient1736"> + <stop + style="stop-color:#ed6600;stop-opacity:1;" + offset="0" + id="stop1732" /> + <stop + style="stop-color:#f98200;stop-opacity:1" + offset="1" + id="stop1734" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + id="linearGradient1728"> + <stop + style="stop-color:#ee0a3f;stop-opacity:1;" + offset="0" + id="stop1724" /> + <stop + style="stop-color:#ee0a3f;stop-opacity:0;" + offset="1" + id="stop1726" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#gradient1" + id="linearGradient950" + gradientUnits="userSpaceOnUse" + x1="-0.00059854198" + y1="0.49999899" + x2="1.00081" + y2="0.49999899" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient966" + id="linearGradient948" + gradientUnits="userSpaceOnUse" + x1="-0.00059854198" + y1="0.49999899" + x2="66.758224" + y2="-0.017084641" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient1728" + id="linearGradient1730" + x1="18.75388" + y1="49.006153" + x2="86.817642" + y2="11.319839" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient1736" + id="linearGradient1738" + x1="41.793034" + y1="39.348598" + x2="75.037086" + y2="12.568669" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient1728" + id="linearGradient1306" + gradientUnits="userSpaceOnUse" + x1="18.75388" + y1="49.006153" + x2="86.817642" + y2="11.319839" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient1736" + id="linearGradient1308" + gradientUnits="userSpaceOnUse" + x1="41.793034" + y1="39.348598" + x2="75.037086" + y2="12.568669" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.175" + inkscape:cx="1312.4877" + inkscape:cy="-247.50916" + inkscape:document-units="mm" + inkscape:current-layer="layer1-5" + showgrid="false" + showguides="false" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" + inkscape:window-width="1366" + inkscape:window-height="745" + inkscape:window-x="-8" + inkscape:window-y="-8" + inkscape:window-maximized="1" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(805.60654,100.39806)"> + <g + id="g975"> + <g + transform="translate(-482.6338,-315.5882)" + id="layer1-5" + inkscape:label="Layer 1"> + <g + inkscape:label="Layer 1" + id="layer1-2" + transform="matrix(0.43272125,0,0,0.43272125,12.094952,193.20654)"> + <g + transform="matrix(0.26296827,0,0,0.26296827,-799.54693,61.582129)" + id="g1006" + style="fill:#000083;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:bevel"> + <g + style="fill:#000083;fill-opacity:1;stroke:none" + id="g35" + transform="matrix(12.509277,0,0,12.509277,438.06846,8.29825)"> + <path + inkscape:connector-curvature="0" + style="vector-effect:none;fill:#000083;fill-opacity:1;fill-rule:nonzero" + id="path33" + d="m 90.4468,6.62439 h 6.5288 V 38.039 H 108.23 V 44.24 H 90.4741 L 90.4468,6.62439" /> + </g> + <g + style="fill:#000083;fill-opacity:1;stroke:none" + id="g41" + transform="matrix(12.509277,0,0,12.509277,438.06846,8.29825)"> + <path + inkscape:connector-curvature="0" + style="vector-effect:none;fill:#000083;fill-opacity:1;fill-rule:nonzero" + id="path39" + d="m 123.35,16.0488 c 3.459,-0.0433 6.738,1.5334 8.865,4.2614 v -3.7014 h 6.091 v 27.6858 h -6.091 v -3.7014 c -2.127,2.728 -5.406,4.3047 -8.865,4.2614 -7.594,0 -13.358,-6.4878 -13.358,-14.4097 0,-7.922 5.764,-14.3961 13.358,-14.3961 m 1.107,5.5453 c -4.931,0 -8.196,3.8791 -8.196,8.8508 0,4.9717 3.319,8.8644 8.196,8.8644 4.876,0 8.195,-3.8791 8.195,-8.8644 0,-4.9854 -3.265,-8.8508 -8.195,-8.8508" /> + </g> + <g + style="fill:#000083;fill-opacity:1;stroke:none" + id="g47" + transform="matrix(12.509277,0,0,12.509277,438.06846,8.29825)"> + <path + inkscape:connector-curvature="0" + style="vector-effect:none;fill:#000083;fill-opacity:1;fill-rule:nonzero" + id="path45" + d="m 143.046,39.4868 14.519,-17.3463 h -14.301 v -5.5317 h 22.168 v 4.8761 l -14.464,17.278 h 14.792 v 5.5317 h -22.714 v -4.8078" /> + </g> + <g + style="fill:#000083;fill-opacity:1;stroke:none" + id="g53" + transform="matrix(12.509277,0,0,12.509277,438.06846,8.29825)"> + <path + inkscape:connector-curvature="0" + style="vector-effect:none;fill:#000083;fill-opacity:1;fill-rule:nonzero" + id="path51" + d="m 181.249,16.0488 c 3.458,-0.0433 6.738,1.5334 8.864,4.2614 v -3.7014 h 6.092 v 27.6858 h -6.092 v -3.7014 c -2.126,2.728 -5.406,4.3047 -8.864,4.2614 -7.594,0 -13.345,-6.4878 -13.345,-14.4097 0,-7.922 5.751,-14.3961 13.345,-14.3961 m 1.106,5.5453 c -4.931,0 -8.195,3.8791 -8.195,8.8508 0,4.9717 3.319,8.8644 8.195,8.8644 4.876,0 8.195,-3.8791 8.195,-8.8644 0,-4.9854 -3.264,-8.8508 -8.195,-8.8508" /> + </g> + <g + style="fill:#000083;fill-opacity:1;stroke:none" + id="g59" + transform="matrix(12.509277,0,0,12.509277,438.06846,8.29825)"> + <path + inkscape:connector-curvature="0" + style="vector-effect:none;fill:#000083;fill-opacity:1;fill-rule:nonzero" + id="path57" + d="m 213.606,16.0488 c 3.455,-0.0454 6.731,1.5322 8.851,4.2614 V 4.39805 h 6.091 V 44.2946 h -6.091 v -3.7014 c -2.12,2.7292 -5.396,4.3068 -8.851,4.2614 -7.594,0 -13.358,-6.4878 -13.358,-14.4097 0,-7.922 5.764,-14.3961 13.358,-14.3961 m 1.106,5.5453 c -4.931,0 -8.195,3.8791 -8.195,8.8508 0,4.9717 3.333,8.8644 8.195,8.8644 4.863,0 8.195,-3.8791 8.195,-8.8644 0,-4.9854 -3.264,-8.8508 -8.195,-8.8508" /> + </g> + <g + style="fill:#000083;fill-opacity:1;stroke:none" + id="g65" + transform="matrix(12.509277,0,0,12.509277,438.06846,8.29825)"> + <path + inkscape:connector-curvature="0" + style="vector-effect:none;fill:#000083;fill-opacity:1;fill-rule:nonzero" + id="path63" + d="m 245.949,16.0488 c 3.455,-0.0454 6.732,1.5322 8.851,4.2614 v -3.7014 h 6.078 v 27.6858 h -6.105 v -3.7014 c -2.12,2.7292 -5.396,4.3068 -8.851,4.2614 -7.594,0 -13.358,-6.4878 -13.358,-14.4097 0,-7.922 5.791,-14.3961 13.385,-14.3961 m 1.107,5.5453 c -4.931,0 -8.196,3.8791 -8.196,8.8508 0,4.9717 3.333,8.8644 8.196,8.8644 4.862,0 8.195,-3.8791 8.195,-8.8644 0,-4.9854 -3.265,-8.8508 -8.195,-8.8508" /> + </g> + </g> + <g + transform="matrix(1.3719271,0,0,1.3719271,169.4857,-38.493576)" + id="g942"> + <g + style="fill:url(#linearGradient950);fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:square;stroke-linejoin:bevel" + id="g71" + transform="matrix(3.3097462,0,0,3.3097462,-688.02908,65.088537)"> + <path + inkscape:connector-curvature="0" + style="vector-effect:none;fill:url(#linearGradient948);fill-rule:nonzero" + id="path69" + d="M 33.7366,54.7161 C 33.2581,54.7194 32.7871,54.5969 32.3707,54.361 28.8059,52.2985 2.4039,35.7444 1.40683,35.239 0.648025,34.8849 0.129878,34.1595 0.0409756,33.3268 V 10.1073 C 0.0213409,9.24058 0.449817,8.42493 1.17463,7.94927 L 1.36585,7.84 C 3.92,6.25561 12.4702,1.03805 13.8224,0.286829 14.1327,0.102692 14.4861,0.00374668 14.8468,0 c 0.3382,0.00382664 0.6706,0.0881007 0.9698,0.245854 0,0 11.9649,7.799026 13.7951,8.495606 1.2842,0.59 2.6845,0.88406 4.0976,0.86049 1.6012,0.03347 3.1834,-0.35265 4.5892,-1.12 C 40.0878,7.53951 51.52,0.286829 51.6429,0.286829 51.9311,0.112743 52.2623,0.0228451 52.599,0.0273171 52.9601,0.0290843 53.3139,0.128172 53.6234,0.314146 55.1805,1.17463 65.7795,7.66244 66.2302,7.94927 66.9757,8.39902 67.4276,9.20946 67.4185,10.08 v 23.2195 c -0.0836,0.8347 -0.6034,1.5624 -1.3658,1.9122 -0.9971,0.5463 -27.3171,17.1005 -30.9503,19.122 -0.4136,0.2455 -0.8848,0.3774 -1.3658,0.3824" /> + </g> + <g + style="fill:url(#linearGradient1730);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:square;stroke-linejoin:bevel" + id="g79" + transform="matrix(3.3097462,0,0,3.3097462,-688.02908,65.088537)"> + <path + style="vector-effect:none;fill:url(#linearGradient1306);fill-opacity:1;fill-rule:nonzero" + inkscape:connector-curvature="0" + id="path77" + d="m 33.6,54.7162 0.1366,-1e-4 c 0.4785,0.0033 0.9495,-0.1192 1.3658,-0.3551 3.5649,-2.0625 29.9532,-18.6166 30.9503,-19.122 0.7624,-0.3498 1.2822,-1.0775 1.3658,-1.9122 V 10.1073 C 67.4229,9.71423 67.334,9.32571 67.159,8.97366 L 33.6,27.399 v 27.3172" /> + </g> + <g + transform="matrix(-3.2744849,0,0,3.2744849,-467.18522,65.934126)" + id="g970" + style="fill:url(#linearGradient1738);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:square;stroke-linejoin:bevel"> + <path + d="m 33.6,54.7162 0.1366,-1e-4 c 0.4785,0.0033 0.9495,-0.1192 1.3658,-0.3551 3.5649,-2.0625 29.9532,-18.6166 30.9503,-19.122 0.7624,-0.3498 1.2822,-1.0775 1.3658,-1.9122 V 10.1073 C 67.4229,9.71423 67.334,9.32571 67.159,8.97366 L 33.6,27.399 v 27.3172" + id="path968" + inkscape:connector-curvature="0" + style="vector-effect:none;fill:url(#linearGradient1308);fill-opacity:1;fill-rule:nonzero" /> + </g> + </g> + </g> + </g> + </g> + </g> +</svg> diff --git a/public/resume-logos/sap.svg b/public/resume-logos/sap.svg new file mode 100644 index 0000000..79384d7 --- /dev/null +++ b/public/resume-logos/sap.svg @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<svg xmlns="http://www.w3.org/2000/svg" width="743.36707" height="368.43945"> + <g transform="translate(-446.7987,535.9143)"> + <path d="M 446.79872,-168.02763 L 822.11906,-168.02763 L 1190.1658,-535.9143 L 446.79872,-535.9143 L 446.79872,-168.02763" style="fill:#014185;fill-rule:nonzero;stroke:none"/> + <path d="M 887.58191,-466.77099 L 814.84541,-466.78553 L 814.84541,-292.77073 L 750.83729,-466.78553 L 688.2839,-466.78553 L 633.00416,-321.25434 C 627.18524,-357.91354 589.36226,-370.58424 558.81293,-380.06908 C 539.90144,-386.4408 518.08049,-395.80926 519.53522,-406.05056 C 519.53522,-414.54618 529.71833,-422.34353 551.53928,-421.17975 C 566.08658,-420.43784 579.17915,-419.23041 605.36429,-406.74883 L 631.54943,-451.07445 C 606.81902,-463.06142 574.81496,-470.64057 548.62982,-470.66966 L 548.62982,-470.66966 C 516.62576,-470.66966 490.44062,-460.60293 474.43859,-443.91718 C 464.25548,-432.30843 456.98183,-417.57202 456.98183,-401.2354 C 456.98183,-378.75982 465.71021,-362.81598 481.71224,-350.11619 C 497.71427,-339.42392 515.17103,-332.45577 532.62779,-327.34966 C 552.99401,-321.05068 568.99604,-315.59544 568.99604,-303.89942 C 568.99604,-299.57887 567.54131,-295.6511 564.63185,-292.49433 C 558.81293,-287.27185 551.53928,-285.29342 539.90144,-285.04611 C 519.53522,-284.66789 504.98792,-287.91193 480.25751,-302.3574 L 456.98183,-257.47898 C 481.71224,-243.57176 510.80684,-235.39618 539.90144,-235.39618 L 544.26563,-235.42527 C 568.99604,-235.89079 590.81699,-243.23717 606.81902,-256.5916 C 608.27375,-257.37715 608.27375,-258.10452 609.72848,-258.83188 L 602.45483,-239.29486 L 669.37241,-239.29486 L 679.55552,-273.16097 C 691.19336,-269.26229 704.28593,-266.99292 718.83323,-266.99292 C 733.38053,-266.99292 745.01837,-269.18956 756.65621,-272.88457 L 768.29405,-239.29486 L 875.94407,-239.29486 L 875.94407,-309.54377 L 900.67448,-309.54377 C 957.40895,-309.54377 990.86774,-338.65292 990.86774,-387.47365 C 990.86774,-441.82237 958.86368,-466.77099 887.58191,-466.77099 z M 718.83323,-317.79209 C 710.10485,-317.79209 702.8312,-319.30501 695.55755,-321.95261 L 718.83323,-395.15463 L 718.83323,-395.15463 L 742.10891,-321.71986 C 734.83526,-319.21772 727.56161,-317.79209 718.83323,-317.79209 z M 891.9461,-359.89197 L 875.94407,-359.89197 L 875.94407,-418.91037 L 891.9461,-418.91037 C 913.76705,-418.91037 931.22381,-411.76765 931.22381,-389.69939 C 931.22381,-367.0056 913.76705,-359.89197 891.9461,-359.89197" style="fill:#FFF;fill-rule:evenodd;stroke:none"/> + <path d="M 913.76705,-191.53607 C 913.76705,-202.78113 922.49543,-211.34949 932.67854,-211.34949 C 942.86165,-211.34949 951.59003,-202.78113 951.59003,-191.53607 C 951.59003,-179.86914 942.86165,-171.4608 932.67854,-171.4608 C 922.49543,-171.4608 913.76705,-179.86914 913.76705,-191.53607 z M 932.67854,-167.47484 C 945.77111,-167.47484 957.40895,-177.67249 957.40895,-191.53607 C 957.40895,-205.19599 945.77111,-215.23362 932.67854,-215.23362 C 919.58597,-215.23362 907.94813,-205.19599 907.94813,-191.53607 C 907.94813,-177.67249 919.58597,-167.47484 932.67854,-167.47484 z M 928.31435,-189.54309 L 932.67854,-189.54309 L 939.95219,-177.67249 L 944.31638,-177.67249 L 937.04273,-189.77585 C 939.95219,-190.27046 944.31638,-192.40891 944.31638,-197.2968 C 944.31638,-202.78113 939.95219,-205.19599 934.13327,-205.19599 L 923.95016,-205.19599 L 923.95016,-177.67249 L 928.31435,-177.67249 L 928.31435,-189.54309 z M 928.31435,-193.09263 L 928.31435,-201.69009 L 934.13327,-201.69009 C 935.588,-201.69009 939.95219,-201.02091 939.95219,-197.54411 C 939.95219,-193.36903 935.588,-193.09263 932.67854,-193.09263 L 928.31435,-193.09263" style="fill:#014185;fill-rule:nonzero;stroke:none"/> + </g> +</svg> \ No newline at end of file diff --git a/public/resume-qr/telegram.jpg b/public/resume-qr/telegram.jpg new file mode 100644 index 0000000..7f079fe Binary files /dev/null and b/public/resume-qr/telegram.jpg differ diff --git a/public/resume-qr/zalo.jpg b/public/resume-qr/zalo.jpg new file mode 100644 index 0000000..b58d4ac Binary files /dev/null and b/public/resume-qr/zalo.jpg differ diff --git a/public/resume-template.html b/public/resume-template.html index 0481404..120af73 100644 --- a/public/resume-template.html +++ b/public/resume-template.html @@ -2,121 +2,192 @@ <html lang="{{LANG}}"> <head> <meta charset="UTF-8"> - <title>Resume - Dong Nguyen + Resume - {{NAME}} -
- Dong Nguyen +
+ {{NAME}}

{{NAME}}

{{TITLE}}
- {{EMAIL}}
- {{GITHUB}}
- {{LINKEDIN}} + + {{EMAIL}} + + {{SITE_URL}} + + {{GITHUB_URL}} + + {{LINKEDIN_URL}}
+
{{QR_CODES}}
- -
+ +
{{BIO}}
{{EXPERIENCE_LABEL}}
- {{EXPERIENCE}} +
{{EXPERIENCE}}{{TLDR}}
@@ -289,14 +343,12 @@
{{SKILLS_LABEL}}
-
- {{SKILLS}} -
+
{{SKILLS}}
- + diff --git a/scripts/generate-resume.ts b/scripts/generate-resume.ts index caa6c64..d35bb37 100644 --- a/scripts/generate-resume.ts +++ b/scripts/generate-resume.ts @@ -1,20 +1,33 @@ import { chromium } from 'playwright'; -import { readFileSync, existsSync } from 'node:fs'; -import { join, resolve } from 'node:path'; +import { existsSync, mkdirSync, readFileSync } from 'node:fs'; +import { dirname, join, resolve } from 'node:path'; import { profile } from '../src/data/profile.js'; import { experiences } from '../src/data/experience.js'; import { skillGroups } from '../src/data/skills.js'; import { projects } from '../src/data/projects.js'; +import { resumeQr } from '../src/data/resume.js'; +import { siteUrl } from '../src/data/site.js'; +import { strings } from '../src/i18n/strings.js'; import type { Language } from '../src/types/index.js'; const ROOT = resolve(import.meta.dirname, '..'); // --- CLI args --- const args = process.argv.slice(2); -const langArg = (args.find(a => a.startsWith('--lang=')) || '').replace('--lang=', '') as Language; -const lang: Language = (langArg === 'en' || langArg === 'vi') ? langArg : 'en'; +const langArg = (args.find(a => a.startsWith('--lang=')) || '').replace('--lang=', ''); const previewMode = args.includes('--preview'); +let langs: Language[]; +if (langArg === 'all') { + if (previewMode) { + console.error('❌ --lang=all cannot be combined with --preview (preview renders one language)'); + process.exit(1); + } + langs = ['en', 'vi']; +} else { + langs = [langArg === 'vi' ? 'vi' : 'en']; +} + // --- Validate required files --- const requiredFiles = [ 'public/profile-photo.webp', @@ -42,7 +55,7 @@ const fonts: Record = {}; for (const [name, weight] of [ ['REGULAR', 'SourceSans3-Regular.woff2'], ['MEDIUM', 'SourceSans3-Medium.woff2'], - ['SEMIBOLD', 'SourceSans3-Semibold.woff2'], + ['SEMIBOLD', 'SourceSans3-Semibold.woff2',], ['BOLD', 'SourceSans3-Bold.woff2'], ] as const) { fonts[name] = readFileSync(join(ROOT, 'public/fonts', weight)).toString('base64'); @@ -60,6 +73,34 @@ const fontFaces = Object.entries(fonts).map(([key, b64]) => { }`; }).join('\n'); +// --- Company logos: load every logo referenced by experience entries --- +const logoIds = [...new Set(experiences.map(exp => exp.logo).filter((id): id is string => id !== undefined))]; +const logos: Record = {}; +for (const id of logoIds) { + const logoFile = join(ROOT, 'public/resume-logos', `${id}.svg`); + if (!existsSync(logoFile)) { + console.error(`❌ Missing logo asset: public/resume-logos/${id}.svg`); + process.exit(1); + } + logos[id] = readFileSync(logoFile).toString('base64'); +} + +// --- QR codes: owner-exported images from the Telegram/Zalo apps --- +// These are private, owner-supplied assets (not committed). A missing file is +// reported loudly but does not block the build — the resume still ships without it. +const qrMime: Record = { png: 'image/png', jpg: 'image/jpeg', jpeg: 'image/jpeg' }; +const qrAssets: { label: string; dataUri: string }[] = []; +for (const q of resumeQr) { + const file = join(ROOT, 'public/resume-qr', q.file); + if (!existsSync(file)) { + console.warn(`⚠️ QR asset missing: public/resume-qr/${q.file} — ${q.label} QR skipped`); + continue; + } + const ext = q.file.split('.').pop() ?? ''; + const mime = qrMime[ext] ?? 'image/png'; + qrAssets.push({ label: q.label, dataUri: `data:${mime};base64,${readFileSync(file).toString('base64')}` }); +} + // --- Version stamp date --- const updatedDate = new Date().toISOString().slice(0, 10); @@ -69,103 +110,163 @@ const labels: Record> = { EXPERIENCE: 'Experience', SKILLS: 'Skills', PROJECTS: 'Projects', - ABOUT_ME: 'About me', + UPDATED: 'Last updated', + QR_ALT: 'QR code', }, vi: { EXPERIENCE: 'Kinh nghiệm', SKILLS: 'Kỹ năng', PROJECTS: 'Dự án', - ABOUT_ME: 'Về tôi', + UPDATED: 'Cập nhật lần cuối', + QR_ALT: 'mã QR', }, }; // --- Resolve bilingual field --- -function resolveField(en?: T, vi?: T): T { - return lang === 'en' && en !== undefined ? en : (vi !== undefined ? vi : en as T); +function resolveField(en: T | undefined, vi: T | undefined, lang: Language): T { + return lang === 'en' && en !== undefined ? en : (vi !== undefined ? vi : (en as T)); +} + +// --- Escape data strings before injection --- +function escapeHtml(value: string): string { + return value + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); +} + +// QR block: owner-exported Telegram/Zalo QR images, right side of the header +function renderQr(lang: Language): string { + return qrAssets + .map(q => ` +
+ ${escapeHtml(`${q.label} ${labels[lang].QR_ALT}`)} + ${escapeHtml(q.label)} +
`) + .join(''); } // --- Render HTML helpers --- -function renderExperience(exps: typeof experiences): string { - return exps.map(exp => ` -
+function renderExperience(exps: typeof experiences, lang: Language): string { + return exps + // open-to-work (variant 'current') is excluded from the resume PDF entirely + .filter(exp => exp.variant !== 'current') + .map(exp => { + const variantClass = exp.variant ? ` ${exp.variant}` : ''; + const companyLine = [exp.company, exp.location].filter(Boolean).join(' · '); + const responsibilities = resolveField(exp.responsibilitiesEn, exp.responsibilities, lang); + return ` +
- ${resolveField(exp.titleEn, exp.title)} - ${exp.duration} + ${escapeHtml(resolveField(exp.titleEn, exp.title, lang))} + ${escapeHtml(exp.duration)}
-
${exp.company}
- ${exp.location ? `
${exp.location}
` : ''} +
${exp.logo ? `` : ''}${escapeHtml(companyLine)}
    - ${resolveField(exp.responsibilitiesEn, exp.responsibilities).map(r => `
  • ${r}
  • `).join('')} + ${responsibilities.map(r => `
  • ${escapeHtml(r)}
  • `).join('')}
- `).join(''); + `; + }) + .join(''); } -function renderSkills(groups: typeof skillGroups): string { +function renderTldr(lang: Language): string { + return ` +
+
${escapeHtml(strings.experience.tldr[lang])}
+
${escapeHtml(strings.experience.tldrText[lang])}
+
+ `; +} + +function renderSkills(groups: typeof skillGroups, lang: Language): string { return groups.map(group => ` -
-
${resolveField(group.titleEn, group.title)}
-
${group.skills.join(' · ')}
+
+
${escapeHtml(resolveField(group.titleEn, group.title, lang))}
+
${group.skills.map(skill => escapeHtml(skill)).join(' · ')}
`).join(''); } -function renderProjects(projs: typeof projects): string { +function renderProjects(projs: typeof projects, lang: Language): string { return projs.map(project => `
-
${resolveField(project.titleEn, project.title)}
-
${project.role}
-
${resolveField(project.summaryEn, project.summary)}
+
${escapeHtml(resolveField(project.titleEn, project.title, lang))}
+
${escapeHtml(project.role)}
+
${escapeHtml(resolveField(project.summaryEn, project.summary, lang))}
- ${project.technologies.map(t => `${t}`).join('')} + ${project.technologies.map(t => `${escapeHtml(t)}`).join('')}
- ${project.metrics?.length ? `
${project.metrics.join(', ')}
` : ''}
`).join(''); } // --- Assemble HTML --- -const html = template - .replace('{{NAME}}', resolveField(profile.nameEn, profile.name)) - .replace('{{TITLE}}', resolveField(profile.titleEn, profile.title)) - .replace('{{BIO}}', resolveField(profile.bioEn, profile.bio)) - .replace('{{EMAIL}}', profile.email) - .replace('{{GITHUB}}', profile.githubUrl) - .replace('{{LINKEDIN}}', profile.linkedinUrl) - .replace('{{PHOTO_BASE64}}', photoBase64) - .replace('{{FONT_FACES}}', fontFaces) - .replace('{{UPDATED_DATE}}', updatedDate) - .replace('{{LANG}}', lang) - .replace('{{ABOUT_ME_LABEL}}', labels[lang].ABOUT_ME) - .replace('{{EXPERIENCE_LABEL}}', labels[lang].EXPERIENCE) - .replace('{{SKILLS_LABEL}}', labels[lang].SKILLS) - .replace('{{PROJECTS_LABEL}}', labels[lang].PROJECTS) - .replace('{{EXPERIENCE}}', renderExperience(experiences)) - .replace('{{SKILLS}}', renderSkills(skillGroups)) - .replace('{{PROJECTS}}', renderProjects(projects)); +function buildHtml(lang: Language): string { + const fills: Array<[string, string]> = [ + ['{{NAME}}', escapeHtml(resolveField(profile.nameEn, profile.name, lang))], + ['{{TITLE}}', escapeHtml(resolveField(profile.titleEn, profile.title, lang))], + ['{{BIO}}', escapeHtml(resolveField(profile.bioEn, profile.bio, lang))], + ['{{EMAIL}}', escapeHtml(profile.email)], + ['{{GITHUB_URL}}', escapeHtml(profile.githubUrl)], + ['{{LINKEDIN_URL}}', escapeHtml(profile.linkedinUrl)], + ['{{PHOTO_BASE64}}', photoBase64], + ['{{FONT_FACES}}', fontFaces], + ['{{UPDATED_DATE}}', updatedDate], + ['{{UPDATED_LABEL}}', labels[lang].UPDATED], + ['{{SITE_URL}}', escapeHtml(siteUrl)], + ['{{LANG}}', lang], + ['{{EXPERIENCE_LABEL}}', labels[lang].EXPERIENCE], + ['{{SKILLS_LABEL}}', labels[lang].SKILLS], + ['{{PROJECTS_LABEL}}', labels[lang].PROJECTS], + ['{{EXPERIENCE}}', renderExperience(experiences, lang)], + ['{{TLDR}}', renderTldr(lang)], + ['{{SKILLS}}', renderSkills(skillGroups, lang)], + ['{{PROJECTS}}', renderProjects(projects, lang)], + ['{{QR_CODES}}', renderQr(lang)], + ]; + return fills.reduce((html, [key, value]) => html.split(key).join(value), template); +} + +// --- Build per language; fail fast on unresolved placeholders --- +const pages: Record = { en: '', vi: '' }; +for (const lang of langs) { + const html = buildHtml(lang); + const leftover = html.match(/\{\{[A-Z_]+\}\}/g); + if (leftover) { + console.error(`❌ Unresolved placeholders in resume HTML [${lang}]: ${[...new Set(leftover)].join(', ')}`); + process.exit(1); + } + pages[lang] = html; +} // --- Generate output --- const browser = await chromium.launch({ headless: !previewMode }); if (previewMode) { + const lang = langs[0]; const page = await browser.newPage(); - await page.setContent(html); + await page.setContent(pages[lang]); await page.bringToFront(); console.log(`Preview opened in browser [${lang}] — Ctrl+C to exit`); await Promise.withResolvers().promise; } else { - const langSuffix = lang === 'en' ? '' : `-${lang}`; - const outputPath = join(ROOT, `dist/resume${langSuffix}.pdf`); const page = await browser.newPage(); - await page.setContent(html); - await page.pdf({ - path: outputPath, - format: 'A4', - printBackground: true, - title: `Resume - ${profile.name} (${lang === 'en' ? 'English' : 'Vietnamese'})`, - author: profile.name, - }); - + for (const lang of langs) { + const langSuffix = lang === 'en' ? '' : `-${lang}`; + const outputPath = join(ROOT, `dist/resume${langSuffix}.pdf`); + mkdirSync(dirname(outputPath), { recursive: true }); + await page.setContent(pages[lang]); + await page.pdf({ + path: outputPath, + format: 'A4', + printBackground: true, + preferCSSPageSize: true, + tagged: true, + }); + console.log(`resume${langSuffix}.pdf generated at ${outputPath} [${lang}]`); + } await browser.close(); - console.log(`resume${langSuffix}.pdf generated at ${outputPath} [${lang}]`); -} \ No newline at end of file +} diff --git a/src/App.css b/src/App.css index 99e2e39..c225b4a 100644 --- a/src/App.css +++ b/src/App.css @@ -1679,7 +1679,8 @@ /* ===== Contact ===== */ .contact-links { - display: flex; + display: grid; + grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 32px; } @@ -1713,6 +1714,7 @@ font-size: var(--text-meta); line-height: 1.5; color: var(--text-muted); + overflow-wrap: anywhere; } /* Resume download button variant of the contact tile */ @@ -1722,9 +1724,15 @@ color: var(--text-primary); } +@media (max-width: 1024px) { + .contact-links { + grid-template-columns: repeat(2, 1fr); + } +} + @media (max-width: 768px) { .contact-links { - flex-direction: column; + grid-template-columns: 1fr; } } diff --git a/src/components/sections/Contact.tsx b/src/components/sections/Contact.tsx index 8e7de9c..2b5535f 100644 --- a/src/components/sections/Contact.tsx +++ b/src/components/sections/Contact.tsx @@ -1,7 +1,7 @@ import { motion } from "motion/react" import { DownloadResume } from "@/components/sections/DownloadResume" import { SectionHeading } from "@/components/ui/SectionHeading" -import { profile } from "@/data/profile" +import { ContactLinks } from "@/components/ui/ContactLinks" import { InView } from "@/components/ui/InView" import { useLanguage } from '@/hooks/useLanguage' import { strings } from '@/i18n/strings' @@ -22,98 +22,7 @@ export function Contact() { > -
-
- - - - - -
-
- {strings.contact.email[lang]} -
-
- {profile.email} -
-
-
- - - - -
-
- {strings.contact.github[lang]} -
-
- @{profile.githubHandle} -
-
-
- - - - -
-
- {strings.contact.linkedin[lang]} -
-
- @{profile.linkedinHandle} -
-
-
-
-
+ diff --git a/src/components/ui/ContactLinks.tsx b/src/components/ui/ContactLinks.tsx new file mode 100644 index 0000000..eead89a --- /dev/null +++ b/src/components/ui/ContactLinks.tsx @@ -0,0 +1,53 @@ +import { motion } from "motion/react" +import { profile } from "@/data/profile" +import { useLanguage } from "@/hooks/useLanguage" +import { strings } from "@/i18n/strings" +import { GithubIcon, LinkedinIcon, MailIcon, TelegramIcon, ZaloIcon } from "@/components/ui/icons" +import type { Language, SocialId } from "@/types" + +type ContactEntry = { + id: SocialId + href: string + external: boolean + labelKey: 'email' | 'github' | 'linkedin' | 'telegram' | 'zalo' + sub: Record + icon: React.ReactNode +} + +const entries: ContactEntry[] = [ + { id: 'email', href: `mailto:${profile.email}`, external: false, labelKey: 'email', sub: { en: profile.email, vi: profile.email }, icon: }, + { id: 'github', href: profile.githubUrl, external: true, labelKey: 'github', sub: { en: `@${profile.githubHandle}`, vi: `@${profile.githubHandle}` }, icon: }, + { id: 'linkedin', href: profile.linkedinUrl, external: true, labelKey: 'linkedin', sub: { en: `@${profile.linkedinHandle}`, vi: `@${profile.linkedinHandle}` }, icon: }, + { id: 'telegram', href: profile.telegramUrl, external: true, labelKey: 'telegram', sub: { en: `@${profile.telegramHandle}`, vi: `@${profile.telegramHandle}` }, icon: }, + { id: 'zalo', href: profile.zaloUrl, external: true, labelKey: 'zalo', sub: strings.contact.zaloSub, icon: }, +] + +export function ContactLinks() { + const { lang } = useLanguage() + + return ( +
+ {entries.map((entry, i) => ( + + {entry.icon} +
+
{strings.contact[entry.labelKey][lang]}
+
{entry.sub[lang]}
+
+
+ ))} +
+ ) +} diff --git a/src/components/ui/SocialLinks.tsx b/src/components/ui/SocialLinks.tsx index f85b8fc..c6abade 100644 --- a/src/components/ui/SocialLinks.tsx +++ b/src/components/ui/SocialLinks.tsx @@ -2,29 +2,15 @@ import { motion } from "motion/react" import { socialLinks } from "@/data/social" import { useLanguage } from "@/hooks/useLanguage" import { strings } from "@/i18n/strings" +import { GithubIcon, LinkedinIcon, MailIcon, TelegramIcon, ZaloIcon } from "@/components/ui/icons" import type { SocialId } from "@/types" const icons: Record = { - github: ( - - - - ), - linkedin: ( - - - - ), - email: ( - - - - - ), + github: , + linkedin: , + email: , + telegram: , + zalo: , } export function SocialLinks() { diff --git a/src/components/ui/icons.tsx b/src/components/ui/icons.tsx new file mode 100644 index 0000000..52319a3 --- /dev/null +++ b/src/components/ui/icons.tsx @@ -0,0 +1,53 @@ +type IconProps = { size?: number } + +const strokeProps = { + fill: "none", + stroke: "currentColor", + strokeWidth: 2, + strokeLinecap: "round", + strokeLinejoin: "round", +} as const + +export function MailIcon({ size = 20 }: IconProps) { + return ( + + ) +} + +export function GithubIcon({ size = 20 }: IconProps) { + return ( + + ) +} + +export function LinkedinIcon({ size = 20 }: IconProps) { + return ( + + ) +} + +// Brand glyphs (simple-icons, monochrome currentColor) — lucide dropped brand icons +export function TelegramIcon({ size = 20 }: IconProps) { + return ( + + ) +} + +export function ZaloIcon({ size = 20 }: IconProps) { + return ( + + ) +} diff --git a/src/data/experience.ts b/src/data/experience.ts index 42e6c35..250493c 100644 --- a/src/data/experience.ts +++ b/src/data/experience.ts @@ -35,6 +35,7 @@ export const experiences: ExperienceEntry[] = [ title: "Senior Software Engineer", titleEn: "Senior Software Engineer", company: "Lazada Tech Hub Vietnam", + logo: "lazada", duration: "Jan 2020 – Aug 2026", location: "Ho Chi Minh City, Vietnam", responsibilities: [ @@ -70,6 +71,7 @@ export const experiences: ExperienceEntry[] = [ id: "sap-senior-swe", title: "Senior Software Engineer", titleEn: "Senior Software Engineer", + logo: "sap", company: "SAP Lab Vietnam", duration: "2017 – 12/2019", location: "Ho Chi Minh City, Vietnam", diff --git a/src/data/profile.ts b/src/data/profile.ts index 56d71dc..9b7b873 100644 --- a/src/data/profile.ts +++ b/src/data/profile.ts @@ -18,6 +18,9 @@ export const profile: Profile = { linkedinUrl: "https://www.linkedin.com/in/dong-nz", githubHandle: "dong-nz", linkedinHandle: "dong-nz", + telegramUrl: "https://t.me/dongdn", + telegramHandle: "dongdn", + zaloUrl: "https://zaloapp.com/qr/p/14ic4cmkuegf", currentInterests: [ "AI in logistics", "Digital twins", diff --git a/src/data/resume.ts b/src/data/resume.ts index 77c997c..7fefe6c 100644 --- a/src/data/resume.ts +++ b/src/data/resume.ts @@ -8,5 +8,12 @@ export const resumeLanguageLabels: Record = { vi: 'Tiếng Việt', } +// QR codes embedded in the resume header — images exported from the +// Telegram/Zalo apps, stored in public/resume-qr/ (owner-provided assets) +export const resumeQr: { id: string; file: string; label: string }[] = [ + { id: 'telegram', file: 'telegram.jpg', label: 'Telegram' }, + { id: 'zalo', file: 'zalo.jpg', label: 'Zalo' }, +] + export const resumeUrlFor = (lang: Language): string => lang === 'en' ? '/resume.pdf' : `/resume-${lang}.pdf` diff --git a/src/data/social.ts b/src/data/social.ts index 0a8115c..b0310c1 100644 --- a/src/data/social.ts +++ b/src/data/social.ts @@ -9,4 +9,6 @@ export const socialLinks: { { id: 'github', href: profile.githubUrl, external: true }, { id: 'linkedin', href: profile.linkedinUrl, external: true }, { id: 'email', href: `mailto:${profile.email}`, external: false }, + { id: 'telegram', href: profile.telegramUrl, external: true }, + { id: 'zalo', href: profile.zaloUrl, external: true }, ] diff --git a/src/i18n/strings.ts b/src/i18n/strings.ts index 12a1552..683c61f 100644 --- a/src/i18n/strings.ts +++ b/src/i18n/strings.ts @@ -31,6 +31,8 @@ export const strings = { 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'}, + telegram: {en: 'Open Telegram chat', vi: 'Mở chat Telegram'}, + zalo: {en: 'Open Zalo profile', vi: 'Mở hồ sơ Zalo'}, }, }, footer: { @@ -66,8 +68,8 @@ export const strings = { heading: {en: 'Experience', vi: 'Kinh nghiệm'}, tldr: {en: 'TL;DR', vi: 'TL;DR'}, tldrText: { - en: '15 years of experience, more than 5 companies along the way. Too long to tell.', - vi: '15 năm kinh nghiệm, hơn 5 công ty đã đi qua. Quá dài để kể hết.' + en: '15 years of experience, more than 8 companies along the way. Too long to tell.', + vi: '15 năm kinh nghiệm, hơn 8 công ty đã đi qua. Quá dài để kể hết.' }, }, projects: { @@ -89,6 +91,9 @@ export const strings = { email: {en: 'Email', vi: 'Email'}, github: {en: 'GitHub', vi: 'GitHub'}, linkedin: {en: 'LinkedIn', vi: 'LinkedIn'}, + telegram: {en: 'Telegram', vi: 'Telegram'}, + zalo: {en: 'Zalo', vi: 'Zalo'}, + zaloSub: {en: 'Chat on Zalo', vi: 'Chat qua Zalo'}, }, projectDetail: { notFound: {en: 'Project Not Found', vi: 'Không tìm thấy dự án'}, diff --git a/src/pages/ContactPage.tsx b/src/pages/ContactPage.tsx index bce81b4..0190b4b 100644 --- a/src/pages/ContactPage.tsx +++ b/src/pages/ContactPage.tsx @@ -1,8 +1,8 @@ import { SectionHeading } from '@/components/ui/SectionHeading' import { DownloadResume } from '@/components/sections/DownloadResume' +import { ContactLinks } from '@/components/ui/ContactLinks' 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() { @@ -21,67 +21,7 @@ export function ContactPage() { }} > -
- - - - - -
-
{strings.contact.email[lang]}
-
{profile.email}
-
-
- - - - -
-
{strings.contact.github[lang]}
-
@{profile.githubHandle}
-
-
- - - - -
-
{strings.contact.linkedin[lang]}
-
@{profile.linkedinHandle}
-
-
-
+ diff --git a/src/types/index.ts b/src/types/index.ts index 80589ab..0e2bfdf 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -2,7 +2,7 @@ export type Language = 'en' | 'vi'; export type Palette = 'red' | 'blue'; -export type SocialId = 'github' | 'linkedin' | 'email'; +export type SocialId = 'github' | 'linkedin' | 'email' | 'telegram' | 'zalo'; export type ProjectCategory = | "software-engineering" @@ -48,6 +48,7 @@ export interface ExperienceEntry { responsibilities: string[]; responsibilitiesEn?: string[]; variant?: 'current' | 'gap'; + logo?: string; } export interface SkillGroup { @@ -80,6 +81,9 @@ export interface Profile { linkedinUrl: string; githubHandle: string; linkedinHandle: string; + telegramUrl: string; + telegramHandle: string; + zaloUrl: string; currentInterests: string[]; roles: string[]; philosophy: PhilosophyPoint[];