Aurora Drift achieves its organic, weightless motion through spring-based animations rather than fixed-duration tweens. Instead of saying “move from A to B in 0.3 seconds,” spring animations apply simulated physical forces — stiffness pulls the value toward its target while damping resists overshoot — producing motion that feels alive and naturally decelerating. The customDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/aurora-drift/llms.txt
Use this file to discover all available pages before exploring further.
useSpring hook in assets/use-spring.js wraps Framer Motion’s low-level motionValue.attach() API to expose this physics model as a simple composable hook.
What Is Spring Physics?
A spring animation has no fixed duration. It is governed entirely by three parameters:- Stiffness — how aggressively the value accelerates toward its target. Higher stiffness = snappier, more energetic movement.
- Damping — how quickly the oscillation decays. Higher damping = less bounce, faster settling.
- Mass — the simulated weight of the object. Higher mass = slower response, more inertia.
The useSpring Hook
The hook lives in assets/use-spring.js and accepts a source value (either a raw number or an existing MotionValue) plus a config object.
Basic Usage
useSpring uses motionValue.attach() internally, which wires the spring into Framer Motion’s frameloop. This means the spring updates every animation frame without triggering React re-renders — no useState, no reconciliation overhead.Spring Presets Used in Aurora Drift
Each major animated element in the project uses a carefully tuned preset that matches its visual role:| Preset | stiffness | damping | mass | Used In | Feel |
|---|---|---|---|---|---|
| Aurora parallax | 400 | 50 | — | AuroraBackground | Slow, heavy, majestic drift |
| Cursor glow | 200 | 25 | 0.5 | CursorGlow | Snappy, light, responsive |
| Nav underline | 300 | 30 | — | Nav (layoutId) | Balanced, confident slide |
Aurora Background Parallax
The aurora SVG layer uses high damping to create that slow, fog-like lag behind the mouse:Cursor Glow Follow
The glow orb needs to feel attached to the cursor without being glued to it. A lighter mass and lower damping keep it feeling floaty:Nav Underline Slide
The active-route underline uses Framer Motion’s built-inlayout animation with a spring transition, giving it a fluid slide between nav items:
Setting Up a Spring Animation: Step by Step
Attach a spring follower
Pass the source and your config to
useSpring. The returned value automatically tracks rawX with physics.Wire up an event handler
On user interaction (e.g.,
mousemove), update the raw value — the spring output will follow automatically.Spring vs. Tween: When to Use Each
What is the difference between spring and tween animations?
What is the difference between spring and tween animations?
Tween animations play over a fixed duration using an easing curve (e.g.,
Aurora Drift uses springs for all pointer-reactive elements because they handle interruption gracefully — if the user moves the mouse before the animation settles, the spring picks up the velocity and continues smoothly rather than snapping.
ease-out over 0.3s). They are predictable and great for UI transitions that need to complete in a guaranteed time — like a modal appearing or a button state change.Spring animations are physics-driven and have no fixed duration. They continue until the simulated energy dissipates below a threshold (restDelta and restSpeed). The main trade-offs:| Tween | Spring | |
|---|---|---|
| Duration | Fixed | Variable (physics-driven) |
| Interruption | Can look abrupt mid-play | Inherits current velocity — feels natural |
| Use case | UI state changes, entrances | Pointer tracking, layout shifts, gesture responses |
| Config | duration, ease | stiffness, damping, mass |
Quick Reference
Snappy & Light
{ stiffness: 200, damping: 25, mass: 0.5 }Best for: cursor tracking, hover effects, small interactive elementsSlow & Majestic
{ stiffness: 400, damping: 50 }Best for: background parallax, large decorative layers, ambient motionBalanced Slide
{ type: 'spring', stiffness: 300, damping: 30 }Best for: nav indicators, tab underlines, card selection highlightsBouncy & Energetic
{ stiffness: 500, damping: 10 }Best for: confirmation feedback, icon toggles, playful micro-interactions