TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/space-mission/llms.txt
Use this file to discover all available pages before exploring further.
PageTransition component is a thin but essential wrapper that gives every page in Space Mission a consistent animated entrance and exit. It takes a single children prop and places its contents inside a Framer Motion motion.div configured with enter and exit variants — including a blur effect that gives the transition a cinematic, defocused quality. All the transition logic lives in one place, so changing the animation once updates every page simultaneously.
What It Does
PageTransition wraps children in a motion.div with three animation states:
| State | opacity | scale | filter |
|---|---|---|---|
initial (entering, before mount) | 0 | 0.95 | blur(10px) |
animate (on screen) | 1 | 1 | blur(0px) |
exit (leaving) | 0 | 1.05 | blur(10px) |
motion.div also applies layout classes so it fills the full viewport height and sits above the Starfield background:
pt-24 top padding ensures page content clears the fixed Navigation bar.
Animation Values
The transition uses a custom cubic-bezier easing curve that produces a natural deceleration — quick at the start, easing gently to rest:The actual source uses
scale: 0.95 on enter and scale: 1.05 on exit — a subtle zoom-in / zoom-out pair that makes the old page feel like it is receding into the background while the new page expands forward.AnimatePresence and the Router
PageTransition on its own only defines the animation; it is AnimatePresence in the router that tells Framer Motion when to run the exit animation. Without AnimatePresence, leaving components are unmounted immediately and the exit variant never fires.
The router wraps the route outlet in <AnimatePresence mode='wait'>, which ensures the exiting page fully finishes its exit animation before the entering page starts its enter animation — preventing both pages from being visible at the same time:
key={location.pathname} prop is what triggers AnimatePresence to detect a route change — without it, React would reuse the existing component tree and no transition would play.
Usage
Every page component wraps its top-level content inPageTransition:
Customizing the Transition
Duration. Change theduration value (in seconds). The current 0.6 is a good balance between snappy and cinematic; values above 1.0 can feel sluggish during quick navigation.
y offset (similar to a classic fade-up):
filter to 'blur(0px)' in all three states, or omit the filter key entirely:
Removing
PageTransition from a page — or forgetting to wrap a new page — will cause that route to appear and disappear instantly without any animation, which creates a jarring visual discontinuity next to the other pages that do animate. Always wrap new pages in <PageTransition>.