The Aurora Borealis portfolio runs two completely independent animation systems in parallel: a background layer composed of Canvas 2D rendering and Framer Motion gradient blobs that produce the ambient night-sky atmosphere, and a foreground layer of Framer Motion page transitions that respond to navigation. Neither system blocks the other — Canvas updates happen inside their ownDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/aurora-borealis/llms.txt
Use this file to discover all available pages before exploring further.
requestAnimationFrame loop while Framer Motion drives its motion.div elements through its own internal scheduler.
Animation Layer Overview
| Layer | Technology | Components | Trigger |
|---|---|---|---|
| Background atmosphere | Framer Motion + CSS | AuroraBackground | Continuous loop on mount |
| Star field | Canvas 2D + requestAnimationFrame | StarField | Continuous loop on mount |
| Page enter / exit | Framer Motion | PageTransition | React Router pathname change |
All background animation elements carry
pointer-events-none on their root node, ensuring that the continuously animating layers never absorb mouse or touch events meant for interactive page content.AuroraBackground
AuroraBackground is a fixed, full-viewport div positioned at z-0 with opacity-60 applied to the entire component. It renders three motion.div gradient layers and one SVG wave, all of which loop indefinitely.
The Three Gradient Layers
Each layer is an absolutely-positionedmotion.div carrying a radial-gradient background, a backdrop-filter or filter blur, and a looping animate prop that shifts its x, y, and scale values.
Layer 1 — Teal
Colors
rgba(45, 212, 191, 0.15) → rgba(20, 184, 166, 0.05). Blur: 60 px. Loop duration: 20 s. No blend mode override — renders as standard alpha compositing.Layer 2 — Cyan / Violet
Colors
rgba(34, 211, 238, 0.15) → rgba(139, 92, 246, 0.1). Blur: 80 px. Loop duration: 25 s. mix-blend-mode: screen brightens intersections with layer 1.Layer 3 — Magenta
Color
rgba(236, 72, 153, 0.1) → transparent. Blur: 100 px. Loop duration: 30 s. mix-blend-mode: screen adds a warm pink tint where it overlaps the cooler layers.Blend mode result
The
screen blend on layers 2 and 3 means overlapping regions become brighter rather than muddier, producing the luminous quality characteristic of real aurora curtains against a dark sky.SVG Wave Animation
Below the gradient layers,AuroraBackground renders an SVG element containing a <path> whose d attribute is animated between three keyframe shapes using Framer Motion. The path is filled using a <linearGradient> with id aurora-grad:
#2DD4BF) through cyan (#22D3EE) to violet (#8B5CF6), matching the color palette of the motion.div layers above it. The wave oscillates on a 15-second loop, creating a slow undulating horizon at the base of the aurora.
Animating the SVG
d attribute between keyframe strings works in Framer Motion as long as all keyframe paths have the same number of SVG commands and points. Changing the command count mid-animation will cause a hard snap rather than a smooth morph.StarField
StarField is a Canvas 2D renderer. It never uses Framer Motion; all animation is driven by a manual requestAnimationFrame loop.
Initialisation
When the component mounts (or the window resizes), it:- Sets the canvas
widthandheighttowindow.innerWidthandwindow.innerHeight. - Calculates star count as
Math.floor(width * height / 4000). - Generates each star with random
x,y, a size between0.5and2px, and a twinkle speed between0.005and0.025.
Per-Frame Update
On each animation frame the renderer:- Clears the canvas with
clearRect. - Advances each star’s twinkle phase, producing an opacity that oscillates continuously.
- Drifts each star upward by a small increment (slow upward movement simulating perspective drift through the atmosphere).
- Tests each frame for a shooting-star spawn: there is a 0.5 % chance per frame that a new shooting star is created, subject to a hard cap of three active shooting stars at any time.
- Draws each shooting star as a gradient-filled line that fades out as its
opacityvalue decreases. - Draws each regular star as a filled arc in
rgba(236, 254, 255, opacity)— a near-white cyan that reads as starlight on the dark background.
Resize Handling
StarField attaches a resize event listener on window. When a resize fires it tears down the current star array and shooting-star list, recalculates the canvas dimensions and new star count, and rebuilds from scratch before resuming the requestAnimationFrame loop.
PageTransition
PageTransition is the foreground animation component. It wraps every <Route> element and is keyed by location.pathname inside <AnimatePresence mode="wait">, so React fully unmounts the old instance before mounting the new one.
blur(10px) → blur(0px)) while simultaneously fading opacity over 800 ms. The blur mirrors the soft-focus look of the aurora backdrop, making navigation feel like the scene comes into and out of focus rather than cutting hard between destinations.
Performance Considerations
pointer-events-none
Both
AuroraBackground and StarField set pointer-events-none on their root elements. This prevents the continuously-painting canvas and animating motion.div layers from consuming any input events, keeping the foreground fully interactive.Framer Motion will-change
Framer Motion automatically applies
will-change: transform to elements it is actively animating. For the three motion.div aurora layers this hints to the browser compositor that those elements should be promoted to their own GPU layers, avoiding layout and paint invalidation on every frame.Separate RAF loops
The
StarField canvas loop and Framer Motion’s internal scheduler run independently. A slow frame in the canvas renderer does not delay Framer Motion tweens, and vice versa. This isolation prevents canvas jank from impacting page transition smoothness.No canvas compositing overhead
The canvas element is placed behind all
motion.div layers in the stacking context. The browser composites the canvas as a single opaque layer underneath, meaning the aurora gradient blends happen in CSS compositing rather than forcing a canvas readback.