From dd22f3be3ad1fd86b98b125b397b7dafe6caa79a Mon Sep 17 00:00:00 2001 From: "dong.nguyen" Date: Tue, 13 Oct 2026 00:24:12 +0700 Subject: [PATCH] feat(ui): v3 enhancements - hero photo, particles, mobile responsive - Hero photo: circular shape, object-position center top, transparent background - Hero particles: bigger (6-16px), more visible (opacity 0.8) - Mobile: hide hero photo, transparent hero content, fix text/social link colors - Mobile social links: darker border in light mode - Update spec docs and all section components for v3 UI --- .../specs/v3/spec-v3-ui-enhancements.md | 632 +++++++----------- src/App.css | 262 +++++++- src/components/layout/Footer.tsx | 3 - src/components/layout/Navigation.tsx | 4 +- src/components/sections/About.tsx | 2 +- src/components/sections/Contact.tsx | 2 +- src/components/sections/DownloadResume.tsx | 48 +- src/components/sections/Experience.tsx | 12 +- src/components/sections/Expertise.tsx | 2 +- src/components/sections/Hero.tsx | 75 ++- src/components/sections/HeroParticles.tsx | 34 + src/components/sections/Projects.tsx | 72 +- src/components/ui/AnimatedSection.tsx | 37 + src/components/ui/Button.tsx | 17 +- src/components/ui/SectionHeading.tsx | 4 +- src/components/ui/SocialLinks.tsx | 1 - src/components/ui/Typewriter.tsx | 51 ++ src/data/profile.ts | 8 + src/hooks/useClickOutside.ts | 17 + src/index.css | 5 +- src/pages/AboutPage.tsx | 6 + src/pages/ContactPage.tsx | 5 +- src/pages/EngineeringPage.tsx | 5 +- src/pages/ExperiencePage.tsx | 5 +- src/pages/ProjectsListPage.tsx | 2 + src/types/index.ts | 3 + 26 files changed, 810 insertions(+), 504 deletions(-) create mode 100644 src/components/sections/HeroParticles.tsx create mode 100644 src/components/ui/AnimatedSection.tsx create mode 100644 src/components/ui/Typewriter.tsx create mode 100644 src/hooks/useClickOutside.ts diff --git a/docs/design/specs/v3/spec-v3-ui-enhancements.md b/docs/design/specs/v3/spec-v3-ui-enhancements.md index ed59dde..6a57f8c 100644 --- a/docs/design/specs/v3/spec-v3-ui-enhancements.md +++ b/docs/design/specs/v3/spec-v3-ui-enhancements.md @@ -1,7 +1,8 @@ # Specification - v3 UI Enhancements -> **Document:** `spec-v3-ui-enhancements.md` -> **Version:** 0.1.0 + firstName: "Dong", + lastName: "Nguyen", + name: "Dong Nguyen", > **Parent:** `spec-v2-homepage-enhancements.md` > **Status:** Draft — not yet implemented @@ -15,21 +16,21 @@ Enhance the portfolio UI with visual effects inspired by modern developer portfo | # | 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` | - +| 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) @@ -78,20 +79,24 @@ export const profile: Profile = { "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 +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[]; } -``` --- @@ -549,14 +554,14 @@ export function SectionHeading({ title, subtitle, tag, id }: SectionHeadingProps ``` **Usage per section:** -| Section | Tag | Component | -|---------|-----|-----------| -| About | `"01 — About"` | `AboutPage.tsx` | -| Expertise | `"02 — Expertise"` | `Expertise.tsx` | -| Experience | `"03 — Experience"` | `ExperiencePage.tsx` | -| Projects | `"04 — Projects"` | `ProjectsListPage.tsx` | -| Engineering | `"05 — Engineering"` | `EngineeringPage.tsx` | -| Contact | `"06 — Contact"` | `ContactPage.tsx` | +| Section | Tag | Component | Current Pattern | Change | +|---------|-----|-----------|----------------|--------| +| About | `"01 — About"` | `AboutPage.tsx`, `About.tsx` | `SectionHeading` | Add `tag` prop | +| Expertise | `"02 — Expertise"` | `Expertise.tsx`, AboutPage.tsx | `SectionHeading` | Add `tag` prop | +| Experience | `"03 — Experience"` | `ExperiencePage.tsx`, `Experience.tsx` | `

