diff --git a/docs/design/specs/ui/spec-ui-experience.md b/docs/design/specs/ui/spec-ui-experience.md index 9b6a312..2854951 100644 --- a/docs/design/specs/ui/spec-ui-experience.md +++ b/docs/design/specs/ui/spec-ui-experience.md @@ -90,6 +90,24 @@ Text của node TLDR **không** nằm trong `experience.ts`: nó là dẫn xuấ --- +## Node → Title Link (2026-10-20) + +Mọi node của entry được nối vào title của nó bằng một hairline 1px nằm ngang — cùng treatment node TLDR dành cho diamond của nó (§TLDR Terminal Node: `.timeline-tldr::after`, 1px accent 24px từ diamond vào border panel). Link **mang đúng màu của node mà nó thuộc về**, không có màu riêng: accent chỉ ở hai đầu timeline (node đầu và diamond TLDR); các node ở giữa giữ `--border-strong` y hệt ring của chúng. Chủ sở hữu chốt hình ảnh này ngày 2026-10-20. + +| Variant | Rule | Hình học / màu (gutter 36 desktop / 28 mobile) | +|---|---|---| +| Entry thường | `.timeline-marker::after` — `left: 10px; top: 3px; width: 24px; height: 1px`, `background: var(--border-strong)`, `transition: background var(--transition-normal)` | marker 12px border-box tại x 0–12, y 6–18; border 2px làm padding box bắt đầu ở (2, 8) → line **bắt đầu tại mép ngoài vòng** (x 12), **nằm trên trục tâm vòng** (y 11), **kết thúc tại x 36** = mép nội dung, đúng chỗ title bắt đầu. Desktop 24px ≡ `left:-24px` + `width:24px` của link TLDR. Màu = màu ring của chính node | +| Node đầu (`:first-child`) | `.timeline-entry:first-child .timeline-marker::after { background: var(--accent) }` | một trong hai đầu accent: cùng màu với marker fill + halo `--accent-soft` của node đầu | +| Current node (`variant: 'current'`) | `.timeline-entry-current .timeline-marker::after { width: 16px; background: var(--accent) }` (mobile `12px`) | dừng đúng tại border accent trái của panel — x 28 desktop, x 24 mobile — không có ink tràn vào trong panel. Node đầu của data hiện tại chính là node `current`, nên hai rule cho cùng một màu | +| Gap node | `left: 8px; width: 25px` (mobile `17px`) — **không khai báo màu** | vòng 10px span x 1–11, padding box từ x 3 → line đi từ mép ngoài vòng; base value đã sẵn là `--border-strong` của spine nét đứt, ring nhỏ và title italic | +| Hover | `.timeline-entry:hover .timeline-marker::after { background: var(--accent) }` | link sang accent **cùng lúc** ring sang accent (rule hover của marker đã có từ trước); không có cảnh node sáng mà link vẫn xám | +| Node cuối (TLDR) | giữ nguyên `.timeline-tldr::after` — 1px accent 24px (mobile 16px) | đầu accent còn lại; rule mới chỉ nhắm `.timeline-marker`, không đụng `.timeline-tldr-marker` | +| ≤768px | `.timeline-marker::after { width: 16px }` | line x 12 → 28, đúng 16px mà link TLDR dùng ở breakpoint này | + +Vẽ từ **marker**, không từ entry hay `.timeline-header`: entry `current` tự pad top 16px (mobile 14px) nên toạ độ của header dịch theo padding, còn marker neo cố định trên spine. Pseudo của marker paint **sau** vòng (panel của node current ở `z-index: -1`) nên khớp nối liền một màu — cùng cách `.timeline-tldr::after` paint đè diamond. Node TLDR giữ link riêng: rule này chỉ nhắm `.timeline-marker`, không đụng `.timeline-tldr-marker`. + +--- + ## Current Status Node Entry có `variant: 'current'` trong `experience.ts`: node "bây giờ". Nó dùng **cùng họ panel với node TLDR** — flat surface, hairline border, radius, whisper shadow — và khác đúng hai chỗ: cạnh trái accent và marker pulse. @@ -229,3 +247,5 @@ Achievement title 18px and metric 14px/600 no longer appear on this section; `.a - Verified lần cuối (sau khi thêm gap node): `tsc -b` exit 0; `vite build` xanh. Built CSS có `.timeline-entry-gap:before{background:repeating-linear-gradient(to bottom,var(--border-strong) 0px,var(--border-strong) 4px,transparent 4px,transparent 9px)}`, `.timeline-entry-gap{border-bottom:none}`, `.timeline-entry-gap .timeline-marker{width:10px;height:10px;left:-35px}` + bản mobile `left:-27px`, và title/company muted với `font-style:italic`. oxlint vẫn 11 errors / 9 warnings. `pnpm build:resume-all` chạy thành công; text của `dist/resume.pdf` và `dist/resume-vi.pdf` không chứa chuỗi `undefined`. - Va chạm hình ảnh do chủ sở hữu báo cáo: **border trái của bed chồng lên vòng pulse của marker**. Trước đây desktop `left: -14px` → border tại x 22, đúng bằng peak pulse (marker 12px + spread 10px); mobile còn tệ hơn — border tại x 14, nằm trong vùng marker 0–12 cộng halo 4px (tới 16). Nay desktop `left: -10px`, mobile `left: -2px` → border nằm tại x 26–28 ở cả hai breakpoint, hở 4px so với pulse. Built CSS xác nhận: `.timeline-entry-current:after{…inset:-12px -14px 20px -10px}` và bản mobile `left:-2px`. - Báo cáo của chủ sở hữu: trên mobile, chữ của node đầu **sát mép trái** của decoration (gutter 28 nên border accent ở 26–28 chạm đúng chỗ chữ bắt đầu). Cách sửa: node `current` giờ được trang trí **cùng họ với node TLDR** — panel `--bg-surface` + `1px solid --border` + radius `--radius-lg` + whisper shadow, cạnh trái vẫn là accent 2px — và entry có padding thật (desktop `16px 18px 20px`, mobile `14px 16px 18px`) nên chữ nằm *trong* panel (24px desktop / 18px mobile tính từ border). Divider riêng của node bị bỏ; border của panel đóng khung. Pulse mobile giảm spread 10 → 6px (`timeline-status-pulse-sm`) để vòng pulse dừng ở x 18, panel border ở 24–26. Built CSS: `.timeline-entry-current{…padding:16px 18px 20px;border-bottom:none}` + `:after{…inset:-10px -10px -10px -8px}` và hai override mobile `padding:14px 16px 18px`, `inset:-8px -8px -8px -4px`. +- **Owner follow-up 2026-10-20 — node → title link**: thêm `.timeline-marker::after` (hairline 1px từ node vào mép text) cùng 4 rule override (`current` desktop/mobile, `gap` desktop/mobile) trong `src/App.css` — xem §Node → Title Link. Không đổi markup, không thêm class, không thêm token màu. Quyết định của chủ sở hữu (2026-10-20): gap giữ hairline muted `--border-strong`; node current dừng tại mép accent của panel. Verified: `tsc -b` exit 0; `vite build` xanh (out dir tạm `dist-verify`, đã xoá); built CSS phát hành đúng `.timeline-marker:after{content:"";…width:24px}`, `.timeline-entry-current .timeline-marker:after{width:16px}`, `.timeline-entry-gap .timeline-marker:after{background:var(--border-strong);width:25px;left:8px}` và ba bản ≤768px `16px / 12px / 17px`. oxlint exit 0, 4 dòng warning — tất cả có sẵn từ trước, ở `Footer.tsx`, `useLanguage.tsx`, `useTheme.tsx`, `Typewriter.tsx`, không file nào bị sửa. Chủ sở hữu xem trên trình thật: TODO. +- **Owner follow-up 2026-10-20 (lần 2) — link mang đúng màu của node**: chủ sở hữu chốt *chỉ node đầu và node cuối của timeline mang accent; các node ở giữa dùng đúng màu của node*. `src/App.css`: base `.timeline-marker::after` → `background: var(--border-strong)` + `transition: background var(--transition-normal)`; accent giờ đến từ `.timeline-entry:first-child .timeline-marker::after` (node đầu, cùng màu marker fill + halo `--accent-soft` của nó) và từ node TLDR, nơi `.timeline-tldr::after` không bị đụng tới; `.timeline-entry-current` giữ `background: var(--accent)` (node đầu của data hiện tại chính là node `current`); rule gap **bỏ khai báo màu** vì base đã sẵn là `--border-strong` của ring / spine nét đứt / title italic của nó; thêm `.timeline-entry:hover .timeline-marker::after` để link sang accent cùng lúc ring sang accent. Tổng: 5 rule desktop + 3 override ≤768px. Verified: `vite build` exit 0 (out dir tạm `dist-verify`, đã xoá), `tsc -b` exit 0, oxlint exit 0 / 4 warning cũ. Built CSS đúng thứ tự cascade: base `background:var(--border-strong)`, `.timeline-entry-current .timeline-marker:after{background:var(--accent);width:16px}`, `.timeline-entry-gap .timeline-marker:after{width:25px;left:8px}`, `.timeline-entry:first-child .timeline-marker:after{background:var(--accent)}`, `.timeline-entry:hover .timeline-marker:after{background:var(--accent)}`, rồi ba override ≤768px `16px / 12px / 17px`; `.timeline-tldr:after{…background:var(--accent)…}` không đổi. Chủ sở hữu xem trên trình thật: TODO. diff --git a/src/App.css b/src/App.css index 1a490fe..ba3be6d 100644 --- a/src/App.css +++ b/src/App.css @@ -1332,6 +1332,47 @@ transition: border-color var(--transition-normal), background var(--transition-normal); } +/* Horizontal link from the node into the title — the same treatment `.timeline-tldr::after` gives + the terminal diamond. Drawn from the marker rather than from the entry or the header: the + current-role entry pads its own content box (16px top), so the header's coordinates move with + that padding, while the marker is pinned to the spine. The 12px marker is border-box at x 0–12, + y 6–18 and its 2px border makes the padding box start at (2, 8): left 10px puts the link at + x 12, the ring's outer edge, top 3px puts it on the ring's centre line (y 11), and width 24px + ends at x 36 — the content edge where the title starts. Same arithmetic as the TLDR link, which + sits at left -24px (x 12) and runs 24px to the panel. + + The link carries the node's own ink, never a colour of its own: `--border-strong` for an + ordinary ring, `--accent` where the marker itself is accent — the two ends of the timeline, the + first node and the TLDR diamond, whose link already lives in `.timeline-tldr::after` — and it + follows the ring through the same hover transition the ring uses. */ +.timeline-marker::after { + content: ''; + position: absolute; + left: 10px; + top: 3px; + width: 24px; + height: 1px; + background: var(--border-strong); + transition: background var(--transition-normal); +} + +/* The current role is the accent end that is not the TLDR node. Its panel's accent left edge sits + at x 28 (inset -8 against the 36px gutter), so the link stops there: 16px from x 12, meeting the + panel's own border with no ink inside it. */ +.timeline-entry-current .timeline-marker::after { + width: 16px; + background: var(--accent); +} + +/* A break keeps its quiet chrome: the 10px ring spans x 1–11, its padding box starting at x 3, so + the link starts at the ring's outer edge and reaches 1px further. Its ink needs no declaration — + the base value is already the `--border-strong` of the dashed spine, the shrunk ring and the + italic title. */ +.timeline-entry-gap .timeline-marker::after { + left: 8px; + width: 25px; +} + /* Data is newest-first, so the first entry is the current role: filled marker with a soft halo. */ .timeline-entry:first-child .timeline-marker { background: var(--accent); @@ -1339,10 +1380,22 @@ box-shadow: 0 0 0 4px var(--accent-soft); } +/* The first node is the other accent end of the timeline: the link carries the same accent as the + filled marker and halo above it. */ +.timeline-entry:first-child .timeline-marker::after { + background: var(--accent); +} + .timeline-entry:hover .timeline-marker { border-color: var(--accent); } +/* The link follows the ring it belongs to: hovering an entry turns both to accent at once, so a + node never lights up while its own link stays grey. */ +.timeline-entry:hover .timeline-marker::after { + background: var(--accent); +} + .timeline-entry:hover { border-bottom-color: var(--border-strong); } @@ -1603,6 +1656,20 @@ left: -28px; } + /* 28px gutter: the link runs x 12 → 28, the same 16px the TLDR link uses at this width. The + panel's accent edge is at x 24 (inset -4), and the 10px gap ring ends at x 11 → 17px. */ + .timeline-marker::after { + width: 16px; + } + + .timeline-entry-current .timeline-marker::after { + width: 12px; + } + + .timeline-entry-gap .timeline-marker::after { + width: 17px; + } + /* 10px ring at the 28px gutter: L = 6 − 28 − 10/2 = −27. */ .timeline-entry-gap .timeline-marker { left: -27px;