Framer Motion powers three distinct animation systems in Aurora Cosmos: the slow, dreamy drift of the aurora background layers, the scroll-driven parallax of the starfield, and the shared-layout slide of the active navigation indicator. On top of those, a set of CSS keyframe animations defined inDocumentation 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.
assets/main.css handles per-star twinkling, shooting stars, and the orbiting dot on the nav logo — keeping lightweight effects off the JavaScript thread entirely.
Aurora Background Animations
TheAuroraBackground component renders three motion.div layers, each carrying a blurred radial gradient blob. All three use Framer Motion’s animate prop with keyframe arrays so the browser cycles through the values continuously via repeat: Infinity.
Layer 1 — Turquoise › Violet
Gradient:
aurora-turquoise → aurora-teal → cosmic-violet- x:
["-10%", "5%", "-10%"] - y:
["-5%", "5%", "-5%"] - rotate:
[0, 2, 0] - duration: 25 s
- Opacity 40%,
blur-[100px]
Layer 2 — Magenta › Teal
Gradient:
cosmic-magenta → cosmic-violet → aurora-teal- x:
["5%", "-5%", "5%"] - y:
["5%", "-5%", "5%"] - rotate:
[0, -2, 0] - duration: 30 s
- Opacity 30%,
blur-[120px]
Layer 3 — Green › Teal
Gradient:
aurora-green → aurora-teal → transparent- x:
["-5%", "5%", "-5%"] - y:
["10%", "0%", "10%"] - duration: 20 s
- Opacity 20%,
blur-[90px]
components/AuroraBackground.js:
Starfield Parallax
TheStarfield component generates three layers of randomly positioned star dots and then moves each layer at a different speed as the user scrolls. This is achieved with Framer Motion’s useScroll() hook combined with useTransform() to map scroll progress to a y translation.
Scroll input range [0, 2000] (pixels) maps to these y output ranges:
| Layer | Star count | Color | Size range | y output range | Effect |
|---|---|---|---|---|---|
| Layer 1 | 100 stars | white | 1–2 px | [0, -100] px | Slowest — near stars |
| Layer 2 | 50 stars | aurora-turquoise | 2–3 px | [0, -250] px | Mid-speed |
| Layer 3 | 25 stars | cosmic-violet | 3–4 px | [0, -500] px | Fastest — far stars |
cosmic-violet stars also carry a subtle box-shadow (0 0 10px 2px rgba(139, 92, 246, 0.4)) to simulate depth glow.
The useTransform calls from components/Starfield.js:
motion.div wrapper via the style prop:
CSS Animations
Four keyframe animations are defined directly inassets/main.css and applied via Tailwind utility classes. These run entirely on the CSS compositor thread.
.animate-twinkle
Keyframes: opacity
0.2 → 1 → 0.2Timing: 4 s, ease-in-out, infiniteApplied to every individual star dot in all three Starfield layers. Each star receives a randomised animation-delay (0–4 s) so the field shimmers naturally rather than pulsing in sync..animate-shooting-star
Keyframes:
translate(0, 0) rotate(-45deg) at opacity 1 → translate(-1000px, 1000px) rotate(-45deg) at opacity 0Timing: 3 s, linear, infiniteApplied to the two shooting-star elements in the Starfield component. Each has a different animation-delay (5 s and 12 s) to stagger their crossings..animate-orbit
Keyframes:
rotate(0deg) translate(100px) rotate(0deg) → rotate(360deg) translate(100px) rotate(-360deg)Timing: 20 s, linear, infiniteApplied to the decorative dot on the navigation logo. The transform-origin is set to 0 150px so the dot orbits around the logo at a fixed radius..animate-pulse
Keyframes: opacity drops to
0.5 at the 50% markTiming: 2 s, cubic-bezier(0.4, 0, 0.6, 1), infiniteA secondary animation layered on the nav logo dot alongside .animate-orbit, giving it a gentle breathing effect as it orbits.Active Nav Indicator
The navigation sidebar uses a Framer Motion shared-layout animation to slide a highlight bar between items as the active route changes. A singlemotion.div carries a layoutId prop — Framer Motion automatically interpolates its position whenever the active link changes, producing the smooth sliding underline effect.
layoutId="activeNav" is shared across all nav items, only one instance of this motion.div exists in the DOM at any time — Framer Motion moves it rather than swapping it out.