Skip to main content

Documentation 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.

Every moving element in Space Mission is powered by Framer Motion. Rather than mixing CSS @keyframes, transition properties, and a separate JS animation library, the project commits to a single animation backbone. This gives a consistent API across page transitions, scroll-driven parallax, spring-physics layout animations, and viewport entrance effects.

Animation Patterns

The <PageTransition> Wrapper

Every page component returns its content inside a <PageTransition> component. This component is a single motion.div that defines initial, animate, and exit states for the entire page surface:
// components/PageTransition.js
import { motion } from "framer-motion";

const PageTransition = ({ children }) => (
  <motion.div
    initial={{ opacity: 0, scale: 0.95, filter: "blur(10px)" }}
    animate={{ opacity: 1, scale: 1,    filter: "blur(0px)"  }}
    exit={{    opacity: 0, scale: 1.05, filter: "blur(10px)" }}
    transition={{ duration: 0.6, ease: [0.22, 1, 0.36, 1] }}
    className="min-h-screen pt-24 pb-12 px-4 md:px-8 relative z-10"
  >
    {children}
  </motion.div>
);
The cubic-bezier [0.22, 1, 0.36, 1] is an “ease-out expo” curve — pages accelerate in and decelerate sharply, giving a snappy feel consistent with the HUD aesthetic.

AnimatePresence mode="wait" in the Router

Page transitions only work because AnimatePresence wraps the <Routes> block with mode="wait". This setting tells Framer Motion to finish the exit animation before starting the entrance animation, preventing two pages from being visible simultaneously:
const location = useLocation();

return (
  <AnimatePresence mode="wait">
    <Routes location={location} key={location.pathname}>
      <Route path="/"       element={<Home />} />
      <Route path="/about"  element={<About />} />
      {/* ...other routes... */}
    </Routes>
  </AnimatePresence>
);
The key={location.pathname} is essential — it forces React to unmount the old page component tree and mount a new one on each navigation, which fires exit on the old tree and initial → animate on the new one.

Build docs developers (and LLMs) love