Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/spooky/llms.txt
Use this file to discover all available pages before exploring further.
Layout is the root wrapper that every page in Spooky renders through. Rather than repeating the setup of atmospheric components on each individual page, all shared chrome is declared once in Layout and applied universally. It is responsible for mounting the candle cursor, the navigation menu, the jump-scare toggle, all decorative elements, and the animated route transition that plays on every page change.
The
overflow-hidden class on the root div clips cobweb corner decorations and other absolutely-positioned elements to the viewport bounds. This intentionally prevents horizontal scroll caused by decorations that extend beyond the page edges.What Layout renders
Based oncomponents/Layout.js, the component renders the following tree:
bg-[#1a1a1d]sets the deep charcoal background that all pages share.text-[#f5f5f5]establishes ghost white as the default text color.<CandleCursor />replaces the system cursor with an animated candle flame.<Navigation />renders the hamburger button and slide-in drawer menu.<JumpScareToggle />renders the fixed bottom-right button for enabling or disabling the spider animation.<AnimatePresence mode="wait">ensures the exit animation of the leaving page fully completes before the entering page’s animation begins.<motion.main>wraps the active route content and carries the fade-to-black transition. It useslocation.pathnameas its React key, so every route change produces a new element and triggers a fresh animation cycle.<O />is the React Router outlet that renders the matched route component.
Page transition
The transition produces a fade-to-black effect between every route change:Layout reads the current URL with React Router’s useLocation() and passes location.pathname as the key prop on motion.main. Whenever the pathname changes, React unmounts the old motion.main (triggering the exit animation) and mounts a new one (triggering the initial → animate sequence).
Customizing the transition
To change the transition style, modify theinitial, animate, exit, and transition props on motion.main. For example, to use a slide-up instead of a fade:
motion.main with a plain <main> element and remove the <AnimatePresence> wrapper.
Adding a new decoration
All shared decorations follow the same pattern: import the component at the top ofLayout.js, then add it as a direct child <Component /> inside the root div, alongside the existing atmospheric elements. Because the root div uses relative overflow-hidden, any fixed or absolutely positioned decoration will be clipped to the viewport automatically.