` inline | Replace with `SectionHeading` | +| Projects | `"04 — Projects"` | `ProjectsListPage.tsx`, `Projects.tsx` | No heading / `

` inline | Add `SectionHeading` | +| Engineering | `"05 — Engineering"` | `EngineeringPage.tsx` | `

` inline | Replace with `SectionHeading` | +| Contact | `"06 — Contact"` | `ContactPage.tsx`, `Contact.tsx` | `SectionHeading` | Add `tag` prop | **CSS:** ```css @@ -572,73 +577,26 @@ export function SectionHeading({ title, subtitle, tag, id }: SectionHeadingProps ``` **Files:** -- `src/components/ui/SectionHeading.tsx` -- `src/App.css` -- `src/pages/AboutPage.tsx` (add tag) -- `src/components/sections/Expertise.tsx` (add tag) -- `src/pages/ExperiencePage.tsx` (add tag) -- `src/pages/ProjectsListPage.tsx` (add tag) -- `src/pages/EngineeringPage.tsx` (add tag) -- `src/pages/ContactPage.tsx` (add tag) +- `src/components/ui/SectionHeading.tsx` (add `tag` prop) +- `src/App.css` (add `.section-tag` styles) +- `src/pages/AboutPage.tsx` (add `tag` to 2x `SectionHeading`) +- `src/components/sections/About.tsx` (add `tag` to `SectionHeading`) +- `src/components/sections/Expertise.tsx` (add `tag` to `SectionHeading`) +- `src/pages/ExperiencePage.tsx` (replace `

` with `SectionHeading`) +- `src/components/sections/Experience.tsx` (replace `

` with `SectionHeading`) +- `src/pages/ProjectsListPage.tsx` (add `SectionHeading` before grid) +- `src/components/sections/Projects.tsx` (replace `

` with `SectionHeading`) +- `src/pages/EngineeringPage.tsx` (replace `

` with `SectionHeading`) +- `src/pages/ContactPage.tsx` (add `tag` to `SectionHeading`) +- `src/components/sections/Contact.tsx` (add `tag` to `SectionHeading`) --- -## 4. Social Links - -### 4.1 Circular Social Links - -**Effect:** Social icons become circular with border, glow on hover. - -**Implementation:** -- Update `.social-link` in both `SocialLinks.tsx` and `Footer.tsx`: - - Width/height: `48px` - - Border: `1.5px solid rgba(255, 255, 255, 0.15)` - - Border radius: `50%` - - Remove `` label text (icons only) - - Hover: `border-color: var(--accent)`, `color: var(--accent)`, `transform: translateY(-3px)`, `box-shadow: 0 0 30px rgba(96, 165, 250, 0.15)` - -**CSS:** -```css -.social-link { - display: flex; - align-items: center; - justify-content: center; - width: 48px; - height: 48px; - border: 1.5px solid rgba(255, 255, 255, 0.15); - border-radius: 50%; - color: var(--text-secondary); - transition: color var(--transition-fast), border-color var(--transition-fast), - transform var(--transition-fast), box-shadow var(--transition-fast); -} -.social-link:hover { - border-color: var(--accent); - color: var(--accent); - transform: translateY(-3px); - box-shadow: 0 0 30px rgba(96, 165, 250, 0.15); -} -.social-link svg { - width: 20px; - height: 20px; -} -/* Hide label text */ -.social-link span { - display: none; -} -``` - -**SocialLinks.tsx changes:** Remove `{link.label}` from JSX. - -**Files:** -- `src/components/ui/SocialLinks.tsx` -- `src/components/layout/Footer.tsx` -- `src/App.css` - --- -## 5. Scroll Animations +## 4. Scroll Animations -### 5.1 Unified Animation Wrapper +### 4.1 Unified Animation Wrapper **Effect:** Sections animate in on scroll with configurable direction and delay. @@ -722,258 +680,11 @@ export function AnimatedSection({ --- -## 6. Custom Cursor (Desktop Only) -### 6.1 Dot + Follower Cursor -**Effect:** Small dot follows mouse exactly; larger circle follows with lag. Both expand on hover over interactive elements. Disabled on mobile. +## 5. Footer Enhancements -**Implementation:** -- New component: `src/components/ui/CustomCursor.tsx` -- Two `div` elements: `.cursor` (8px dot) and `.cursor-follower` (40px circle) -- Mouse move listener updates dot position immediately -- `requestAnimationFrame` loop interpolates follower position (lerp factor 0.1) -- Hover detection on `a, button, .project-card, .skill-tag, .filter-btn, .social-link` -- Active state: scale dot to 3x, reduce follower opacity to 0.5 -- `mix-blend-mode: difference` for dot -- Hidden on `≤768px` via CSS media query -- Rendered once in `Layout.tsx` (NOT in App.tsx — ensures single instance across routes) - -**CSS:** -```css -.cursor { - width: 8px; - height: 8px; - background: var(--accent); - border-radius: 50%; - position: fixed; - pointer-events: none; - z-index: 10000; - transition: transform 0.1s ease, opacity 0.1s ease; - mix-blend-mode: difference; -} -.cursor-follower { - width: 40px; - height: 40px; - border: 1.5px solid var(--accent); - border-radius: 50%; - position: fixed; - pointer-events: none; - z-index: 10000; - transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease, height 0.3s ease; - transform: translate(-50%, -50%); -} -.cursor.active { - transform: scale(3); - opacity: 0.5; -} -.cursor-follower.active { - width: 60px; - height: 60px; - opacity: 0.5; -} -@media (max-width: 768px) { - .cursor, .cursor-follower { display: none !important; } -} -``` - -**CustomCursor.tsx:** -```tsx -import { useEffect, useRef } from 'react' - -export function CustomCursor() { - const cursorRef = useRef(null) - const followerRef = useRef(null) - const mouseX = useRef(0) - const mouseY = useRef(0) - const followerX = useRef(0) - const followerY = useRef(0) - const rafId = useRef(0) - - useEffect(() => { - if (typeof window === 'undefined' || window.innerWidth <= 768) return - - const handleMouseMove = (e: MouseEvent) => { - mouseX.current = e.clientX - mouseY.current = e.clientY - if (cursorRef.current) { - cursorRef.current.style.left = e.clientX + 'px' - cursorRef.current.style.top = e.clientY + 'px' - } - } - - const animate = () => { - followerX.current += (mouseX.current - followerX.current) * 0.1 - followerY.current += (mouseY.current - followerY.current) * 0.1 - if (followerRef.current) { - followerRef.current.style.left = followerX.current + 'px' - followerRef.current.style.top = followerY.current + 'px' - } - rafId.current = requestAnimationFrame(animate) - } - - const interactiveSelectors = 'a, button, .project-card, .skill-tag, .filter-btn, .social-link' - const handleMouseEnter = () => { - cursorRef.current?.classList.add('active') - followerRef.current?.classList.add('active') - } - const handleMouseLeave = () => { - cursorRef.current?.classList.remove('active') - followerRef.current?.classList.remove('active') - } - - document.addEventListener('mousemove', handleMouseMove) - rafId.current = requestAnimationFrame(animate) - document.addEventListener('mouseenter', handleMouseEnter, true) - document.addEventListener('mouseleave', handleMouseLeave, true) - - return () => { - cancelAnimationFrame(rafId.current) - document.removeEventListener('mousemove', handleMouseMove) - document.removeEventListener('mouseenter', handleMouseEnter, true) - document.removeEventListener('mouseleave', handleMouseLeave, true) - } - }, []) - - return ( - <> -