Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/aurora-cosmos/llms.txt
Use this file to discover all available pages before exploring further.
Starfield places 175 procedurally-generated stars across three independent parallax layers that respond to page scroll, creating a sense of deep three-dimensional space. Stars in the foreground move faster than those far away, reinforcing the cosmic depth illusion established by AuroraBackground. Two hardcoded shooting stars cross the viewport on independent timers to add life without adding scroll weight.
Star Layers
Stars are generated once on mount and divided into three layers. Each layer moves at a different speed as the user scrolls, simulating parallax depth. All stars carry theanimate-twinkle class and a random animationDelay between 0 and 4 seconds so they never all pulse together.
| Layer | Count | Colour | Size | Rendered opacity | Parallax (scrollY 0 → 2000) |
|---|---|---|---|---|---|
| 1 | 100 | White (#ffffff) | 1 – 2 px | star.opacity (0.20 – 1.00) | y: 0 → -100px |
| 2 | 50 | Aurora Turquoise (#5eead4) | 2 – 3 px | star.opacity × 0.8 (0.16 – 0.80) | y: 0 → -250px |
| 3 | 25 | Cosmic Violet (#8b5cf6) | 3 – 4 px | star.opacity × 0.6 (0.12 – 0.60) | y: 0 → -500px |
rounded-full div whose left, top, width, height, and opacity are computed at runtime from Math.random(). Layer 3 stars additionally carry a box-shadow glow (0 0 10px 2px rgba(139, 92, 246, 0.4)) that gives them a soft violet halo.
Twinkling
Each star receives the Tailwind utilityanimate-twinkle, which cycles opacity between 0.2 → 1 → 0.2 over a 4-second ease-in-out infinite loop. An inline animationDelay ranging from 0 to 4 seconds is applied to each star individually so the field sparkles asynchronously rather than pulsing in unison.
Shooting Stars
Two shooting stars are hard-coded inside the component. They use the.animate-shooting-star utility (3-second linear infinite loop, travelling diagonally at −45°) with long delays so they appear infrequently.
| Star | Colour | Position | Delay |
|---|---|---|---|
| 1 | White | top: 20%, left: 80% | 5 s |
| 2 | Aurora Turquoise (#5eead4) | top: 40%, left: 60% | 12 s |
rounded-full head with an absolutely-positioned gradient tail extending to its right:
Parallax Implementation
Starfield uses Framer Motion’s useScroll to track scrollY, then useTransform to map that value to three independent Y offsets — one per star layer. Each layer’s motion.div wrapper receives the derived MotionValue directly via its style prop.
h-[200%] so there are always stars above the initial viewport — the parallax shift simply reveals them rather than creating empty space.
No props
Starfield accepts no props. All layer counts, colour assignments, size ranges, parallax distances, and shooting-star positions are defined internally. Like AuroraBackground, it is a self-contained global layout element that renders itself autonomously when mounted.