···6363- Preconnect links for external resources
64646565When making changes, ensure you maintain the existing patterns for component structure, TypeScript typing, and Tailwind styling conventions.
6666+6767+## View Transitions
6868+6969+This project uses the **View Transitions API** to provide smooth, animated transitions between pages.
7070+7171+### Implementation
7272+7373+- **Library**: `next-view-transitions` (v0.3.4+)
7474+- **Setup**: Root layout wrapped with `<ViewTransitions>` component
7575+- **Router**: All navigation uses `useTransitionRouter()` from `next-view-transitions`
7676+- **Internal Links**: Use `Link` from `next-view-transitions` instead of `next/link`
7777+7878+### Transition Types
7979+8080+The site implements several types of transitions:
8181+8282+1. **Page Transitions** - Smooth crossfade (300ms) when navigating between pages
8383+2. **Shared Elements** - Specific elements transition smoothly across pages:
8484+ - `page-title` - The animated page title (400ms)
8585+ - `main-navigation` - The navigation menu (350ms)
8686+ - `profile-image` - Profile picture on home page (500ms)
8787+ - `footer` - Footer element (200ms)
8888+8989+### CSS Configuration
9090+9191+View transition styles are defined in `/src/styles/globals.css`:
9292+9393+- Default page transition uses fade-in/fade-out animations
9494+- Shared element transitions have custom durations
9595+- All animations use browser-native View Transitions API
9696+9797+### Browser Support
9898+9999+- ✅ **Chrome/Edge 111+**: Full support
100100+- ✅ **Safari 18+**: Full support
101101+- ⚠️ **Firefox**: Pending (graceful degradation to instant navigation)
102102+- **Fallback**: Pages navigate normally without transitions in unsupported browsers
103103+104104+### Adding Transitions to New Elements
105105+106106+To add a view transition to a new element:
107107+108108+1. Add `viewTransitionName: "your-element-name"` to the element's style object
109109+2. Define transition styles in `globals.css`:
110110+ ```css
111111+ ::view-transition-old(your-element-name),
112112+ ::view-transition-new(your-element-name) {
113113+ animation-duration: 0.4s;
114114+ }
115115+ ```
116116+117117+### Important Notes
118118+119119+- View transitions only work for **internal navigation** (same-origin)
120120+- External links bypass view transitions automatically
121121+- Transitions are purely visual and don't affect page load performance