diff --git a/AGENTS.md b/AGENTS.md index 2999981..2449a8f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -56,6 +56,7 @@ Personal engineering portfolio — multi-page SPA built with React + TypeScript - `type Palette = 'red' | 'blue'` (`src/types/index.ts`), labels/hints in `src/data/palettes.ts` (`paletteIds`, `paletteMeta`); default `red` - `data-palette` attribute + `localStorage` key `portfolio-palette`; `index.html`'s init script writes both attributes before paint - Palette overrides in `src/index.css` are `:root[data-theme='dark'][data-palette='blue']` / `:root[data-theme='light'][data-palette='blue']` (specificity 0,3,0 — they beat the base blocks regardless of order); no blue variant exists in the `prefers-color-scheme` bridge, because the init script always writes `data-palette` +- 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-swatch-option` buttons — the same segmented shape as the Mode/Language rows, options drawn as colour icons via `.nav-palette-preview`. `ThemePaletteMenu` has no `variant` prop and is never mounted in the sheet - Bar controls share one chrome: `.nav-control` covers the mode toggle, the language toggle and the palette trigger (44px bordered box, accent border + text on hover/open, one `:focus-visible`). All four controls — mode, language, theme color, hamburger — sit in `.nav-actions` at every width, in that order; `@media (max-width: 420px)` tightens the container padding and action gap so the row fits a 320px viewport @@ -93,6 +94,7 @@ src/ - `RollingTextLink.tsx` — animated text-scrolling navigation link - `BackToTop.tsx` — scroll-to-top floating button with AnimatePresence - `HeroParticles.tsx` — decorative particle background (uses AnimatePresence) +- Palette swatch rotation — `ThemePaletteMenu.tsx` renders the swatch as a `motion.span` whose `rotate` target is 90° while the `#palette-menu` submenu is open and 0° otherwise; reduced motion comes from the global `motion.config.reducedMotion = 'user'` in `main.tsx`, so no per-component branch ## External Assets @@ -155,7 +157,7 @@ All specification documents are in `docs/design/`: | `spec-v2.md` | v2 index — overview, implementation order, feature list | | `specs/ui/spec-ui-*.md` | UI specs per section (hero, about, expertise, etc.) | | `specs/v2/spec-v2-*.md` | v2 feature specs (resume, seo, blog, analytics, testing, cicd) | -| `specs/v3/spec-v3-*.md` | v3 feature specs (theme colors, theme switch, theme palette switch, UI enhancements) | +| `specs/v3/spec-v3-*.md` | v3 feature specs (theme colors, theme switch, theme palette switch, UI enhancements, mobile navigation, nav & CTA enhancements) | Read `spec.md` first for product context. Read `spec-v2.md` for current feature scope. diff --git a/docs/design/specs/v3/spec-v3-nav-cta-enhancements.md b/docs/design/specs/v3/spec-v3-nav-cta-enhancements.md new file mode 100644 index 0000000..fd32e1c --- /dev/null +++ b/docs/design/specs/v3/spec-v3-nav-cta-enhancements.md @@ -0,0 +1,318 @@ +# Specification — v3 Nav Bar & CTA Enhancements + +> **Document:** `spec-v3-nav-cta-enhancements.md` +> **Version:** 0.2.0 (drafted 2026-10-17 after the owner answered Q1–Q8; built the same day) +> **Parents:** `specs/ui/spec-ui-layout.md` (bar controls), `spec-v3-theme-palette-switch.md` (palette blocks, `--accent` family), `spec-v3-typography.md` (chrome band), `spec-v3-mobile-navigation.md` (§13 findings this spec closes one of) +> **Priority:** P2 +> **Estimate:** ~40 minutes including the gate re-run +> **Status:** BUILT 2026-10-17 — Steps 1–5 on disk, §9.1 records the gate run and the SSR smoke. Open: the owner's browser pass (A1, A3, A4, A5, A6, A7, A9) and the commit decision. + +--- + +## 1. Request + +1. **Replace the language control's `EN`/`VI` text with an icon** — the owner asked which icon suits the two languages. +2. **Add motion to the theme-colour control**: clicking rotates the circle 90°; it rotates back after a colour is selected or the control loses focus. +3. **The text inside the buttons looks too dark in dark mode** — make it lighter, similar to light mode. + +Request 3 is not a navigation-bar item. The buttons in question are `.btn-primary` in the hero CTA cluster (`src/components/sections/Hero.tsx:93-98`, `:24`), styled at `src/App.css:455-471`. The spec covers both surfaces because they were requested as one change set. + +--- + +## 2. Current state (verified against the code, 2026-10-17) + +### 2.1 Facts + +| Fact | Evidence | +|---|---| +| The language control is a text glyph: `{lang === 'en' ? 'VI' : 'EN'}` inside `nav-control lang-toggle` | `src/components/layout/Navigation.tsx:102-109` | +| `.lang-toggle` sets `font-size: 13px; font-weight: 600; letter-spacing: 0.5px` | `src/App.css:119-123` | +| The bar's other two controls are icon-only (inline sun/moon SVG; the half-circle swatch), so the language control is the only text control in the bar | `Navigation.tsx:84-100`, `:111`, `src/App.css:331-340` | +| `public/icons.svg` holds social symbols only (`github-icon`, `x-icon`, …); every bar icon is inline SVG | `grep id= public/icons.svg` | +| The palette trigger is `