# Specification - v3 UI Enhancements firstName: "Dong", lastName: "Nguyen", name: "Dong Nguyen", > **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) | |---|---------|--------|---------| | 0 | Prerequisites: types + data | ✅ Done | `types/index.ts`, `data/profile.ts`, `SectionHeading.tsx`, `App.css` | | 1 | Section headers (numbered tags) | ✅ Done | `SectionHeading.tsx`, `App.css`, pages/sections | | 2 | Hero: greeting + animated dot | ✅ Done | `Hero.tsx`, `App.css` | | 3 | Hero: gradient name highlight | ✅ Done | `Hero.tsx`, `App.css` | | 4 | Hero: background grid | ✅ Done | `Hero.tsx`, `App.css` | | 5 | Hero: typewriter effect | ✅ Done | `Typewriter.tsx`, `Hero.tsx`, `App.css` | | 6 | Hero: floating particles | ✅ Done | `HeroParticles.tsx`, `Hero.tsx`, `App.css` | | 7 | Hero: scroll indicator | ✅ Done | `Hero.tsx`, `App.css` | | 8 | Button: gradient + outline + icon slide | ✅ Done | `Button.tsx`, `App.css` | | 9 | Scroll animations: AnimatedSection | ✅ Done | `AnimatedSection.tsx`, `AboutPage.tsx` | | 10 | Logo: bracket format | ✅ Done | `Navigation.tsx`, `App.css` | | 11 | Build + verify | ✅ Done | type-check + lint pass (build locked by dev server) | | 12 | Download resume: click outside to close | ✅ Done | `DownloadResume.tsx`, `Hero.tsx`, `App.css`, `hooks/useClickOutside.ts` | | 13 | Download resume: FontAwesome-style icon | ✅ Done | `DownloadResume.tsx`, `Hero.tsx` | | 14 | Mobile: hero section responsive fixes | ✅ Done | `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", ], } export interface Profile { name: string; firstName: string; lastName: string; title: string; titleEn?: string; tagline: string; taglineEn?: string; bio: string; bioEn?: string; email: string; githubUrl: string; linkedinUrl: string; resumeUrl?: string; currentInterests: string[]; roles: string[]; philosophy: PhilosophyPoint[]; } --- ## 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 (