diff --git a/docs/design/specs/v3/spec-v3-ui-enhancements.md b/docs/design/specs/v3/spec-v3-ui-enhancements.md new file mode 100644 index 0000000..ed59dde --- /dev/null +++ b/docs/design/specs/v3/spec-v3-ui-enhancements.md @@ -0,0 +1,1161 @@ +# Specification - v3 UI Enhancements + +> **Document:** `spec-v3-ui-enhancements.md` +> **Version:** 0.1.0 +> **Parent:** `spec-v2-homepage-enhancements.md` +> **Status:** Draft — not yet implemented + +--- + +## Overview + +Enhance the portfolio UI with visual effects inspired by modern developer portfolios. All features use existing dependencies (`motion`/`framer-motion`, CSS) — no new packages required. + +## Implementation Progress + +| # | Feature | Status | File(s) | +|---|---------|--------|---------| +| 1 | Section headers (numbered tags) | ⬜ Pending | `SectionHeading.tsx`, `index.css`, `data/*.ts` | +| 2 | Hero: greeting + animated dot | ⬜ Pending | `Hero.tsx`, `App.css` | +| 3 | Hero: gradient name highlight | ⬜ Pending | `Hero.tsx`, `App.css` | +| 4 | Hero: background grid | ⬜ Pending | `Hero.tsx`, `App.css` | +| 5 | Hero: typewriter effect | ⬜ Pending | `Typewriter.tsx`, `Hero.tsx`, `profile.ts`, `index.css` | +| 6 | Hero: floating particles | ⬜ Pending | `HeroParticles.tsx`, `Hero.tsx`, `index.css` | +| 7 | Hero: scroll indicator | ⬜ Pending | `Hero.tsx`, `App.css` | +| 8 | Button: gradient + outline + icon slide | ⬜ Pending | `App.css` | +| 9 | Social links: circular + glow | ⬜ Pending | `SocialLinks.tsx`, `Footer.tsx`, `App.css` | +| 10 | Scroll animations: AnimatedSection | ⬜ Pending | `AnimatedSection.tsx`, `About.tsx`, `Hero.tsx` | +| 11 | Custom cursor | ⬜ Pending | `CustomCursor.tsx`, `Layout.tsx`, `App.css` | +| 12 | Projects: overlay + gradients | ⬜ Pending | `Projects.tsx`, `App.css` | +| 13 | Footer: back to top | ⬜ Pending | `Footer.tsx`, `App.css` | +| 14 | Logo: bracket format | ⬜ Pending | `Navigation.tsx`, `App.css` | + +--- + +## Prerequisites (Type/Data Changes) + +Before implementing UI features, update types and data modules: + +### 1. Profile Type — Add `firstName`, `lastName`, `roles` + +**File:** `src/types/index.ts` + +```ts +export interface Profile { + name: string + firstName: string // NEW + lastName: string // NEW + title: string + titleEn?: string + tagline: string + taglineEn?: string + bio: string + bioEn?: string + email: string + githubUrl: string + linkedinUrl: string + resumeUrl?: string + currentInterests: string[] + philosophy: PhilosophyPoint[] +} +``` + +### 2. Profile Data — Fill `firstName`, `lastName`, `roles` + +**File:** `src/data/profile.ts` + +```ts +export const profile: Profile = { + name: "Dong Nguyen", + firstName: "Dong", // NEW + lastName: "Nguyen", // NEW + title: "Senior Software Engineer", + // ... existing fields unchanged + roles: [ // NEW + "Full-Stack Developer", + "System Architect", + "AI/ML Engineer", + "Open Source Contributor", + ], +} +``` + +### 3. SectionHeading Type — Add `tag` prop + +**File:** `src/components/ui/SectionHeading.tsx` + +```tsx +interface SectionHeadingProps { + title: string + subtitle?: string + tag?: string // NEW — e.g. "01 — About" + id?: string +} +``` + +--- + +## 1. Hero Section Enhancements + +### 1.1 Typewriter Effect + +**Effect:** Role titles cycle with typewriter animation (type → pause → delete → next). + +**Implementation:** +- New component: `src/components/ui/Typewriter.tsx` +- Uses `useState` + `useEffect` for character cycling +- Cursor blink via CSS `@keyframes` +- Configurable from `profile.roles` + +**Props:** +```tsx +interface TypewriterProps { + texts: string[] + typeSpeed?: number // ms per character (default 80) + deleteSpeed?: number // ms per character (default 40) + pauseDuration?: number // ms pause at end (default 2000) +} +``` + +**CSS — cursor blink:** +```css +.typewriter-cursor { + display: inline-block; + width: 2px; + height: 1.1em; + background: var(--accent); + margin-left: 2px; + vertical-align: text-bottom; + animation: blink 1s step-end infinite; +} +@keyframes blink { + 0%, 100% { opacity: 1; } + 50% { opacity: 0; } +} +``` + +**Files:** +- `src/components/ui/Typewriter.tsx` (new) +- `src/data/profile.ts` (add `roles`) +- `src/types/index.ts` (add `roles` to `Profile`) +- `src/index.css` (cursor blink animation) + +--- + +### 1.2 Greeting with Animated Dot + +**Effect:** "Hi, I'm" with a pulsing green dot before the name. + +**Implementation:** +- Add `` before hero name +- Green dot: `width: 10px; height: 10px; background: var(--success); border-radius: 50%;` +- Pulse animation: `box-shadow` expands from 0 to 8px and fades + +**CSS:** +```css +.hero-greeting { + display: flex; + align-items: center; + gap: 12px; + margin-bottom: 16px; + font-size: 1.1rem; + color: var(--text-secondary); +} +.greeting-dot { + width: 10px; + height: 10px; + background: var(--success); + border-radius: 50%; + animation: pulse-dot 2s ease-in-out infinite; +} +@keyframes pulse-dot { + 0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); } + 50% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); } +} +``` + +**Hero.tsx JSX:** +```tsx + + + + Hi, I'm + + +``` + +**Files:** +- `src/components/sections/Hero.tsx` +- `src/index.css` + +--- + +### 1.3 Background Grid Pattern + +**Effect:** Subtle grid overlay on hero background, faded at edges via radial mask. + +**Implementation:** +- Add `
` as first child of hero section (after `InView`) +- CSS grid pattern with `linear-gradient`, 60px spacing +- Mask: `radial-gradient(ellipse at center, black 30%, transparent 70%)` +- Color: `rgba(96, 165, 250, 0.03)` (uses `--accent`) + +**CSS:** +```css +.hero-bg-grid { + position: absolute; + inset: 0; + background-image: + linear-gradient(rgba(96, 165, 250, 0.03) 1px, transparent 1px), + linear-gradient(90deg, rgba(96, 165, 250, 0.03) 1px, transparent 1px); + background-size: 60px 60px; + mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%); + -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%); + pointer-events: none; +} +``` + +**Files:** +- `src/components/sections/Hero.tsx` +- `src/App.css` + +--- + +### 1.4 Floating Particles + +**Effect:** Small dots floating upward in the hero background (30 desktop, 15 mobile). + +**Implementation:** +- New component: `src/components/sections/HeroParticles.tsx` +- Creates `div.hero-particle` elements via `useMemo` (stable, no re-renders) +- Each particle has random: `left` position, `animationDuration` (8–18s), `animationDelay` (0–10s), `width` (2–5px) +- Animation: `float-particle` keyframes (translateY 100vh → -100px, scale 0 → 1) +- Color: `var(--accent)` + +**CSS:** +```css +.hero-particles { + position: absolute; + inset: 0; + overflow: hidden; + pointer-events: none; +} +.hero-particle { + position: absolute; + width: 4px; + height: 4px; + background: var(--accent); + border-radius: 50%; + opacity: 0.3; + animation: float-particle linear infinite; +} +@keyframes float-particle { + 0% { transform: translateY(100vh) scale(0); opacity: 0; } + 10% { opacity: 0.3; } + 90% { opacity: 0.3; } + 100% { transform: translateY(-100px) scale(1); opacity: 0; } +} +``` + +**HeroParticles.tsx:** +```tsx +export function HeroParticles() { + const count = typeof window !== 'undefined' && window.innerWidth < 768 ? 15 : 30 + const particles = useMemo(() => + Array.from({ length: count }, (_, i) => ({ + id: i, + left: `${Math.random() * 100}%`, + duration: `${Math.random() * 10 + 8}s`, + delay: `${Math.random() * 10}s`, + size: `${Math.random() * 3 + 2}px`, + })), + [count] + ) + + return ( +