From 4d4fd066cc8252d40940ce73f0a3edb42b8ae929 Mon Sep 17 00:00:00 2001 From: "dong.nguyen" Date: Tue, 20 Oct 2026 18:55:12 +0700 Subject: [PATCH] feat(nav): CV resume glyph at 24px, portal modal, accent color, tight brand gap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- AGENTS.md | 3 ++- .../specs/v3/spec-v3-resume-redesign.md | 6 ++++++ public/cv-icon.svg | 15 ++++++++++++++ src/App.css | 20 ++++++++++++------- src/components/layout/ResumeNavButton.tsx | 2 +- src/components/ui/ResumeDialog.tsx | 10 +++++++--- src/components/ui/icons.tsx | 18 ++++++++++++----- src/hooks/useClickOutside.ts | 12 +++++++---- src/hooks/useResumeDialog.ts | 5 ++++- 9 files changed, 69 insertions(+), 22 deletions(-) create mode 100644 public/cv-icon.svg diff --git a/AGENTS.md b/AGENTS.md index e7d9a29..75c597c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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` - 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` -- 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 `` 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 +- 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: 4px` — its icons carry no borders, so the spacing reads between glyphs: 4px between 44px targets is 24px between the 24px glyphs, a tight brand cluster while hover fills and 2px-offset focus rings stay clear) 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 `` 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; its glyph is `--accent` at every state — rest, hover, open — so the entry always carries the active theme's signal colour and follows the palette switch), holding `ResumeIcon size={24}` — the same 24px the home glyph beside it uses, so the two brand icons share a size inside their 44px targets — the resume document glyph from `public/cv-icon.svg`, the owner's 30-grid CV artwork adapted to the bar's 24-grid (spec follow-up 19): a page outline split on the left edge by a visible dash (`M14 2 H6 a2 2 0 0 0 -2 2 V6` + `M4 10 V12` + `M4 16 v4 a2 2 0 0 0 2 2 h12 a2 2 0 0 0 2 -2 V8 L14 2`; 4px endpoint gaps stay open under 2px round caps), a folded corner (`M14 2 v4 a2 2 0 0 0 2 2 h4`), and stroked CV lettering replacing the content lines (`M9.5 12 A3 3 0 0 0 9.5 18` + `M12.5 12 L15 18 L17.5 12`), in the bar's 2px stroke language; at 1:1 the strokes are exactly 2px and the lettering reads clearly in both themes. 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, their bordered boxes keeping the 16px gap. 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 only the action gap to 8px — the brand group stays at 4px at every width — `@media (max-width: 360px)` drops the padding to 12px — 40 + 44×5 = 260px of controls plus 2×4px brand gaps plus 2×8px action gaps = 284px 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` ## Data Layer @@ -111,6 +111,7 @@ src/ - `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/robots.txt` — allow-all crawler rules plus the `Sitemap:` pointer to the canonical origin +- `public/cv-icon.svg` — canonical CV document glyph (24 grid, 2px `currentColor` stroke, no fills): a split page outline with a visible left-edge dash, a folded corner, and stroked CV lettering; `ResumeIcon` in `src/components/ui/icons.tsx` inlines the same geometry because the bar icon must inherit the control's colour — an `` resolves `currentColor` to black and cannot follow the theme ## Scripts diff --git a/docs/design/specs/v3/spec-v3-resume-redesign.md b/docs/design/specs/v3/spec-v3-resume-redesign.md index dd52542..a66fd6e 100644 --- a/docs/design/specs/v3/spec-v3-resume-redesign.md +++ b/docs/design/specs/v3/spec-v3-resume-redesign.md @@ -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: ''; 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:"";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 `` 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 `` 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 `` "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, ``, 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 ``-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(…, 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 `` 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 diff --git a/public/cv-icon.svg b/public/cv-icon.svg new file mode 100644 index 0000000..c631370 --- /dev/null +++ b/public/cv-icon.svg @@ -0,0 +1,15 @@ + + CV document icon + A resume page with a folded corner, a left-edge dash, and CV lettering, drawn in the site's 2px line language so it inherits the current text colour. + + + + + + + + + + + + diff --git a/src/App.css b/src/App.css index c1d105a..4ee8a10 100644 --- a/src/App.css +++ b/src/App.css @@ -37,11 +37,14 @@ /* The hamburger and the brand travel together on the left of the bar so the sheet's trigger sits where a left-handed thumb reaches it. Above 1024px the button is display:none, so this - group renders as the home icon alone. */ + group renders as the home icon alone. Its icons carry no borders, so the spacing that reads + is measured between glyphs, not boxes: 4px between 44px targets leaves 24px between the 24px + glyphs — a tight brand cluster while the hover fills and the 2px-offset focus rings (2+2px) + still stay clear of each other. The bordered action controls keep their wider 16px gap. */ .nav-brand { display: flex; align-items: center; - gap: 12px; + gap: 4px; } .nav-logo:hover { @@ -135,9 +138,12 @@ /* 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. */ + reads as a second frame next to the home glyph. `:focus-visible` above still rings it. Its + glyph is `--accent` at every state — rest, hover, open — so the entry always carries the + active theme's signal colour and follows the palette switch like the other accent signals. */ .nav-resume-trigger { border-color: transparent; + color: var(--accent); } .nav-resume-trigger:hover, @@ -332,21 +338,21 @@ } /* Six controls share the bar at ≤1024px: hamburger, home, resume, then the three appearance - controls. At 390px the old gaps leave the row flush (260px of controls + 48px of gaps inside - 358px of content), so the brand and action gaps both drop to 8px here: 292px used, 66px slack. */ + controls. The brand group keeps its 4px at every width; only the bordered action controls + drop from 16px to 8px here: 260px of controls + 8px of brand gaps + 16px of action gaps = + 284px used inside 358px of content at 390px. */ @media (max-width: 420px) { .nav-container { padding: 0 16px; } - .nav-brand, .nav-actions { 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. */ + leaves 296px of content for 260px of controls + 24px of gaps — 12px of slack. */ @media (max-width: 360px) { .nav-container { padding: 0 12px; diff --git a/src/components/layout/ResumeNavButton.tsx b/src/components/layout/ResumeNavButton.tsx index c2db9ac..5c84f68 100644 --- a/src/components/layout/ResumeNavButton.tsx +++ b/src/components/layout/ResumeNavButton.tsx @@ -28,7 +28,7 @@ export function ResumeNavButton() { title={strings.common.resumeModalHint[lang]} onClick={openDialog} > - + diff --git a/src/components/ui/ResumeDialog.tsx b/src/components/ui/ResumeDialog.tsx index d0eaa12..f6a7c4e 100644 --- a/src/components/ui/ResumeDialog.tsx +++ b/src/components/ui/ResumeDialog.tsx @@ -1,5 +1,6 @@ import { AnimatePresence, motion } from 'motion/react' import { useEffect } from 'react' +import { createPortal } from 'react-dom' import { resumeUrlFor, resumeLanguages, resumeLanguageLabels } from '@/data/resume' import { useLanguage } from '@/hooks/useLanguage' import { strings } from '@/i18n/strings' @@ -13,7 +14,9 @@ type ResumeDialogProps = { /** * The language picker. Mounted by every trigger with its own `dialogId` so `aria-controls` never - * points at a duplicated id when two triggers are on the same page. + * points at a duplicated id when two triggers are on the same page. The overlay portals to + * `document.body`: the nav bar's `backdrop-filter` makes `.nav` a containing block for fixed + * descendants, which would size the viewport overlay to the bar and clip the panel. */ export function ResumeDialog({ open, close, panelRef, dialogId }: ResumeDialogProps) { const { lang } = useLanguage() @@ -27,7 +30,7 @@ export function ResumeDialog({ open, close, panelRef, dialogId }: ResumeDialogPr return () => cancelAnimationFrame(frame) }, [open, panelRef]) - return ( + return createPortal( {open && ( )} - + , + document.body, ) } diff --git a/src/components/ui/icons.tsx b/src/components/ui/icons.tsx index d806834..f776940 100644 --- a/src/components/ui/icons.tsx +++ b/src/components/ui/icons.tsx @@ -44,14 +44,22 @@ export function TelegramIcon({ size = 20 }: IconProps) { ) } -// CV lettering, same 2px stroke language as the bar's other glyphs: a C arc open to the right and -// a V, sized to fill the 24 grid. A document outline with small lettering inside was rasterized -// first and merged into mush at the bar's 20px, so the letters carry the meaning alone. +// Resume document glyph — the canonical shape lives in public/cv-icon.svg; keep the two in step. +// The owner's CV artwork (a 30-grid draft, spec follow-up 19) adapted to the bar's 24 grid: a +// page outline split on the left edge by a visible dash (4px endpoint gaps stay open under 2px +// round caps), a folded +// corner, and stroked CV lettering replacing the content lines — the only arrangement that +// keeps the lettering readable at the bar's size, because the page is otherwise empty. +// The translated aria-label on the trigger carries the action; the glyph stays aria-hidden. export function ResumeIcon({ size = 20 }: IconProps) { return ( ) } diff --git a/src/hooks/useClickOutside.ts b/src/hooks/useClickOutside.ts index 9695561..262a968 100644 --- a/src/hooks/useClickOutside.ts +++ b/src/hooks/useClickOutside.ts @@ -1,10 +1,14 @@ import { useEffect } from 'react' -export function useClickOutside(ref: React.RefObject, handler: () => void) { +export function useClickOutside( + ref: React.RefObject, + handler: () => void, + extraRef?: React.RefObject, +) { useEffect(() => { const listener = (event: MouseEvent | TouchEvent) => { - const el = ref.current - if (!el || el.contains(event.target as Node)) return + const target = event.target as Node + if (ref.current?.contains(target) || extraRef?.current?.contains(target)) return handler() } document.addEventListener('mousedown', listener) @@ -13,5 +17,5 @@ export function useClickOutside(ref: React.RefObject, handle document.removeEventListener('mousedown', listener) document.removeEventListener('touchstart', listener) } - }, [ref, handler]) + }, [ref, handler, extraRef]) } diff --git a/src/hooks/useResumeDialog.ts b/src/hooks/useResumeDialog.ts index e19d387..a0bb0de 100644 --- a/src/hooks/useResumeDialog.ts +++ b/src/hooks/useResumeDialog.ts @@ -28,7 +28,10 @@ export function useResumeDialog() { const openDialog = useCallback(() => setOpen(true), []) - useClickOutside(containerRef, close) + // The dialog panels portal themselves to document.body (the nav bar's backdrop-filter would + // otherwise clip their fixed overlay to the bar), so the panel is no longer inside + // containerRef — it is passed as the second watched ref so clicks in it are not "outside". + useClickOutside(containerRef, close, panelRef) useEffect(() => { if (!open) return