feat(nav): CV resume glyph at 24px, portal modal, accent color, tight brand gap

- ResumeIcon: split page outline with a visible left-edge dash and stroked CV
  lettering (owner's 30-grid draft adapted to the 24 grid, spec follow-up 19),
  rendered at 24px matching the home glyph inside the 44px target
- ResumeDialog: portal to document.body — the fixed overlay anchored to the
  bar's backdrop-filter containing block instead of the viewport;
  useClickOutside takes an exclusion ref for the portaled panel
- .nav-resume-trigger: glyph is --accent at rest/hover/open, follows both
  theme axes
- .nav-brand: gap 12px -> 4px (borderless icons read glyph-to-glyph); the
  420px media rule only drops the bordered action gap to 8px
- public/cv-icon.svg rewritten as the canonical glyph; AGENTS.md and
  spec-v3-resume-redesign.md (follow-ups 19-23) updated
This commit is contained in:
dong.nguyen committed 2026-10-20 18:55:12 +07:00
1 parent affca525b4
commit 4d4fd066cc
9 files changed
+69 -22

No files matched your search

@@ -120,4 +120,10 @@ Modern, elegant, brand-consistent A4 resume: correct print geometry, timeline ex
- [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`
- [x] Owner follow-up 18 (2026-10-20): **bar resume icon — the owner's CV artwork, adapted to the line language** — closes follow-up 17's open end: the owner supplied the artwork (Flaticon #6588184) as `public/cv-icon.svg` — 1024 grid, fixed navy/blue/grey fills, person silhouette, Arial `<text>` "CV", six placeholder lines, two ghost outline paths behind transform hacks. Reviewed against the bar's 2px `currentColor` stroke language and rasterized at the bar's real 20px (follow-up 17's method, pixel grids at DSF 1 on `#151914` and `#f6f5f2`): as-is the asset is a solid ink blob on dark and scattered slivers on light — person, lettering and lines merge; a three-line variant's top stub collides with the fold flap. The file is rewritten as the canonical glyph — 24 grid, `fill: none` + `stroke: currentColor`, 2px round caps/joins: page outline with the corner cut `M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z`, fold `M14 2v4a2 2 0 0 0 2 2h4`, two content lines `M8 12h8` / `M8 16h5` (long then short, echoing the original's alternating widths); person, `<text>`, ghost paths and fixed colours deleted. `ResumeIcon` in `src/components/ui/icons.tsx` replaces the CV lettering with the same geometry inlined — the bar icon must inherit the control's colour, and the raster confirms an `<img>`-loaded `currentColor` asset renders black-on-black in the dark bar. Evidence at 20px: outline, fold and both lines stay separate ink runs with ≥2px gaps in both themes; `pnpm lint` + `tsc -b` clean. CV meaning now carried by the translated `strings.nav.resume` label; `AGENTS.md` bar-controls paragraph and External Assets list updated.
- [x] Owner follow-up 19 (2026-10-20): **bar resume icon — CV lettering returns, with the owner's dash** — the owner drafted `public/v-1.svg` (30 grid: page outline split on the left edge by a dash, folded corner, stroked CV lettering replacing the content lines) and asked for it in the bar. `ResumeIcon` in `src/components/ui/icons.tsx` and the canonical `public/cv-icon.svg` are rewritten to the same design, adapted natively to the 24 grid on the existing page geometry: outline `M14 2 H6 a2 2 0 0 0 -2 2 V6` + dash `M4 10 V12` + `M4 16 v4 a2 2 0 0 0 2 2 h12 a2 2 0 0 0 2 -2 V8 L14 2`, fold `M14 2 v4 a2 2 0 0 0 2 2 h4`, lettering `M9.5 12 A3 3 0 0 0 9.5 18` + `M12.5 12 L15 18 L17.5 12` (C opens to the right, both letters 6 units tall, centred). Two adaptations were forced by geometry: the left-edge endpoint gaps are 4px, not v-1's 2px — under 2px round caps a 2px gap closes and the dash reads as a continuous edge (visible gap = endpoint distance − stroke width); and the lettering replaces both content lines, because no other region of the 24-grid page fits legible letters. Follow-up 17's method re-run as proof: rasterized at the bar's real 20px on `#151914` and `#f6f5f2` — the dash and both letters read clearly on each background, unlike the Flaticon artwork's small embedded text. The owner later removed `public/v-1.svg` from the repository; the canonical glyph carries the design.
- [x] Owner follow-up 20 (2026-10-20): **nav resume modal renders as the hero modal** — clicking the bar CV icon opened the shared `ResumeDialog`, but the panel did not display like the hero's: `ResumeNavButton` mounts it inside `.nav-resume`, a descendant of `.nav`, and `.nav` carries `backdrop-filter: blur(12px)` (`App.css:11`) — per CSS Filter Effects a `backdrop-filter` makes an element the containing block for fixed-position descendants, so the overlay's `position: fixed; inset: 0` sized to the ~64px bar instead of the viewport and the panel was centred inside the bar, top half clipped. The hero trigger never showed it because `.download-resume` is only `position: relative`. Fix: `ResumeDialog` now returns `createPortal(<AnimatePresence>…</AnimatePresence>, document.body)` — both triggers' overlays anchor to the viewport and the overlay's `z-index: 1100` sits above the bar's `1000` in the root stacking context. Portal side effect: the panel left `containerRef`, so `useClickOutside` grew an optional third watched ref (`extraRef`, clicks inside either ref are not "outside") and `useResumeDialog` passes `panelRef` — otherwise every click inside the panel closed the dialog. `ThemePaletteMenu`'s two-argument call is untouched; its panel stays in its container. React event semantics unchanged: overlay-click-to-close and the panel's `stopPropagation` still pair correctly through the portal tree; Escape, body scroll lock, and focus return are unaffected. Proof: `pnpm lint` + `tsc -b` clean; modal display to be confirmed by the owner in a real browser.
- [x] Owner follow-up 21 (2026-10-20): **bar resume glyph always carries the theme colour** — the trigger inherited `.nav-control`'s rest `color: var(--text-primary)`, which is identical across the red and blue palettes, so switching palette left the CV glyph unchanged: the entry did not read as themed. `.nav-resume-trigger` now declares `color: var(--accent)` at rest (`App.css`), joining the `border-color: transparent` rule; hover and open already resolve to `--accent` through `.nav-control:hover / .open` (specificity 0,2,0), so the glyph is the active theme/palette's signal colour in every state — rest, hover, open — with no colour step between them, and it follows both theme axes because `--accent` is re-declared in all five blocks of `index.css`. Contrast is the same accent already used by `.nav-link.active` and every control's hover. Cascade verified by rule order (`.nav-resume-trigger` 0,1,0 after `.nav-control` 0,1,0) and a full-file grep: no other rule touches the trigger's colour. `AGENTS.md` bar-controls paragraph updated.
- [x] Owner follow-up 22 (2026-10-20): **bar resume icon at 24×24** — `ResumeNavButton` now renders `<ResumeIcon size={24} />` instead of the component's 20px default. The glyph is built on the 24 grid (follow-up 19), so at 24px it renders 1:1: strokes land at exactly 2px like every other bar icon and the 6-unit letters become 6px — the size the follow-up 17 notes had already named as the alternative when 20px was the constraint. The 44px target is untouched: `.nav-control`'s 8px padding + 1px border leave a 26px content box, 2px wider than the icon, and the icon now matches the 24px home glyph beside it. Proof: the shipped path strings rasterized at 24px on `#151914` and `#f6f5f2` — dash open at both gaps, both letters clear; `pnpm lint` + `tsc -b` clean.
- [x] Owner follow-up 23 (2026-10-20): **tighter brand-group spacing — the left icons carry no borders** — `.nav-brand`'s 12px gap was sized for bordered boxes, but the group's three controls (hamburger, home, resume) are borderless, so the spacing that reads is glyph-to-glyph: 10px of target padding + 12px gap + 10px = 32px between the 24px glyphs. The gap drops to 4px at every width: 24px between glyphs, hover fills stay 4px apart, and two 2px-offset focus rings (2+2px) meet without overlapping. The `@media (max-width: 420px)` rule now only drops the bordered action controls 16px→8px; the brand group needs no narrow-width override because 4px is already below 8px. Width budgets improve at every breakpoint: at 390px, 260px controls + 8px brand gaps + 16px action gaps = 284px inside 358px; at 320px, 284px inside 296px — 12px of slack where the old layout had 4px. All 44px targets unchanged.
- [ ] Owner visual check of `dist/resume.pdf` / `dist/resume-vi.pdf` in a real browser/PDF viewer