- Framer-motion aus Layout, NavLink, ContactInfo, LanguageSwitcher entfernt - PageTransition komplett vereinfacht (keine 1200ms Verzögerung mehr) - FloatingPaths wird erst nach 2s lazy geladen - Framer-motion und lucide-react in separate Chunks getrennt - Icons-Chunk: 10.87KB (statt 126KB ui-vendor) - Animations-Chunk wird erst bei Bedarf geladen Einsparung: ~115KB beim Initial Load 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
26 lines
750 B
TypeScript
26 lines
750 B
TypeScript
"use client"
|
|
import React, { useEffect, useRef } from "react"
|
|
import { useLocation } from "react-router-dom"
|
|
|
|
interface PageTransitionProps {
|
|
children: React.ReactNode
|
|
}
|
|
|
|
// Simplified page transition - no loading delay for better LCP
|
|
const PageTransition = ({ children }: PageTransitionProps) => {
|
|
const location = useLocation()
|
|
const previousPathRef = useRef<string | null>(null)
|
|
|
|
useEffect(() => {
|
|
// Only scroll on path change, not on initial mount
|
|
if (previousPathRef.current && location.pathname !== previousPathRef.current) {
|
|
window.scrollTo(0, 0)
|
|
}
|
|
previousPathRef.current = location.pathname
|
|
}, [location.pathname])
|
|
|
|
return <>{children}</>
|
|
}
|
|
|
|
export default PageTransition
|