Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/aurora-drift/llms.txt
Use this file to discover all available pages before exploring further.
PageTransition is a lightweight wrapper component that animates page content in and out whenever React Router changes routes. It uses a Framer Motion motion.div to simultaneously fade, slide, and blur each page — entering from below with a blur dissolve and exiting upward with the same blur. The combined effect produces a cinematic depth-of-field quality that fits the space-portfolio aesthetic of Aurora Drift without requiring any per-page configuration. Wrap every page component with PageTransition and pair it with Framer Motion’s AnimatePresence in your router to enable the effect.
Usage
1 — Wrap each page
2 — Add AnimatePresence to the router
AnimatePresence must be able to observe the unmounting of the outgoing page, so it must sit above the route switch and receive the current location.key as its key-tracking signal.
Props
The page content to animate.
PageTransition renders it inside a motion.div that applies the layout classes w-full h-full pt-24 pb-12 px-6 md:px-12 max-w-7xl mx-auto. This centres and constrains the content automatically, so individual pages do not need their own container wrapper.Animation states
The following values are applied directly to the Framer Motionmotion.div as initial, animate, and exit props.
| State | opacity | y | filter |
|---|---|---|---|
initial | 0 | 20 | blur(10px) |
animate | 1 | 0 | blur(0px) |
exit | 0 | -20 | blur(10px) |
Transition configuration
| Parameter | Value | Notes |
|---|---|---|
duration | 0.6 s | Total time for enter or exit animation |
ease | [0.22, 1, 0.36, 1] | Custom cubic-bézier — fast start, smooth deceleration |
Layout classes
PageTransition applies fixed layout classes to every page it wraps. This means individual page components do not need their own outer container:
| Class | Effect |
|---|---|
w-full h-full | Fills the router outlet |
pt-24 | 96 px top padding — clears the fixed Nav bar |
pb-12 | 48 px bottom padding |
px-6 md:px-12 | 24 px / 48 px horizontal padding at sm / md+ |
max-w-7xl mx-auto | Caps content width at 80 rem and centres it |
How it works
AnimatePresence detects route change
When React Router unmounts the current page (because the URL changed), Framer Motion’s
AnimatePresence intercepts the unmount and runs the exit animation before the DOM node is removed.Exit animation plays
The outgoing
motion.div transitions from { opacity: 1, y: 0, filter: 'blur(0px)' } to { opacity: 0, y: -20, filter: 'blur(10px)' } over 0.6 s using the custom cubic-bézier.New page mounts
With
mode="wait", AnimatePresence waits for the exit to finish before mounting the new page component.