TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/player-one/llms.txt
Use this file to discover all available pages before exploring further.
GhostSprite component renders a single SVG ghost character that endlessly traverses the viewport from left to right, bobbing gently on a sinusoidal Y path. Multiple instances can be scattered across a page background to create a living, arcade-flavored atmosphere without distracting from the main content. The sprite sits at z-0, stays at opacity-30, and never captures pointer events, making it a purely decorative background element.
Props
CSS color value applied to the ghost body’s
fill and the drop-shadow glow filter. Accepts any valid CSS color string (hex, rgb(), named color, etc.). Defaults to arcade lime.Framer Motion animation delay in seconds before the ghost begins its traversal. Use staggered delays across multiple instances to avoid a synchronized “wall” of ghosts.
Total time in seconds for one complete left-to-right pass (from off-screen left to off-screen right). Lower values produce faster ghosts; higher values produce slower, more atmospheric drifts.
CSS viewport-relative string for the ghost’s horizontal start position. The animation always ends at
110vw, so the ghost enters and exits off-screen regardless of this value.CSS viewport-relative string for the ghost’s vertical anchor position. The bob animation oscillates around this value: up by 100 px, down by 50 px, then back.
Uniform scale factor applied to the 48×48 px SVG ghost. Use values above
1 for larger background ghosts or below 1 for distant, smaller ones.Usage
Visual & Behavioral Description
SVG Shape
The ghost is a hand-crafted 48×48 px SVG with three layers:| Layer | Shape | Fill |
|---|---|---|
| Body | Single path forming the rounded ghost silhouette with wavy bottom hem | color prop |
| Eye sockets | Two elliptical cut-out paths | #0a0a0a (near-black) |
| Pupils | Two smaller elliptical paths inside the sockets | #00ffff (cyan) |
Glow Effect
The wrappingmotion.div carries the Tailwind class drop-shadow-[0_0_8px_currentColor]. Because currentColor inherits from the element’s color CSS property (which is set to the color prop), the glow hue automatically matches the ghost body — a lime ghost glows lime, a magenta ghost glows magenta.
Motion
The animation is driven by a Framer Motionanimate object with two simultaneous axes:
Horizontal (x) — linear traversal:
Implementation Notes
Where It’s Used
GhostSprite instances are placed directly inside page-level components (e.g., the title screen, projects page) as background decoration. They are siblings of the main content, not wrappers around it — content sits at higher z-index values while the ghosts remain at z-0.