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.
SwingingLantern is a decorative element that hangs and sways like a lantern suspended from a hook. It is built entirely with Framer Motion and Tailwind CSS — no external image assets are required. The lantern body, flame flicker, and pendulum swing are all produced with CSS transforms and Framer Motion’s animate prop, giving the decoration a gentle, looping life.
SwingingLantern is mounted inside Layout and is therefore active on every page of the Spooky theme.Animation
The lantern’s swing uses Framer Motion’sanimate prop on the lantern body element with a rotate keyframe sequence:
origin-top Tailwind utility class, which maps to transform-origin: top. This anchors the rotation at the hanging point (the string/chain), producing an authentic pendulum arc rather than spinning around the element’s center.
Inside the lantern body, a separate Framer Motion motion.div animates the candle flame. It independently cycles opacity and scale at a fast rate to simulate a flickering glow:
Placement
SwingingLantern is rendered by the Layout component, making it a fixed-position decoration that appears consistently across all pages. It sits at a defined top/left position in the layout, overlaying the page content without interfering with interaction (it uses pointer-events-none-equivalent positioning in the layout hierarchy).
The string above the lantern is rendered as a thin 2px wide div with a gray color, giving the visual impression of a thread or chain from which the lantern hangs.
Customizing the lantern
The following properties can be adjusted when rebuilding from source:| Property | Where to change | Effect |
|---|---|---|
| Swing arc | rotate keyframe values (e.g., [-3, 3, -3]) | Wider values = more dramatic pendulum |
| Swing speed | transition.duration value | Lower = faster swing |
| Position | CSS top/left values on the wrapper element | Moves the lantern to a different screen position |
| Flame color | The bg-[#ff7518] class on the flame div | Change to any Tailwind or arbitrary color |
| Lantern appearance | The border and background classes on the lantern body | Adjust size, color, and border style |
| String length | The h-16 class on the vertical line div | Shorter or longer thread above the lantern |
whileHover={{ scale: 1.05 }} spring, inviting visitors to notice it.