TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/nightshade/llms.txt
Use this file to discover all available pages before exploring further.
Layout component is the outermost shell of every page in Nightshade. It composes all ambient UI layers — the custom cursor, animated smoke background, and fixed navigation bar — around an animated content area, ensuring every route transition plays the same brightness-fade animation and every page inherits the dark witch aesthetic.
Component signature
Layout accepts a single children prop and renders it inside a motion.main wrapper. Route changes are detected automatically through React Router’s useLocation hook.
components/Layout.js
Internal structure
Layout orchestrates four distinct layers, rendered in stacking order:FamiliarCursor
Replaces the browser cursor with a spring-physics witch SVG. Renders at
z-[99]–z-[100], above everything else.SmokeLayer
Fixed full-screen animated background blobs at
z-0. Provides the shifting atmospheric color behind all page content.Navigation
Fixed top bar with sigil icons for each route. Sits above the smoke layer and below the cursor.
motion.main
The animated content wrapper at
z-10. Receives children and plays the brightness-fade transition on every route change.div at z-40 — sits above the content area but below the cursor, darkening screen edges on every page.
Page transition
When the active route changes, Framer Motion’sAnimatePresence unmounts the outgoing page and mounts the incoming one. The key={location.pathname} prop on motion.main is the mechanism that makes this work: it signals to Framer Motion that the element should be treated as a completely new component mount whenever the path changes.
| Phase | opacity | filter |
|---|---|---|
| Enter (initial) | 0 | brightness(0.5) |
| Active (animate) | 1 | brightness(1) |
| Exit | 0 | brightness(0) |
0.8s with an easeInOut curve. Pages appear to warm up from half-brightness rather than simply fading in from black, reinforcing the candlelit atmosphere.
key={location.pathname} on motion.main is critical. Without it, Framer Motion would not register a route change as a component remount, and the enter/exit animations would never fire.Vignette overlay
The vignette is afixed inset-0 div with pointer-events-none and a box-shadow using the CSS inset keyword:
z-40 — above page content and the smoke layer, but below the cursor at z-[99].
Layout classes
| Class | Purpose |
|---|---|
pt-32 | Offsets content below the fixed navigation bar |
pb-16 px-6 | Vertical and horizontal breathing room |
max-w-6xl mx-auto | Centers the content column and caps its width |
min-h-screen flex flex-col | Ensures short pages still fill the viewport |
Usage
Every page component in Nightshade is automatically wrapped by Layout through the route configuration. There is no need to import or applyLayout manually inside a page file.