fix(hero): single download CTA, no click flash, mobile lazer beam

One trigger at every width opens the language dialog: the details dropdown markup, its CSS, both chevron rules and the hero-download desktop/mobile variants are gone, and @media (max-width: 768px) lets the trigger fill the CTA column like the other two buttons.

The trigger carries an open class so the :hover accent fill does not fire at the click instant behind the overlay, and the scrim is a plain colour mix instead of backdrop-filter: blur(4px), which used to repaint the page under the fading overlay. transition: all became explicit background/color transitions.

The lazer split was geometric: inset: -200% resolved against the wrapper, so the rotating layer measured 1710x265 for the 342x53 mobile wrapper, and once its short half-side (132.5px) is narrower than the wrapper half-diagonal (173px) the layer stops covering the wrapper's own edges, cutting the beam in two for part of every cycle (14/72 angles). Both layers are now inset: 0 and the spin animates a registered @property --lazer-angle (0deg -> 360deg) instead of rotating a box: 1 lit segment at 72/72 angles on both 342x53 and 167x53, same 4s cycle, and the blurred glow layer shrinks to the wrapper box.

Also carries the nav chrome this feature needs: .nav-resume, the borderless .nav-resume-trigger (border-color transparent at rest, hover and open, matching the home icon beside it while keeping the 44px target, hover fill and :focus-visible ring), and the 420px gap plus new 360px padding tightening so six controls fit a 320px viewport. AGENTS.md and docs/design/specs/v3/spec-v3-resume-redesign.md follow-ups 13-17 record all of it.
This commit is contained in:
dong.nguyen committed 2026-10-20 00:33:35 +07:00
1 parent 4f1d4ebe30
commit affca525b4
3 files changed
+180 -81

No files matched your search

