Backgrounds✨ Premium

Floating Shapes

Three colored orbs with blur 60 px drift out of phase over a dark background — pure-CSS ambient effect, zero JavaScript.

CSSShapesBlur

You'll get access to the interactive demo with a free account.

This effect is part of Effect.Labs — 811 vanilla effects, some free, some premium. Backgrounds has 50 effects, including 6 free. Explore the category →

3 usage examples

Landing hero — Ambient background for dark-mode SaaS — Floating Shapes example 1

① Landing hero — Ambient background for dark-mode SaaS

WhenHomepage or above-the-fold section of a tech product in dark theme: the background is empty and needs depth without extra markup.
WhyDiffuse orbs cover the entire surface without overwhelming the text — they add depth and color at zero CSS cost, with no image assets.
Settingsanimation-duration: 28s on .shape for very slow drift; amplitude reduced to ±30 px in the keyframes; colors matched to the product brand.
Pricing section — Plan cards over a living background — Floating Shapes example 2

② Pricing section — Plan cards over a living background

WhenA plan comparison or feature section on a dark background that needs to feel premium without a graphic asset.
WhyFloating glows create an impression of light under the cards with no image — reinforce quality perception and a sense of depth between elements.
Settingsopacity: 0.3 on .shape for a more subtle background; shapes enlarged to 450–500 px; warm palette (orange #f97316, amber #f59e0b, rose #f43f5e) for a warm accent.
Article header — Thematic editorial banner — Floating Shapes example 3

③ Article header — Thematic editorial banner

WhenA tech blog where each article adopts a topic-specific color theme, without a cover image.
WhySwapping the three <code>.shape-N</code> colors per article generates a unique header visually — zero network weight, immediate visual impact.
SettingsTwo shapes in the article's primary theme color, one in a complementary accent; filter: blur(40px) for slightly crisper edges; animation-duration: 32s for near-imperceptible drift.

How it works

The effect uses three <div> elements positioned absolutely inside .bg-floating-shapes, shaped into discs with border-radius: 50%. Everything is pure CSS: the 20-second @keyframes floatShapes animation chains four keyframes that combine diagonal translations (±50 px) and a full rotation (0° → 270°), with an ease-in-out curve that softens each direction reversal.

The visual signature comes from two combined properties: filter: blur(60px) turns each solid disc into a soft, feathered glow; opacity: 0.5 makes the glows semi-transparent, so where indigo (#6366f1), pink (#d946ef) and cyan (#06b6d4) overlap they composite optically — the mixed color emerges naturally without extra layers or complex gradients.

The three shapes share the same animation but carry different negative delays (0 s, −5 s, −10 s). A negative delay starts the animation at an already-advanced point in the cycle: the three orbs are always at different positions, their overlap shifting continuously and organically, never visibly synchronizing.

The container has overflow: hidden — the shapes are intentionally oversized and partially outside the edges (top: −100 px, right: −150 px…) so the glow covers every corner without gaps. Overlay content (text, buttons) sits on top via normal flow or position: absolute; z-index: 1.

Accessibility

  • prefers-reduced-motion not handled: the source code does not detect this OS preference — the animation always runs. Add @media (prefers-reduced-motion: reduce) { .shape { animation: none; } } manually if your project requires it.
  • The shapes are purely decorative: add aria-hidden="true" on the .bg-floating-shapes container to hide it from screen readers.
  • No keyboard interaction or JavaScript: the component is passive, no focus trap, no events to handle.
  • Overlay text must meet WCAG AA contrast (ratio ≥ 4.5:1) against the dark background — re-check the ratio if you change shape opacity or colors.
  • No canvas: no role or aria-label attributes are needed on the shapes themselves.

Browser compatibility

Requires filter: blur() and CSS Animations — supported in all modern browsers since 2020.

Chrome 110+✓ Full
Firefox 110+✓ Full
Safari 15+✓ Full
Edge 110+✓ Full
Mobile iOS✓ Full
Android Chrome✓ Full

If <code>filter</code> is not supported (IE 11), shapes render as solid colored discs without blur — the background stays colored, the page stays functional, no JS errors.

The code

HTML structure to paste into your page (CSS + JS available with a premium account):

index.html — structure
<div class="bg-floating-shapes">
  <div class="shape shape-1"></div>
  <div class="shape shape-2"></div>
  <div class="shape shape-3"></div>

  <!-- Optional: overlay content -->
</div>
🔒 Unlock the full code — from €2.99 the first month

Full HTML + CSS + JS, copy-paste ready — with hundreds of premium effects.

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
background on .shape-1 / .shape-2 / .shape-3 #6366f1 / #d946ef / #06b6d4 Colors of the three orbs — swap in your brand palette. Each shape accepts any valid CSS color value (hex, hsl, gradient).
width / height on .shape-1 / .shape-2 / .shape-3 300 px / 400 px / 250 px Orb size. Larger shapes cover more area; drop to 150–200 px for a thinner, more subtle background.
filter: blur(…) on .shape 60px Blur radius for all orbs. 40 px = slightly defined edges, 80 px+ = very soft atmospheric halos.
opacity on .shape 0.5 Halo intensity. 0.3 = very subtle background, 0.7 = saturated and prominent — also affects the intensity of optical blending at intersections.
animation-duration on .shape 20s Duration of one full cycle. 12 s = noticeable and dynamic, 30 s+ = near-imperceptible drift, more cinematic.
translate(50px, -50px) in @keyframes floatShapes 50 px / −50 px Movement amplitude at each keyframe. ±20 px = almost-static background, ±80 px = very pronounced drift.
background on .bg-floating-shapes #0a0a0f Background color behind the orbs — swap to your section color to integrate the effect into any theme.

FAQ

No. The effect is 100% CSS: three div elements, one @keyframes rule, and filter, opacity, and animation properties. No JS file is needed. Drop the HTML and CSS into a React, Vue, Angular, or any other framework project — it works without extra configuration.
Duplicate a .shape in the HTML, give it a unique name (e.g. .shape-4), set its background, size, and position in the CSS, then add a negative animation-delay different from the three existing ones (e.g. -15s for a 75% phase offset). The new shape automatically inherits the floatShapes animation.
The impact is low: the browser offloads transform and filter to the GPU via its compositor — the three elements are promoted to their own render layers, keeping the CPU nearly idle. On a low-end mobile device, reduce the blur to 40px and opacity to 0.3 to lighten the compositing load.