TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/web-weaver/llms.txt
Use this file to discover all available pages before exploring further.
MoonPhase component renders a crisp SVG illustration of one of four lunar phases — new, waxing, full, or waning. On the Projects page it doubles as a filter control, letting visitors sift through portfolio work by mystical category. Each phase maps to a named project group, and the selected phase scales up while unselected phases dim to half opacity until hovered.
Where It’s Used
MoonPhase lives on the Projects page (/projects). Four instances are rendered side-by-side as a filter bar. Clicking a phase button updates the active filter and re-renders the project grid below with the corresponding entries.
Props
Which lunar phase to render. Each value produces a distinct SVG shape and maps to a named project category:
| Value | Label |
|---|---|
new | Unreleased Visions |
waxing | Brews in Progress |
full | Live Hexes |
waning | Fading Echoes |
The width and height of the rendered SVG in pixels. Both dimensions are set to the same value, keeping the moon perfectly circular.
Usage
Behavior Details
Selection States
The component itself is a pure display element — scale and opacity are applied by the parent button wrapper rather than internally. This keepsMoonPhase stateless and reusable in any context.
| State | Tailwind Classes |
|---|---|
| Selected | scale-125 |
| Unselected | scale-100 opacity-50 |
| Unselected (hovered) | opacity-100 |
Phase Shapes
Eachphase value produces a different SVG path:
new— A solid dark circle, representing the absence of reflected light.waxing— A crescent open to the left, showing the moon growing toward full.full— A fully illuminated circle with a subtle inner glow ring.waning— A crescent open to the right, the mirror of the waxing shape.
Customization Tips
Resize for Context
The default
80 px is tuned for the filter bar. Sidebars or hero sections may benefit from size={48} or size={120} respectively.Wrap for Interaction
MoonPhase renders no click handler itself. Always wrap it in a <button> or interactive element when using it as a control.Animate the Transition
Add
transition-transform duration-300 to the wrapper button so the scale-125 selection state animates smoothly.Phase Labels
The phase-to-label mapping (
full → “Live Hexes”, etc.) lives in the Projects page data layer, not inside the component — update labels there without touching MoonPhase.MoonPhase does not manage its own selected state. The active phase is tracked in the Projects page via a useState hook, and the correct Tailwind classes are applied by the parent. This ensures the component remains composable and testable in isolation.