Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/dev-haunt/llms.txt
Use this file to discover all available pages before exploring further.
Layout is DevHaunt’s root page wrapper. Every route is rendered inside it, giving the entire site a consistent spooky atmosphere: the cursor trail glows pumpkin orange, bats drift across the background, fog creeps along the bottom of the viewport, and the top navigation stays pinned. On top of that, Layout manages Framer Motion’s AnimatePresence so each page dissolves smoothly in and out with a blur transition whenever the route changes.
Component signature
Layout accepts a single prop — children — and has no configuration surface of its own. All ambient effects are mounted unconditionally; their individual components control their own behaviour.
JSX structure
Page transitions
Each route change triggers a full blur-dissolve cycle:| Phase | opacity | filter | Duration |
|---|---|---|---|
Enter (initial) | 0 | blur(10px) | — |
Visible (animate) | 1 | blur(0px) | 0.8 s |
Exit (exit) | 0 | blur(10px) | 0.8 s |
easeInOut timing curve makes the blur feel like the page is materialising out of the fog, and the matching exit keeps the transition symmetrical.
Why key={location.pathname}?
AnimatePresence detects when a child is replaced by watching its React key. By passing location.pathname as the key on motion.main, a new <motion.main> is mounted for every route change — which tells AnimatePresence to play the exit animation on the outgoing page before mounting the incoming one. Without this key the blur transition would not fire on navigation.
mode="wait" on AnimatePresence ensures the exiting page fully completes its animation before the entering page begins. Remove it only if you want both pages to animate simultaneously.Usage
Wrap your route tree inLayout inside your application’s root so every page inherits the ambient effects and page transitions automatically.
Z-index layering
The ambient effects use carefully stagedz-index values so they never compete with interactive page content:
| Layer | Component | z-index |
|---|---|---|
Page content (motion.main) | (your routes) | 10 |
| Bat swarm | BatSwarm | 30 |
| Fog overlay | FogLayer | 40 |
| Navigation bar | Navigation | 50 |
| Cursor trail | CursorTrail | 50 |