diff --git a/docs/design/spec-v2.md b/docs/design/spec-v2.md index f352deb..d0465e4 100644 --- a/docs/design/spec-v2.md +++ b/docs/design/spec-v2.md @@ -22,13 +22,14 @@ v2 bao gồm 6 tính năng, mỗi tính năng có spec riêng trong `specs/`: | File | Feature | Priority | Est. | Status | |------|---------|----------|------|--------| | `specs/v2/spec-v2-resume.md` | Resume download | P1 | ~15 min | ✅ Done | +| `specs/v2/spec-v2-hero-carousel.md` | Hero visual carousel | P1 | ~1 hour | | | `specs/v2/spec-v2-seo.md` | SEO (metadata, OG, sitemap) | P1 | ~1 hour | | | `specs/v2/spec-v2-blog.md` | Blog (MDX, articles, syntax highlight) | P1 | ~4 hours | | | `specs/v2/spec-v2-analytics.md` | Analytics (Plausible) | P2 | ~30 min | | | `specs/v2/spec-v2-testing.md` | Testing (Vitest + E2E) | P5 | ~3 hours | | | `specs/v2/spec-v2-cicd.md` | CI/CD (GitHub Actions) | P5 | ~1 hour | | -**Implementation order:** ~~Resume~~ → SEO → Blog → Analytics → Testing → CI/CD +**Implementation order:** ~~Resume~~ → Hero Carousel → SEO → Blog → Analytics → Testing → CI/CD --- diff --git a/docs/design/specs/ui/spec-ui-hero-photo.md b/docs/design/specs/ui/spec-ui-hero-photo.md new file mode 100644 index 0000000..792d1f9 --- /dev/null +++ b/docs/design/specs/ui/spec-ui-hero-photo.md @@ -0,0 +1,130 @@ +# UI Spec - Hero Photo Background + Open to Work Badge + +## Overview + +Thay thế hero-visual (SVG diagram) bằng profile photo background, fill toàn bộ vùng bên phải hero section. Badge "Open to Work" overlay ở góc dưới ảnh. + +--- + +## Structure + +``` +Hero (section) +├── hero-photo-bg (div, ảnh nền) +│ └── profile-photo.webp (img, object-fit: cover) +├── hero-content (div, text bên trái) +│ ├── hero-name (h1) +│ ├── hero-title (p) +│ ├── hero-tagline (p) +│ ├── hero-cta (div, buttons) +│ └── SocialLinks +└── OpenToWorkBadge (component, góc dưới-right) + ├── icon (checkmark) + ├── "Open to Work" (text chính) + └── "Software Engineer" (subtitle) +``` + +--- + +## Hero Photo Background + +### Desktop + +- Position: absolute, fill `hero-visual` area +- `object-fit: cover` — fill hết khung, cắt phần thừa +- `object-position: center top` — giữ khuôn mặt ở trên +- Border-radius: 0 (khung vuông/tròn?) +- Z-index: 0 (nằm dưới text) + +### Mobile + +- Position: absolute, fill TOÀN BỘ hero section +- `object-fit: cover` +- Overlay gradient để text readable + +--- + +## Text Overlay + +### Desktop + +- Text nằm bên trái, không đè lên ảnh +- Giữ layout 2 cột hiện tại +- Không cần overlay + +### Mobile + +- Overlay gradient từ trái qua (transparent → dark) +- Hoặc overlay bán trong suốt toàn bộ hero +- Đảm bảo text contrast ratio ≥ 4.5:1 + +--- + +## Open to Work Badge + +### Design + +- Shape: bo góc 12px +- Background: accent color (hoặc gradient accent) +- Size: 200x200 (max-width: 200px) +- Padding: 20px +- Shadow: subtle drop shadow + +### Content + +``` +┌──────────────────┐ +│ ✓ Open to Work │ +│ Software │ +│ Engineer │ +└──────────────────┘ +``` + +- Icon: checkmark (SVG inline) +- Title: "Open to Work" — bold, 18px +- Subtitle: "Software Engineer" — regular, 14px, muted +- Icon + Title: cùng dòng +- Subtitle: dòng dưới + +### Position + +- Desktop: góc dưới-right của `hero-visual` +- Mobile: góc dưới-right của hero section +- Margin: 20px từ cạnh + +--- + +## Responsive + +### Desktop (>768px) + +``` +┌──────────────────────────────────────┐ +│ Text Content │ Photo BG │ +│ (left 50%) │ (right 50%) │ +│ │ │ +│ │ [OTW] │ +└──────────────────────────────────────┘ +``` + +### Mobile (≤768px) + +``` +┌──────────────────────────────┐ +│ Photo BG (full) │ +│ ┌────────────────────────┐ │ +│ │ Text Content + Overlay │ │ +│ └────────────────────────┘ │ +│ [OTW] │ +└──────────────────────────────┘ +``` + +--- + +## Constraints + +- Không hard-code nội dung trong JSX — data-driven từ `profile.ts` +- Ảnh fallback: placeholder gray nếu thiếu asset +- Giảm motion: không animation khi scroll +- Accessibility: alt text cho ảnh, aria-label cho badge +- Không thay đổi layout text content bên trái diff --git a/docs/design/specs/v2/spec-v2-resume.md b/docs/design/specs/v2/spec-v2-resume.md index 07cfa1f..194bf6c 100644 --- a/docs/design/specs/v2/spec-v2-resume.md +++ b/docs/design/specs/v2/spec-v2-resume.md @@ -1,7 +1,7 @@ # Specification — v2 Resume Download > **Document:** `spec-v2-resume.md` -> **Version:** 0.3.0 +> **Version:** 0.4.0 > **Parent:** `spec-v2.md` > **Priority:** P1 > **Estimate:** ~15 minutes @@ -12,7 +12,7 @@ - Nút **"Download Resume"** hiển thị ở **2 vị trí**: 1. **Hero section** — CTA row (bên cạnh "View Projects" / "Contact Me") - 2. **Contact section** — trong `contact-links` grid + 2. **Contact section / Contact page** — riêng biệt, sau `contact-links` grid - Link trực tiếp đến file PDF (`/resume.pdf`) với attribute `download` - Khi chưa có PDF → ẩn hoàn toàn ở cả 2 vị trí - PDF upload vào `public/resume.pdf` @@ -22,60 +22,77 @@ ## Implementation +### DownloadResume Component + +```tsx +// src/components/sections/DownloadResume.tsx +import { resumeAvailable } from '@/data/resume' + +export function DownloadResume() { + if (!resumeAvailable) return null + return ( +
+ ) +} +``` + ### Hero Section (primary CTA) ```tsx // Hero.tsx +import { Button } from '@/components/ui/Button' import { resumeAvailable } from '@/data/resume' export function Hero() { return ( -
+