+9 -7
View File
@@ -61,7 +61,7 @@ Personal engineering portfolio — multi-page SPA built with React + TypeScript
- Accent has two tiers: `--accent` / `--accent-hover` / `--accent-active` are the bright signal colours (links, underlines, borders, glows) and the fill of the pale accent surfaces (palette-option hover, `.tag-accent`, `.back-to-top`, resume summary bar); `--accent-solid` / `-hover` / `-active` plus `--text-on-accent-solid` are the deeper fill and light text used by `.btn-primary` and `.badge-accent`, which is what lets a dark-mode button carry light text. The solid family is declared in all five blocks of `src/index.css` (dark red, light red, dark blue, light blue, the `prefers-color-scheme` bridge); the two light blocks duplicate the plain accent values verbatim, so light mode does not move. Spec: `docs/design/specs/v3/spec-v3-nav-cta-enhancements.md` - Accent has two tiers: `--accent` / `--accent-hover` / `--accent-active` are the bright signal colours (links, underlines, borders, glows) and the fill of the pale accent surfaces (palette-option hover, `.tag-accent`, `.back-to-top`, resume summary bar); `--accent-solid` / `-hover` / `-active` plus `--text-on-accent-solid` are the deeper fill and light text used by `.btn-primary` and `.badge-accent`, which is what lets a dark-mode button carry light text. The solid family is declared in all five blocks of `src/index.css` (dark red, light red, dark blue, light blue, the `prefers-color-scheme` bridge); the two light blocks duplicate the plain accent values verbatim, so light mode does not move. Spec: `docs/design/specs/v3/spec-v3-nav-cta-enhancements.md`
- Picker, two renderings, both present at every width: the bar uses `src/components/layout/ThemePaletteMenu.tsx` — icon-only trigger (`nav-control nav-palette-trigger`, a 20px half-circle swatch: active palette's accent on the left, `--swatch-empty` on the right; no text, no chevron; the name lives in `aria-label`, the hint in `title`) opening the `#palette-menu` panel. The sheet renders its own Theme color row inside `MobileMenu.tsx` from `paletteIds` + `paletteMeta` as `.mobile-menu-icon-option` buttons — the 44px icon-only square the Language row shares; the Mode row keeps `.mobile-menu-segment-option`, because its options are words. `ThemePaletteMenu` has no `variant` prop and is never mounted in the sheet - Picker, two renderings, both present at every width: the bar uses `src/components/layout/ThemePaletteMenu.tsx` — icon-only trigger (`nav-control nav-palette-trigger`, a 20px half-circle swatch: active palette's accent on the left, `--swatch-empty` on the right; no text, no chevron; the name lives in `aria-label`, the hint in `title`) opening the `#palette-menu` panel. The sheet renders its own Theme color row inside `MobileMenu.tsx` from `paletteIds` + `paletteMeta` as `.mobile-menu-icon-option` buttons — the 44px icon-only square the Language row shares; the Mode row keeps `.mobile-menu-segment-option`, because its options are words. `ThemePaletteMenu` has no `variant` prop and is never mounted in the sheet
- Preview chips are theme-aware: `--preview-red-accent` / `--preview-blue-accent` are declared per theme — `:root` dark pair, `:root[data-theme='light']` light pair, repeated in the `prefers-color-scheme` bridge — and mirror that block's `--accent`, so a submenu dot and the bar swatch's accent half are the same colour in the same theme. Each chip names its own palette through `data-preview`, so the two `[data-palette='blue']` blocks declare no preview token; `--swatch-empty` stays one constant. Spec: `docs/design/specs/v3/spec-v3-nav-swatch-and-hamburger.md` - Preview chips are theme-aware: `--preview-red-accent` / `--preview-blue-accent` are declared per theme — `:root` dark pair, `:root[data-theme='light']` light pair, repeated in the `prefers-color-scheme` bridge — and mirror that block's `--accent`, so a submenu dot and the bar swatch's accent half are the same colour in the same theme. Each chip names its own palette through `data-preview`, so the two `[data-palette='blue']` blocks declare no preview token; `--swatch-empty` stays one constant. Spec: `docs/design/specs/v3/spec-v3-nav-swatch-and-hamburger.md`
- Bar controls share one chrome: `.nav-control` covers the language toggle, the mode toggle and the palette trigger (44px bordered box, accent border + icon on hover/open, one `:focus-visible`). The hamburger leads the bar at every width it appears: `.nav-brand` (`display: flex; gap: 12px`) holds it first and the brand home icon right after, at the bar's left edge — `.nav-logo` is a 24px stroke house in a 44px target, a `<Link to="/">` named by the translated `strings.nav.home` label with the svg `aria-hidden`, so it carries its own `:focus-visible` ring. `.nav-actions` then carries the three appearance controls in that order (language, mode, theme color) at the right end. The sheet's Appearance group follows the same order (Language row, Mode row, Theme color row). `@media (max-width: 420px)` tightens the container padding and the action gap so the row fits a 320px viewport (40 + 12 + 44 + 44×3 + 12×2 = 252px inside 288px) - Bar controls share one chrome: `.nav-control` covers the language toggle, the mode toggle and the palette trigger (44px bordered box, accent border + icon on hover/open, one `:focus-visible`). The hamburger leads the bar at every width it appears: `.nav-brand` (`display: flex; gap: 12px`) holds it first and the brand home icon right after, at the bar's left edge — `.nav-logo` is a 24px stroke house in a 44px target, a `<Link to="/">` named by the translated `strings.nav.home` label with the svg `aria-hidden`, so it carries its own `:focus-visible` ring. Third in the brand group is the resume entry — `src/components/layout/ResumeNavButton.tsx`, a `nav-control nav-resume-trigger` 44px target that **carries no border** (`border-color: transparent` at rest, on hover and while open, because it sits beside the borderless home icon; the hover fill and the `:focus-visible` ring stay), holding `ResumeIcon`: CV lettering in the bar's 2px stroke language — a C arc open to the right (`M13.5 7.8A6.5 6.5 0 1 0 13.5 16.2`) and a V (`M15 6l3.5 12L22 6`) filling the 24 grid, because a document outline with lettering inside rasterized into mush at the bar's 20px. Named by `strings.nav.resume`, `aria-haspopup="dialog"` on its own `#resume-modal-nav`; `.nav-resume` is the wrapper that ties trigger to dialog and is what `useClickOutside` watches. `.nav-actions` then carries the three appearance controls in that order (language, mode, theme color) at the right end. The sheet's Appearance group follows the same order (Language row, Mode row, Theme color row). Six controls now share the bar at ≤1024px: `@media (max-width: 420px)` keeps 16px padding and drops both group gaps to 8px, `@media (max-width: 360px)` drops the padding to 12px — 40 + 44×5 = 260px of controls plus 4×8px gaps = 292px inside 296px, and every target stays 44px
- Language control is icon-only in both renderings — `src/components/ui/LanguageIcon.tsx` draws both languages as line art in the bar's stroke language (`currentColor`, no fills): English a 20px globe (circle r=10 + equator + meridian ellipse, 2px round joins, so it follows the control's hover accent), Tiếng Việt a flag outline (21×17.5 band `rx=2` at 1.5/3.25 — drawn 23×19.5 against the globe's 22×22; width is already at the limit, so the size step came from height, which drags the constitutional 2:3 to 1.2 — with a centred five-point mullet at r=3.6, deliberately smaller than the flag's own 0.6 × height construction, stroked 1.5px round joins so its interior stays open). The bar's `nav-control lang-toggle` shows the language it switches TO (`lang === 'en' ? 'vi' : 'en'`): translated action in `aria-label`, the target's own-language name in `title`. `.lang-toggle` now carries no CSS rules of its own — it marks the button in the DOM and nothing else. The sheet's Language row uses `.mobile-menu-icon-option` squares with `aria-pressed` and the own-language `aria-label` / `title`. Spec: `docs/design/specs/v3/spec-v3-i18n.md` - Language control is icon-only in both renderings — `src/components/ui/LanguageIcon.tsx` draws both languages as line art in the bar's stroke language (`currentColor`, no fills): English a 20px globe (circle r=10 + equator + meridian ellipse, 2px round joins, so it follows the control's hover accent), Tiếng Việt a flag outline (21×17.5 band `rx=2` at 1.5/3.25 — drawn 23×19.5 against the globe's 22×22; width is already at the limit, so the size step came from height, which drags the constitutional 2:3 to 1.2 — with a centred five-point mullet at r=3.6, deliberately smaller than the flag's own 0.6 × height construction, stroked 1.5px round joins so its interior stays open). The bar's `nav-control lang-toggle` shows the language it switches TO (`lang === 'en' ? 'vi' : 'en'`): translated action in `aria-label`, the target's own-language name in `title`. `.lang-toggle` now carries no CSS rules of its own — it marks the button in the DOM and nothing else. The sheet's Language row uses `.mobile-menu-icon-option` squares with `aria-pressed` and the own-language `aria-label` / `title`. Spec: `docs/design/specs/v3/spec-v3-i18n.md`
## Data Layer ## Data Layer
@@ -70,7 +70,7 @@ Personal engineering portfolio — multi-page SPA built with React + TypeScript
- `src/data/skills.ts` — skill groups → skills - `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/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/projects.ts` — project cards with categories
- `src/data/resume.ts` — resume availability, supported languages, URL generation - `src/data/resume.ts` — resume availability, supported languages, URL generation, and `resumeQr` (the `{id, file, label}` descriptors the resume header renders as QR codes)
- `src/data/navigation.ts` — `navPaths` (bar + sheet order: Home, About, Experience, Projects, Contact, Philosophy), `footerPaths` - `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}` (github, linkedin, email, telegram); `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); `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/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`
@@ -82,11 +82,11 @@ Personal engineering portfolio — multi-page SPA built with React + TypeScript
``` ```
src/ src/
components/ components/
layout/ — Layout.tsx, Navigation.tsx, MobileMenu.tsx, Footer.tsx, ThemePaletteMenu.tsx layout/ — Layout.tsx, Navigation.tsx, MobileMenu.tsx, Footer.tsx, ThemePaletteMenu.tsx, ResumeNavButton.tsx
sections/ — Hero, About, Expertise, Experience, Projects, Contact, HeroParticles, DownloadResume sections/ — Hero, About, Expertise, Experience, Projects, Contact, HeroParticles, DownloadResume (the hero lazer CTA; it gates itself on `resumeAvailable`)
ui/ — Badge, Button, ContactLinks, LanguageIcon, SectionHeading, SocialLinks, Tag, Typewriter, InView, RollingTextLink, BackToTop, icons ui/ — Badge, Button, ContactLinks, LanguageIcon, ResumeDialog, SectionHeading, SocialLinks, Tag, Typewriter, InView, RollingTextLink, BackToTop, icons
data/ — profile, skills, experience, projects, resume, palettes, navigation, social, site (TS modules) data/ — profile, skills, experience, projects, resume, palettes, navigation, social, site (TS modules)
hooks/ — useTheme.tsx, useLanguage.tsx, useClickOutside.ts hooks/ — useTheme.tsx, useLanguage.tsx, useClickOutside.ts, useResumeDialog.ts
pages/ — HomePage, AboutPage, ExperiencePage, ProjectsListPage, ProjectDetailPage, PhilosophyPage, ContactPage pages/ — HomePage, AboutPage, ExperiencePage, ProjectsListPage, ProjectDetailPage, PhilosophyPage, ContactPage
types/ — shared TypeScript interfaces types/ — shared TypeScript interfaces
``` ```
@@ -108,7 +108,7 @@ src/
- `public/fonts/` — Source Sans 3 woff2 (Regular, Medium, Semibold, Bold); used by the resume generator only — the SPA renders `system-ui` - `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-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-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/resume-qr/` — owner-supplied QR images (`telegram.jpg`, `zalo.jpg`) embedded in the resume header via `resumeQr` in `src/data/resume.ts`; committed like the other resume assets, so CI renders the QR block too — a missing file prints a warning and that QR is skipped
- `public/profile-photo.webp` — profile photo - `public/profile-photo.webp` — profile photo
- `public/robots.txt` — allow-all crawler rules plus the `Sitemap:` pointer to the canonical origin - `public/robots.txt` — allow-all crawler rules plus the `Sitemap:` pointer to the canonical origin
@@ -120,6 +120,7 @@ src/
## Deployment ## Deployment
- Deployment is triggered automatically by gitea workflow `.gitea/workflows/deploy.yml` - Deployment is triggered automatically by gitea workflow `.gitea/workflows/deploy.yml`
- Three jobs: `build` (`pnpm build` → `dist/` artifact) → `generate-resume` (`pnpm tsx scripts/generate-resume.ts --lang=en`, then `--lang=vi`) → `deploy` rsyncs `dist/`, both PDFs included, to `/opt/stacks/dong-site/dist/`
- `nginx.conf` — production Nginx SPA routing + caching config - `nginx.conf` — production Nginx SPA routing + caching config
- `docker-compose.yaml` — Docker service for local nginx deployment - `docker-compose.yaml` — Docker service for local nginx deployment
@@ -157,6 +158,7 @@ docker-compose.yaml
4. **Footer/Nav links:** Must use `<Link to>`, not `<a href>` for client-side navigation 4. **Footer/Nav links:** Must use `<Link to>`, not `<a href>` for client-side navigation
5. **Bilingual plumbing is done, the content is not:** `field(lang, value, valueEn)` resolves correctly, but most content has no second language — `skills.ts` group titles are identical in both languages, `projects.ts` titles differ for 1 of 4 projects, and `role` / `technologies` / `metrics` / `duration` / `company` in `experience.ts` have no `*En` variants at all. Translating means adding data, never changing a component 5. **Bilingual plumbing is done, the content is not:** `field(lang, value, valueEn)` resolves correctly, but most content has no second language — `skills.ts` group titles are identical in both languages, `projects.ts` titles differ for 1 of 4 projects, and `role` / `technologies` / `metrics` / `duration` / `company` in `experience.ts` have no `*En` variants at all. Translating means adding data, never changing a component
6. **`lazy()` needs a default export:** pages export named components, so each factory must map `{ default: m.XPage }` — a bare `import('@/pages/XPage')` fails `tsc` with `TS2322: Property 'default' is missing`. There is no `src/pages/index.ts` barrel: importing it would pull every route back into the entry chunk 6. **`lazy()` needs a default export:** pages export named components, so each factory must map `{ default: m.XPage }` — a bare `import('@/pages/XPage')` fails `tsc` with `TS2322: Property 'default' is missing`. There is no `src/pages/index.ts` barrel: importing it would pull every route back into the entry chunk
7. **A locked `dist/resume*.pdf` blocks the build:** while a generated PDF is open in a viewer, `pnpm build:resume-all` fails with `EBUSY` on that file and `pnpm build` fails too (vite `emptyDir` → `EPERM`). Close the viewer first
## Design Specs ## Design Specs
@@ -115,4 +115,9 @@ Modern, elegant, brand-consistent A4 resume: correct print geometry, timeline ex
- [x] Owner follow-up 10 (2026-10-19): **Zalo removed from the site** — `SocialId` drops `'zalo'`; `Profile.zaloUrl` removed from `src/data/profile.ts` and from the `Profile` interface in `src/types/index.ts`; the zalo entries are gone from `social.ts` and `ContactLinks.tsx` (its `labelKey` union narrows to email/github/linkedin/telegram); `strings.social.aria.zalo` and `strings.contact.zalo` + `zaloSub` deleted; `ZaloIcon` deleted from `icons.tsx`, so the tiles are stroke lucide (mail/github/linkedin) + the filled telegram glyph. Hero, footer and the mobile sheet follow automatically through `SocialLinks`. **Resume QR block unchanged by owner decision** — `resumeQr` keeps `{id: 'zalo', file: 'zalo.jpg'}` and `public/resume-qr/zalo.jpg` stays on disk; only the website drops Zalo. Proof: `pnpm lint` no new warnings, `tsc -b` + `vite build` clean (545 modules, ContactPage chunk 0.53 kB), grep over `src/` finds `zalo` only in `resume.ts` - [x] Owner follow-up 10 (2026-10-19): **Zalo removed from the site** — `SocialId` drops `'zalo'`; `Profile.zaloUrl` removed from `src/data/profile.ts` and from the `Profile` interface in `src/types/index.ts`; the zalo entries are gone from `social.ts` and `ContactLinks.tsx` (its `labelKey` union narrows to email/github/linkedin/telegram); `strings.social.aria.zalo` and `strings.contact.zalo` + `zaloSub` deleted; `ZaloIcon` deleted from `icons.tsx`, so the tiles are stroke lucide (mail/github/linkedin) + the filled telegram glyph. Hero, footer and the mobile sheet follow automatically through `SocialLinks`. **Resume QR block unchanged by owner decision** — `resumeQr` keeps `{id: 'zalo', file: 'zalo.jpg'}` and `public/resume-qr/zalo.jpg` stays on disk; only the website drops Zalo. Proof: `pnpm lint` no new warnings, `tsc -b` + `vite build` clean (545 modules, ContactPage chunk 0.53 kB), grep over `src/` finds `zalo` only in `resume.ts`
- [x] Owner follow-up 11 (2026-10-19): **header photo + QR gap** — `.header-photo` 72 → 96px; `.header-info` `margin-left` 12 → 24px (clear space for the bigger photo); `.header-qr` keeps `margin-left: auto` and its `gap` goes 18 → **50px**, so the pair stays pinned to the right edge while the Telegram code sits 50px left of Zalo — each code gets its own quiet zone and a scanner cannot land on the wrong one. Measured at the real print content width (180mm = 680px): photo 96×96 at x=0, info x=138, Telegram QR 493.9–562, Zalo QR 612–680 (flush with the right edge), **QR separation 18 → 50.0 px**, 137px clear between the contact info and the Telegram code, all four contact URLs still one line each, nothing overflows the 680px content box. Header height is unchanged (150.8px — the info block, not the photo, is the tallest child), so pagination does not move. QR payloads re-decoded before the move: `telegram.jpg` → `https://t.me/dongdn`, `zalo.jpg` → `https://zaloapp.com/qr/p/14ic4cmkuegf` (assets correctly labelled). Both `resume.pdf` and `resume-vi.pdf` rebuilt (21:25) - [x] Owner follow-up 11 (2026-10-19): **header photo + QR gap** — `.header-photo` 72 → 96px; `.header-info` `margin-left` 12 → 24px (clear space for the bigger photo); `.header-qr` keeps `margin-left: auto` and its `gap` goes 18 → **50px**, so the pair stays pinned to the right edge while the Telegram code sits 50px left of Zalo — each code gets its own quiet zone and a scanner cannot land on the wrong one. Measured at the real print content width (180mm = 680px): photo 96×96 at x=0, info x=138, Telegram QR 493.9–562, Zalo QR 612–680 (flush with the right edge), **QR separation 18 → 50.0 px**, 137px clear between the contact info and the Telegram code, all four contact URLs still one line each, nothing overflows the 680px content box. Header height is unchanged (150.8px — the info block, not the photo, is the tallest child), so pagination does not move. QR payloads re-decoded before the move: `telegram.jpg` → `https://t.me/dongdn`, `zalo.jpg` → `https://zaloapp.com/qr/p/14ic4cmkuegf` (assets correctly labelled). Both `resume.pdf` and `resume-vi.pdf` rebuilt (21:25)
- [x] Owner follow-up 12 (2026-10-19): **download-resume button removed from the site contact surfaces** — `<DownloadResume />` deleted from `src/components/sections/Contact.tsx` and `src/pages/ContactPage.tsx` (each now ends at `<ContactLinks />`); `DownloadResume()` and its single-language `DownloadButton()` fallback deleted from `src/components/sections/DownloadResume.tsx` (104 → 71 lines, the file exports only `DownloadResumeDropdown`, which is what Hero uses — hero CTA untouched), so the `resumeAvailable` and `Language` imports that only those two components used are gone; the dead `.download-resume-button` rule and its comment deleted from `src/App.css`. `resumeAvailable` stays in `src/data/resume.ts` because Hero gates its CTA on it. Proof: `pnpm lint` unchanged (4 pre-existing warnings), `tsc -b` + `vite build` clean, built CSS 33.69 → 33.60 kB with zero `download-resume-button` hits, ContactPage chunk 0.53 → 0.51 kB, hero CTA classes (`hero-download-dropdown`, `hero-download-summary`, `hero-download-mobile-btn`, `download-resume-option`) and the `/resume.pdf` href still in the bundle - [x] Owner follow-up 12 (2026-10-19): **download-resume button removed from the site contact surfaces** — `<DownloadResume />` deleted from `src/components/sections/Contact.tsx` and `src/pages/ContactPage.tsx` (each now ends at `<ContactLinks />`); `DownloadResume()` and its single-language `DownloadButton()` fallback deleted from `src/components/sections/DownloadResume.tsx` (104 → 71 lines, the file exports only `DownloadResumeDropdown`, which is what Hero uses — hero CTA untouched), so the `resumeAvailable` and `Language` imports that only those two components used are gone; the dead `.download-resume-button` rule and its comment deleted from `src/App.css`. `resumeAvailable` stays in `src/data/resume.ts` because Hero gates its CTA on it. Proof: `pnpm lint` unchanged (4 pre-existing warnings), `tsc -b` + `vite build` clean, built CSS 33.69 → 33.60 kB with zero `download-resume-button` hits, ContactPage chunk 0.53 → 0.51 kB, hero CTA classes (`hero-download-dropdown`, `hero-download-summary`, `hero-download-mobile-btn`, `download-resume-option`) and the `/resume.pdf` href still in the bundle
- [x] Owner follow-up 13 (2026-10-19): **download CTA unified into one trigger + modal** — `src/components/sections/DownloadResume.tsx` rewritten: one lazer-wrapped button at every width (`aria-haspopup="dialog"`, `aria-expanded`, `aria-controls="resume-modal"`) opening an `AnimatePresence` dialog (`role="dialog" aria-modal="true"`, focus moves into the panel when the open animation ends, Escape / click-outside / the close button return focus to the trigger, `document.body.style.overflow` locked while open, `useClickOutside` hook replaces the old inline listener — the duplication `spec-v3-theme-palette-switch.md:374` flagged). Options come from `resumeLanguages`: `English → /resume.pdf`, `Tiếng Việt → /resume-vi.pdf`, each with `download` and the file name under the label. Hero drops `HeroDownloadButton`, the `Language` import and the `hero-download-desktop` / `hero-download-mobile` split, rendering `{resumeAvailable && <DownloadResume />}` once — mobile gets the same single button as desktop. New chrome strings `resumeModalTitle` / `resumeModalAria` / `resumeModalHint` / `resumeModalClose` in `strings.common`. CSS: `.download-resume` + the `.resume-modal*` block added (overlay `z-index: 1100`, above the 1000 nav), a ≤768px block stretches the trigger to the CTA column width and centres its content; deleted `.download-resume-dropdown`, `.download-resume-options`, `.download-resume-option`, `.download-resume-shared-wrapper`, `.download-resume-summary::-webkit-details-marker`, both chevron rules, `.hero-download-desktop`, `.hero-download-mobile` and their media block. Lazer border/glow kept, chevron dropped. Proof: `pnpm lint` unchanged, `tsc -b` + `vite build` clean (CSS 33.60 → 34.42 kB), built CSS 0 hits for every deleted selector and 15 for `resume-modal`, throwaway SSR render → exactly 1 trigger carrying the dialog aria triple, 0 modal nodes while closed, 0 hits for `hero-download-*` / `download-resume-option*` / `chevron`. Still open for the owner's real-browser check: open/close, Escape, focus return, and the full-width trigger at ≤768px
- [x] Owner follow-up 14 (2026-10-19): **colour flash on click fixed** — two causes. (a) The trigger flipped to the `--accent` fill at the instant of the click: the pointer is still on the button so `:hover` fires, and the leftover `.download-resume-summary.open` rule (solid accent, which the rewritten component never applied — dead CSS) agreed with it, so the button went solid accent behind the semi-transparent overlay. The trigger now carries `open` from state and `.download-resume-summary.open, .download-resume-summary.open:hover` hold it at the resting look (`background: transparent; color: var(--accent)`); a `@media (hover: none)` block does the same for the sticky tap-hover on touch devices. (b) `.resume-modal-overlay` had `backdrop-filter: blur(4px)` over a 60% `--bg-primary` scrim: `AnimatePresence` mounts the element on the first frame, so the blur landed at full strength while its opacity was still animating — the page behind jumped before the dialog arrived. `backdrop-filter` removed, scrim raised to 78% `--bg-primary`, and overlay and panel now share `duration: 0.18` so scrim and dialog read as one motion. `transition: all` on the trigger replaced by `background, color` (repo rule: a control never carries `transition: all`). Proof from the built CSS: the trigger carries `transition:background …, color …`, zero `transition:all` in the bundle, `.download-resume-summary.open,.download-resume-summary.open:hover{color:var(--accent);background:0 0}` present, `.resume-modal-overlay` has no `backdrop-filter`. Open/close feel still needs the owner's real-browser check
- [x] Owner follow-up 15 (2026-10-20): **mobile lazer no longer splits into two segments** — the cause is geometric, not colour. `.download-resume-lazer-border` / `.download-resume-lazer-glow` used `inset: -200%`, which resolves against the wrapper's own width and height, so the rotating layer measured **1710×265** on the 342×53 mobile wrapper (167×53 on desktop). `@keyframes download-resume-lazer-spin` rotated that box, and once its short half-side (132.5px) is narrower than the wrapper's half-diagonal (173px) the layer stops covering the wrapper's own edges: the lit band gets cut and the beam reads as two parts. Desktop never showed it (132.5 > 87.6 half-diagonal), which is why only the full-width mobile button looked broken. Fix: both layers are now `inset: 0` — exactly the wrapper box, so coverage is complete at every angle — and the spin animates the gradient itself through a registered `@property --lazer-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg }` (`from var(--lazer-angle, 0deg)`, keyframes `0deg → 360deg`) instead of rotating a box: same 4s cycle, same arc stops, and the painted layer shrinks from 1710×265 to the wrapper box, which also cuts the cost of the `blur(12px)` glow. Proof: geometry model over 72 rotation angles — old box **1 segment on 58/72 and 2 segments on 14/72** at 342×53, 1/1 at 167×53; new geometry **1 segment on 72/72** at both sizes. Playwright probe against the production build: ring layer rect now equals the wrapper (342×53 mobile, 167×53 desktop), `--lazer-angle` advances 81° → 190° in 1.2s (4s per turn) with `animation-name: download-resume-lazer-spin`, and `@property --lazer-angle{syntax:"<angle>";inherits:false;initial-value:0deg}` is in the built CSS. `prefers-reduced-motion` keeps `animation: none`, which now parks the beam at the registered `initial-value: 0deg`
- [x] Owner follow-up 16 (2026-10-20): **resume entry in the navigation bar** — `src/components/layout/ResumeNavButton.tsx` is the third item in `.nav-brand`, right after the home icon: a `nav-control nav-resume-trigger` 44px icon box (`ResumeIcon` added to `src/components/ui/icons.tsx` — lucide `file-down`, 20px `currentColor` stroke, `aria-hidden`), named by `strings.nav.resume` (`Get resume` / `Tải CV`), `title` = the modal hint, `aria-haspopup="dialog"` / `aria-expanded` / `aria-controls="resume-modal-nav"`, gated on `resumeAvailable`. The dialog is no longer duplicated: `src/components/ui/ResumeDialog.tsx` owns the overlay + panel + `resumeLanguages` options and takes a `dialogId`, so the hero trigger keeps `#resume-modal` and the bar trigger gets `#resume-modal-nav` — one markup source, no duplicate ids. `src/hooks/useResumeDialog.ts` holds the state both triggers share (open flag, container/trigger/panel refs, `useClickOutside`, Escape, body-overflow lock, focus return); `close` is guarded on an `openRef` because the click-outside listener is live even while closed — unguarded it pulled focus to the trigger on every click anywhere on the page. Panel focus moved from `onAnimationComplete` to a one-frame `useEffect` keyed on `open`: `AnimatePresence` keeps the open=true props on its exiting copy, so the old handler fired again at the end of the exit animation, focused the panel and stranded focus on `<body>` when it unmounted (measured `body` before, `BUTTON.nav-control.nav-resume-trigger` after). `resumeAvailable` moved out of Hero's JSX into the leaf components, so Hero renders `<DownloadResume />` plainly. CSS: `.nav-resume { display: flex }`; `@media (max-width: 420px)` now tightens `.nav-brand` **and** `.nav-actions` to 8px gaps and a new `@media (max-width: 360px)` drops the container padding to 12px — six controls (40 + 44×5 = 260px) overflowed at the old 12px gaps (`.nav-container` scrollWidth 324 > 320), and after the change 320 measures 320 = 320 with 360/390/420/1024/1280 clean and the resume box at 44×44. Probe on the production build: bar control 44×44 with the full aria triple, `#resume-modal-nav` opens with 2 `download` options (`/resume.pdf`, `/resume-vi.pdf`), focus lands on the panel, Escape and the close button return focus to the trigger, an overlay/outside click leaves focus where the user clicked, `body.style.overflow` locks and restores, and the hero trigger is still exactly 1 with its own `#resume-modal`. `pnpm lint` unchanged (4 pre-existing warnings), `tsc -b` + `vite build` clean (CSS 34.65 → 34.71 kB). Owner check in a real browser: the glyph's look and position in the bar, and the row at 320–420px
- [x] Owner follow-up 17 (2026-10-20): **bar resume icon — no border, CV lettering** — `.nav-resume-trigger` overrides the shared chrome with `border-color: transparent` in one rule group covering rest, `:hover` and `.open`, so the entry reads like its borderless neighbour `.nav-logo` while keeping the 44px target, the `--bg-elevated` hover fill and the `:focus-visible` ring. `ResumeIcon` replaced (lucide `file-down` → drawn lettering): `M13.5 7.8A6.5 6.5 0 1 0 13.5 16.2` (C, open to the right) + `M15 6l3.5 12L22 6` (V). The shape was chosen by rasterizing candidates at the bar's real 20px and reading the silhouette: a page outline with small `CV` inside, and a page outline with a `CV` band, both merge into unreadable mush at 20px; the letters alone stay legible, so no document frame. The owner's Flaticon artwork (#6588184) was not fetched or copied — the page returns 403 to this environment and the session has no vision model to inspect a raster — so the glyph is original work in the bar's existing 2px `currentColor` stroke language; an exact match needs the owner to supply the SVG. Proof: built CSS `.nav-resume-trigger,.nav-resume-trigger:hover,.nav-resume-trigger.open{border-color:#0000}`; live computed style at rest `rgba(0,0,0,0)` border with a 44×44 box and a 20×20 icon, on hover border still `rgba(0,0,0,0)` with `--bg-elevated` fill and `--accent` icon; the two path strings are the only resume paths in the bundle; the shipped paths rasterized at 20px read as `C` + `V`
- [ ] Owner visual check of `dist/resume.pdf` / `dist/resume-vi.pdf` in a real browser/PDF viewer - [ ] Owner visual check of `dist/resume.pdf` / `dist/resume-vi.pdf` in a real browser/PDF viewer
+166 -74
View File
@@ -54,6 +54,13 @@
outline-offset: 2px; outline-offset: 2px;
} }
/* The bar's resume entry reuses the `.nav-control` chrome; the wrapper only has to sit in the
brand row like the other items. Its class is also the hook that ties the trigger to the
`#resume-modal-nav` dialog it expands. */
.nav-resume {
display: flex;
}
.nav-menu { .nav-menu {
display: flex; display: flex;
gap: 32px; gap: 32px;
@@ -126,6 +133,18 @@
outline-offset: 2px; outline-offset: 2px;
} }
/* The resume entry keeps the `.nav-control` 44px target and its hover fill, but carries no
outline: it sits in the brand group beside the borderless home icon, and a framed box there
reads as a second frame next to the home glyph. `:focus-visible` above still rings it. */
.nav-resume-trigger {
border-color: transparent;
}
.nav-resume-trigger:hover,
.nav-resume-trigger.open {
border-color: transparent;
}
.mobile-menu-btn { .mobile-menu-btn {
display: none; display: none;
background: none; background: none;
@@ -312,16 +331,25 @@
} }
} }
/* Four controls share the bar at ≤1024px. At 320px: hamburger 40 + 12 + home icon 44 + 44×3 /* Six controls share the bar at ≤1024px: hamburger, home, resume, then the three appearance
controls + 12×2 gaps = 252px inside 288px of content, so the row keeps 36px of slack — the controls. At 390px the old gaps leave the row flush (260px of controls + 48px of gaps inside
wordmark's 8px brand-gap tightening is no longer needed. */ 358px of content), so the brand and action gaps both drop to 8px here: 292px used, 66px slack. */
@media (max-width: 420px) { @media (max-width: 420px) {
.nav-container { .nav-container {
padding: 0 16px; padding: 0 16px;
} }
.nav-brand,
.nav-actions { .nav-actions {
gap: 12px; gap: 8px;
}
}
/* 320px keeps every 44px target intact and pays for them out of the gutter instead: 12px padding
leaves 296px of content for 260px of controls + 32px of gaps — 4px of slack. */
@media (max-width: 360px) {
.nav-container {
padding: 0 12px;
} }
} }
@@ -951,8 +979,8 @@
border-color: var(--border) !important; border-color: var(--border) !important;
} }
/* ===== Download Resume Dropdown ===== */ /* ===== Download Resume (one trigger, modal picker) ===== */
.download-resume-dropdown { .download-resume {
position: relative; position: relative;
width: fit-content; width: fit-content;
} }
@@ -968,7 +996,7 @@
border-radius: var(--radius-md); border-radius: var(--radius-md);
cursor: pointer; cursor: pointer;
text-decoration: none; text-decoration: none;
transition: all var(--transition-fast); transition: background var(--transition-fast), color var(--transition-fast);
border: none; border: none;
background: transparent; background: transparent;
width: 100%; width: 100%;
@@ -977,71 +1005,146 @@
user-select: none; user-select: none;
} }
.download-resume-summary::-webkit-details-marker {
display: none;
}
.download-resume-summary:hover { .download-resume-summary:hover {
border-color: var(--accent); border-color: var(--accent);
background: var(--accent); background: var(--accent);
color: var(--text-on-accent); color: var(--text-on-accent);
} }
.download-resume-summary.open { /* The dialog is the open state. The trigger keeps its resting colour while the modal is up:
background: var(--accent); the pointer is still on it after the click, so without this the :hover accent fill lands at
color: var(--text-on-accent); the instant of the click and reads as a colour flash behind the overlay. */
.download-resume-summary.open,
.download-resume-summary.open:hover {
background: transparent;
color: var(--accent);
} }
.download-resume-summary .chevron { /* Touch devices keep :hover stuck after a tap, so the accent fill would sit on the trigger
margin-left: auto; until the next tap somewhere else. */
transition: transform 0.2s; @media (hover: none) {
.download-resume-summary:hover {
background: transparent;
color: var(--accent);
}
} }
/* Language picker — a dialog, not a dropdown: one trigger serves every width */
.download-resume-dropdown .download-resume-options { .resume-modal-overlay {
display: none; position: fixed;
inset: 0;
z-index: 1100;
display: grid;
place-items: center;
padding: 24px;
/* No backdrop-filter: the blur would apply at full strength on the first frame while the
opacity is still animating, so the page behind jumps before the dialog arrives. */
background: color-mix(in srgb, var(--bg-primary) 78%, transparent);
} }
.download-resume-dropdown .download-resume-options.open { .resume-modal {
display: block; width: min(420px, 100%);
}
.download-resume-dropdown .download-resume-summary.open .chevron {
transform: rotate(180deg);
}
.download-resume-options {
position: absolute;
top: calc(100% + 4px);
left: 0;
width: fit-content;
background: var(--bg-elevated); background: var(--bg-elevated);
border: 1px solid var(--border); border: 1px solid var(--border);
border-radius: 8px; border-radius: var(--radius-lg);
box-shadow: 0 4px 12px var(--shadow); padding: 24px;
z-index: 100; box-shadow: 0 12px 32px var(--shadow);
overflow: hidden;
} }
.download-resume-option { .resume-modal:focus-visible {
display: block; outline: 2px solid var(--accent);
padding: 10px 20px; outline-offset: 4px;
text-decoration: none;
color: var(--text-primary);
font-size: 14px;
transition: background 0.15s, color 0.15s;
} }
.download-resume-option:hover { .resume-modal-head {
background: var(--accent); display: flex;
color: var(--text-on-accent); align-items: center;
gap: 12px;
} }
/* Shared wrapper for lazer + dropdown positioning context */
.download-resume-shared-wrapper { .resume-modal-head h3 {
position: relative; flex: 1;
}
.resume-modal-close {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: transparent;
color: var(--text-muted);
cursor: pointer;
transition: border-color var(--transition-fast), color var(--transition-fast);
}
.resume-modal-close:hover {
border-color: var(--accent);
color: var(--accent);
}
.resume-modal-close:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
.resume-modal-hint {
margin-top: 4px;
font-size: var(--text-meta);
line-height: 1.5;
color: var(--text-muted);
}
.resume-modal-options {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; gap: 12px;
margin-top: 16px;
}
.resume-modal-option {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 12px;
padding: 14px 16px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
text-decoration: none;
color: var(--text-primary);
transition: border-color var(--transition-fast), background var(--transition-fast);
}
.resume-modal-option:hover {
border-color: var(--accent);
background: var(--accent-tint);
}
.resume-modal-option:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
.resume-modal-option-label {
font-size: 16px;
font-weight: 500;
}
.resume-modal-option-file {
font-size: 14px;
color: var(--text-muted);
}
/* The spin animates the gradient angle, not a rotating box. A box rotated inside a wide, short
wrapper stops covering the wrapper's own edges as soon as its short side is narrower than the
wrapper is wide (inset -200% made the layer 1710x265 against a 342x53 wrapper), and the beam
gets cut into two segments for part of every cycle. */
@property --lazer-angle {
syntax: '<angle>';
inherits: false;
initial-value: 0deg;
} }
/* ===== Download Resume Lazer Border ===== */ /* ===== Download Resume Lazer Border ===== */
@@ -1055,9 +1158,9 @@
.download-resume-lazer-border { .download-resume-lazer-border {
position: absolute; position: absolute;
inset: -200%; inset: 0;
background: conic-gradient( background: conic-gradient(
from 0deg, from var(--lazer-angle, 0deg),
transparent 60%, transparent 60%,
var(--accent) 80%, var(--accent) 80%,
var(--accent-hover) 95%, var(--accent-hover) 95%,
@@ -1069,9 +1172,9 @@
.download-resume-lazer-glow { .download-resume-lazer-glow {
position: absolute; position: absolute;
inset: -200%; inset: 0;
background: conic-gradient( background: conic-gradient(
from 0deg, from var(--lazer-angle, 0deg),
transparent 60%, transparent 60%,
var(--accent) 80%, var(--accent) 80%,
var(--accent-hover) 95%, var(--accent-hover) 95%,
@@ -1092,8 +1195,8 @@
} }
@keyframes download-resume-lazer-spin { @keyframes download-resume-lazer-spin {
from { rotate: 0deg; } from { --lazer-angle: 0deg; }
to { rotate: 360deg; } to { --lazer-angle: 360deg; }
} }
@media (prefers-reduced-motion: reduce) { @media (prefers-reduced-motion: reduce) {
@@ -1113,26 +1216,15 @@
} }
} }
/* Mobile: the single trigger fills the CTA column like the other two buttons */
/* Desktop: show dropdown, hide mobile buttons */
.hero-download-desktop {
display: block;
}
.hero-download-mobile {
display: none;
}
/* Mobile: show 2 buttons, hide dropdown */
@media (max-width: 768px) { @media (max-width: 768px) {
.hero-download-desktop { .hero-cta .download-resume,
display: none; .hero-cta .download-resume-lazer-wrapper {
width: 100%;
} }
.hero-download-mobile { .hero-cta .download-resume-summary {
display: flex; justify-content: center;
flex-direction: column;
gap: 16px;
} }
} }