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.
HauntedHouse is the centerpiece of the DevHaunt landing page — a fully self-contained SVG illustration that combines Framer Motion animations with a scroll-driven door mechanism. It accepts no props and manages all of its own state internally, making it a true drop-in component.
How It Works
The component registers ascroll event listener via useEffect that writes window.scrollY into a useState variable. Every scroll event recalculates the door rotation angle and re-renders the panel accordingly. Because no external data is needed, the component is completely portable.
Scroll-Reactive Door
As the user scrolls down, the front door swings open using a CSS 3D perspective transform applied inline to a<g> element whose transformOrigin is anchored at the left edge of the door frame (175px 320px).
0.5 means the door reaches its maximum 45° opening after the user has scrolled 90 pixels. Adjust that multiplier in HauntedHouse.js to change how quickly the door responds.
The door animation is purely CSS-transform-based and does not use Framer Motion, so it updates on every scroll event without any spring physics or interpolation. This keeps it snappy and frame-accurate.
Framer Motion Animated Elements
Four elements inside the SVG are animated with Framer Motion on infinite loops:| Element | Animation | Duration |
|---|---|---|
| Moon | Floats vertically y: [0, -10, 0] with easeInOut | 10 s |
| Cloud | Drifts horizontally x: [-100, 300] with linear | 25 s |
| Ghost in window | Bobs vertically y: [10, 0, 10] with easeInOut | 4 s |
| Sign above door | Sways with CSS animate-sway class | CSS keyframe |
animate-flicker (defined in main.css) with staggered animationDelay values of 0s, 1s, and 2s so each window appears to flicker independently.
SVG Structure
The SVG uses aviewBox="0 0 400 400" coordinate space. Below is a breakdown of the main shapes:
| Shape | Element | Fill | Description |
|---|---|---|---|
| Main house body | <path> polygon | #1a252c | Central five-point house silhouette |
| Roof | <path> triangle | #0d151a | Dark peaked roof above the body |
| Right tower | <path> rectangle | #1a252c | Narrow vertical tower on the right side of the main body |
| Annex (left) | <path> rectangle | #151e24 | Low left-side annex body |
| Annex roof | <path> triangle | #0d151a | Peaked triangular roof over the left annex |
| Windows (×2) | <rect> groups | #0b3a44 / #ff7a1a | Dark frame with orange-lit panes, animate-flicker |
| Round window | <circle> + arcs | #0b3a44 / #ff7a1a | Circular window on the left annex wall, animate-flicker |
| Door frame | <rect> | #0b3a44 | Background door rectangle |
| Door step | <path> | #0d151a | Trapezoidal stoop |
| Door panel | <rect> + <circle> + <rect> | #3e2723 / #ff7a1a / #1a1a1a | Rotating wooden panel with brass knob and a dark inset window pane |
| Moon | <motion.div> | #f4f1ea | Off-white circle with three crater <div> children |
| Cloud | <motion.div> | bg-night/40 | Blurred rounded oval |
| Ghost | <motion.g> | #f4f1ea | Ghost body with two dot eyes, bobbing in front of the round window |
| Sign strings | <line> × 2 | #f4f1ea | Two thin rope lines suspending the sign from the roof peak |
| DevHaunt sign | <motion.g> | #3e2723 / #ff7a1a | Brown rect with “DevHaunt” text in Caveat Brush font, swaying via animate-sway |
Color Palette
The illustration uses seven hardcoded fill values sourced from the DevHaunt design system:Customization
Change the sign text — Find the<text> element inside the animate-sway group and replace "DevHaunt" with your own name or tagline:
#ff7a1a fill on the inner <rect> panes with any color:
duration value in the Framer Motion transition prop for any looping element:
0.5 multiplier in the scroll calculation: