TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/player-one/llms.txt
Use this file to discover all available pages before exploring further.
PageTransition component is a thin Framer Motion wrapper that gives every page in the app a polished enter and exit animation. When a route changes, the outgoing page scales up slightly and blurs out while the incoming page fades in from a slightly reduced scale through a blur, creating a soft, cinematic transition that complements the arcade aesthetic without feeling sluggish. It also applies the standard page-level layout classes — max-width, padding, and minimum height — so individual page components don’t need to repeat that boilerplate.
Props
The page content to render inside the transition wrapper. Typically the full JSX tree of a route-level component.
Usage
For exit animations to fire correctly,
PageTransition must be used inside a Framer Motion AnimatePresence component that is keyed by the current route. Typically this lives in the router outlet or App.jsx.Animation Specification
The transition is defined by three Framer Motion states:| State | opacity | scale | filter |
|---|---|---|---|
initial (before enter) | 0 | 0.95 | blur(10px) |
animate (visible) | 1 | 1 | blur(0px) |
exit (before unmount) | 0 | 1.05 | blur(10px) |
easeOut curve means the motion decelerates as it settles, giving a satisfying “snap into place” feel.
Exit: The page expands fractionally (scale 1.05) and blurs simultaneously, implying the outgoing content is receding or dissolving — a cinematic wipe-out without hard cuts.
Duration: 0.4 seconds total. Fast enough to not impede navigation but long enough to register as a deliberate transition.
Layout Classes
Beyond the animation,PageTransition applies a fixed set of Tailwind classes to the motion.div that establish the standard page canvas:
| Class | Purpose |
|---|---|
min-h-screen | Ensures the page fills the full viewport height even with sparse content |
w-full | Full available width inside the max-width container |
relative | Establishes a positioning context for absolutely-placed children (e.g., GhostSprite) |
z-10 | Sits above background layers (z-0 ghosts) but below the HUD (z-50) and Navigation modal (z-[100]) |
pt-24 | Clears the fixed HUD at the top of the viewport |
pb-32 | Clears the fixed Navigation button at the bottom of the viewport |
px-4 md:px-8 | Responsive horizontal gutters |
max-w-7xl mx-auto | Centers content with a maximum width of 80 rem |
Full Implementation
Where It’s Used
Every route-level page component in the app wraps its top-level return inPageTransition. This ensures consistent enter/exit behavior across all seven routes without duplicating animation logic or layout boilerplate in each page file.