Aurora Background — Free HTML CSS Snippet
Aurora Background · Animations · Plain HTML & CSS · Live preview
Copy & paste
Source Code
<div class="aurora-scene">
<div class="aurora">
<div class="orb o1"></div>
<div class="orb o2"></div>
<div class="orb o3"></div>
<div class="orb o4"></div>
</div>
<div class="content">
<p class="eyebrow">Welcome</p>
<h1>Something<br>beautiful awaits</h1>
<p class="sub">Crafted with pure CSS animations — no canvas, no WebGL, no libraries.</p>
<button class="cta">Explore →</button>
</div>
</div>* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; }
.aurora-scene {
position: relative;
min-height: 100vh;
background: #030712;
display: flex; align-items: center; justify-content: center;
overflow: hidden;
}
.aurora {
position: absolute; inset: 0;
filter: blur(80px);
opacity: 0.65;
}
.orb {
position: absolute;
border-radius: 50%;
mix-blend-mode: screen;
animation: drift linear infinite;
}
.o1 { width: 600px; height: 600px; background: radial-gradient(circle, #6366f1, transparent 70%); top: -200px; left: -100px; animation-duration: 14s; animation-delay: 0s; }
.o2 { width: 500px; height: 500px; background: radial-gradient(circle, #ec4899, transparent 70%); bottom: -150px; right: -100px; animation-duration: 18s; animation-delay: -6s; }
.o3 { width: 400px; height: 400px; background: radial-gradient(circle, #0ea5e9, transparent 70%); top: 30%; left: 40%; animation-duration: 22s; animation-delay: -4s; }
.o4 { width: 350px; height: 350px; background: radial-gradient(circle, #10b981, transparent 70%); bottom: 10%; left: 10%; animation-duration: 20s; animation-delay: -10s; }
@keyframes drift {
0% { transform: translate(0, 0) scale(1); }
25% { transform: translate(60px, -40px) scale(1.1); }
50% { transform: translate(30px, 60px) scale(0.95); }
75% { transform: translate(-50px, 20px) scale(1.05); }
100% { transform: translate(0, 0) scale(1); }
}
.content {
position: relative; z-index: 1;
text-align: center; padding: 40px 24px;
display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: #6366f1; }
h1 { font-size: clamp(36px, 8vw, 64px); font-weight: 800; color: #f1f5f9; line-height: 1.1; letter-spacing: -1px; }
.sub { font-size: 15px; color: #475569; max-width: 460px; line-height: 1.7; }
.cta { padding: 12px 28px; background: rgba(255,255,255,0.1); color: #f1f5f9; border: 1px solid rgba(255,255,255,0.15); border-radius: 50px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; backdrop-filter: blur(10px); transition: background 0.15s, border-color 0.15s; }
.cta:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.3); }Extend with AI
Take This Snippet Further With AI
The AI prompt for this one is for Patreon supporters ($3 a month, 7 days free), along with a site with no ads. Supporters enter the passcode once and it is remembered in this browser.
What's included
Features
About this UI Snippet
Aurora Background — Blurred Radial Orbs, mix-blend-mode: screen & Drift Animation

The aurora background simulates the appearance of the Northern Lights — large, softly glowing colour fields that shift and blend against a near-black sky. Used on AI product landing pages, SaaS hero sections, and dark premium interfaces to create depth and motion without images or video — see also the gradient mesh hero, floating particles, and liquid blob backgrounds.
The four-property technique
Each orb (.orb) is an absolutely-positioned div with four properties working together: border-radius: 50% makes it circular. background: radial-gradient(circle, #colour, transparent 70%) makes it fade from solid at the centre to transparent at the edges. filter: blur(80px) softens the entire orb into a diffuse glow. mix-blend-mode: screen makes overlapping orbs additively blend — wherever two orb colours overlap, their brightnesses combine rather than occluding each other.
Why mix-blend-mode: screen creates the aurora
screen blending mode works like projecting coloured light onto a wall — two beams add brightness rather than subtracting. On a near-black background (#030712), the orbs' colours appear in full saturation. Where an indigo orb and a pink orb overlap, the result is a bright magenta. This additive blending is what gives the aurora its characteristic shifting colour mixing.
The drift animation
@keyframes drift animates translateX and translateY across three keyframes: 0% → 33% → 66% → 100%. Each orb has a different animation-duration (14s, 18s, 22s) and the last orb uses animation-direction: reverse, so all orbs move at different speeds and directions — creating the organic, non-repeating flow of real aurora.
The blurred container
All orbs sit inside .aurora { position: absolute; inset: 0; filter: blur(80px); opacity: 0.65 } — a second layer of blur softens the orbs further. The opacity: 0.65 prevents the aurora from overpowering content placed above it.
The mix-blend-mode: screen effect
Each aurora orb uses mix-blend-mode: screen. Screen blending adds pixel colour values together — where two orbs overlap, their colours combine additively, creating brighter, more saturated intersection zones. This is why overlapping a purple orb and a pink orb creates a bright white-pink centre. Without mix-blend-mode, the orbs would simply overlap with the top layer obscuring the bottom one.
The drift animation
Each orb uses a @keyframes drift animation that moves via translate(x,y) and scale(). Three orbs have different animation-duration values (14s, 18s, 22s) and animation-delay values (-6s, -12s). Because they move at different rates and phases, they never synchronise — the pattern is always unique and organic-looking. Using translate (not left/top) keeps the animation on the GPU compositor.
Colour temperature variation
The three default colours (indigo, pink, cyan) were chosen to represent warm, cool, and neutral tones that blend well in screen mode. For a warmer aurora, shift toward amber and red. For a cooler aurora, shift toward blue and teal. Avoid very dark or very light colours — screen blending works best with mid-range saturated hues.
Step by step
How to Use
- 1Watch the aurora driftThe preview shows three coloured orbs drifting at different speeds in different directions, blending at overlaps via mix-blend-mode: screen.
- 2Change orb coloursIn the CSS panel, update the radial-gradient colour on each .o1, .o2, .o3 rule to change the aurora palette.
- 3Add a fourth orbAdd a new .orb.o4 div to the HTML and CSS with a different colour, size, position, and animation-duration.
- 4Change animation speedUpdate the animation-duration values on each .o1, .o2, .o3 class for faster or slower drift.
- 5Add foreground contentPlace your hero content (headline, CTA buttons) inside a .hero-content div with position: relative; z-index: 1 to sit above the aurora.
- 6Export in your formatClick "HTML" for a standalone file, "JSX" for a React component, or "Tailwind" for a React + Tailwind version.
Real-world uses
Common Use Cases
Got questions?
Frequently Asked Questions
Screen blending mode adds brightness values rather than mixing pigments. On a dark background, each orb colour appears at full saturation. Where two orbs overlap, their brightness values add — an indigo and a pink orb overlap to produce bright magenta. The effect simulates coloured light beams on a dark surface.
Each orb has its own blur applied via the .aurora container filter: blur(80px). The .aurora element also has filter: blur(80px). This double blur creates the extremely soft, diffuse quality of real aurora borealis light.
Each orb has a different animation-duration (14s, 18s, 22s) and the third orb uses animation-direction: reverse. Since the durations are not simple multiples of each other, the orbs never perfectly synchronise and the pattern never exactly repeats.
The aurora container uses position: absolute; inset: 0 to fill its parent. Give the parent position: relative; overflow: hidden. Place your content inside a sibling div with position: relative; z-index: 1 to sit above the aurora layer.
Yes. Apply the same technique to a fixed nav: give the nav position: fixed; overflow: hidden. Add an absolutely-positioned aurora container inside and give the nav content position: relative; z-index: 1. The Hamburger Nav snippet uses a similar backdrop-filter approach.
Yes. Click "JSX" for a React component. The CSS animations and blend modes work identically in React. Import the CSS as a module or inline the styles as a styled component.