Documentation Index
Fetch the complete documentation index at: https://mintlify.com/blairxu13/persona3-website/llms.txt
Use this file to discover all available pages before exploring further.
PageTransition is a Framer Motion wrapper component that intercepts React Router v7 route changes and plays a themed overlay animation before revealing the incoming page. It wraps AnimatePresence with mode="wait" so the outgoing page fully unmounts before the new one mounts, preventing two pages from rendering simultaneously during a transition. Four built-in overlay variants — default, about, resume, and socials — each express a distinct visual language tied to the page they introduce, from sweeping diagonal panels to cascading vertical stripes.
Props
The page content to render inside the transition wrapper. This content fades in after the overlay animation completes, using a short
opacity tween delayed by 0.18 s.Selects which overlay animation plays when the route changes. Each variant uses a different set of coloured panels, directions, and easing curves. Defaults to
"default" if omitted.Usage
Wrap each page component inPageTransition at the route level, passing the variant that matches the page being rendered:
PageTransition inside a route element so that useLocation — which PageTransition calls internally — is within the router context. The location.pathname is used as the key on the outermost motion.div, which is what signals AnimatePresence to run exit and enter animations on every navigation.
Variants
Each variant is implemented as a separate inner component that renders a small set ofmotion.div elements — coloured panels positioned with position: fixed — which animate in and out to form the transition effect.
- Default
- About
- Resume
The default transition sweeps three full-screen panels (Visual effect: Three stacked full-screen layers wipe in from the left edge and retract in the same direction, revealing the new page beneath. The 50 ms stagger between layers creates a layered depth effect.
#0d1a3a, #1a6aff, #7dd4fc) across the viewport from left to right using scaleX. Each panel originates from the left edge (originX: 0) and plays a four-keyframe sequence: collapsed → full → full → collapsed.Children Fade
Regardless of which overlay variant is active, the page content (children) is always wrapped in a motion.div that performs a simple opacity tween:
exit opacity tween fires when the route changes and AnimatePresence signals the current page to leave.
Adding a New Variant
Follow these steps to create a custom transition for a new page, such as a"contact" page.
Write a transition component
Create a new inner component in
PageTransition.jsx that returns one or more motion.div elements. Model it on the existing variants, using position: fixed and high zIndex values so the panels cover the page:Register the variant in TransitionOverlay
Add a new conditional branch inside the
TransitionOverlay function so the router knows when to use your component:AnimatePresence must be configured with mode="wait" in the component that wraps your routes (typically App.jsx) for transitions to work correctly. Without mode="wait", the incoming and outgoing pages mount simultaneously, causing overlay panels from both transitions to render on top of each other. The PageTransition component itself already uses mode="wait" internally, but the outer application shell must not introduce a second AnimatePresence without the same setting.Page Transitions Concept
Conceptual overview of how AnimatePresence and location keys drive the transition system.
Animation System
Full reference for the Framer Motion patterns used across the portfolio.