Lava Lamp
Three warm blobs (coral red, orange, red) blurred at 20 px rise up to 200 px and sink back over 8 s, 2 s apart, swelling and shrinking, inside a rounded frame that stands for the lamp's glass: a slow ambient light with no merging, pure CSS, frozen at three heights when the user reduces motion.
Updated
This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Liquid has 31 effects, including 6 free. Explore the category →
3 usage examples



How it works
The root .fx-0396-root holds the glass, .lava-container: at least 300 px tall, overflow: hidden, with a very dark plum gradient #1a0a2e → #0a051a. Inside are three round .lava-blob elements sitting half below the bottom edge: the first one 120 px wide at 20% of the width, the second 80 px at 50%, the third 100 px at 70%. The two large ones use a coral red radial gradient #ff6b6b → #ee5a5a, the small one an orange #feca57 → #ff9f43. All three have filter: blur(20px): their edges dissolve into a glow, which reads as light rather than an object. On top, .lava-glass draws the glass: a white 10% outline, rounded at 100 px, 10 px from the edge, letting the pointer through.
A single animation, lavaMove, over 8 s with ease-in-out, carries all the motion: the blob rises 180 px while swelling to ×1.2, sinks back to 120 px while shrinking to ×0.9, rises to 200 px (×1.1), then drops to the bottom. At each step its eight border-radius radii change (between 40 and 60%): the shape should flatten or stretch, but under a 20 px blur these changes barely show, and what reads is mostly the swelling. The three blobs start with delays of 0, −2 and −4 s: at any moment one is rising, another is sinking, the third sits at the bottom. They never merge: each one is blurred on its own, and their glows overlap without forming a bridge.
The blur has a price, because the animated border-radius forces the browser to repaint the three blobs every frame, blur included. Measured in Chromium 151 with software rendering (no graphics card, the slowest case): about 1.0 ms of rasterization per frame at the sold size, versus 0.16 ms without the blur; the same lamp scaled up four times (blobs of 320 to 480 px, 80 px blur) keeps the raster threads busy for more than 10 s over 3 s of animation and the frame rate drops by half. At the size of a thumbnail or a banner, the cost stays low; for a full-screen background, reduce the blur or the number of blobs.
Accessibility
- Reduced motion: under
prefers-reduced-motion: reduce, a block scoped to.fx-0396-rootremoves the animation and places the blobs at three fixed heights (150, 90 and 190 px above the edge, with the shape and size of one moment of the loop): the lamp stays lit, nothing moves. Measured: 0% of pixels change over 500 ms in Chromium, Firefox and WebKit (34% without the preference). - Decorative content: blobs and glass are empty
divelements, skipped by screen readers. If the lamp illustrates a product, describe it in the page text. - Text on top: on the plum background, white text measures 18.6:1; but when a blob passes behind it, it drops to 2.8:1 on coral red and 1.5:1 on orange. Keep text out of the blobs' path, or give it a dark drop shadow (
text-shadow), like the room name and the banner title in the scenes above. - Pace: an 8 s cycle, slow and continuous motion, with no flashing and no sudden change in brightness.
Browser compatibility
Pure CSS: filter: blur(), radial gradients, transform and border-radius animation. Zero JavaScript, no dependencies. Measured in Chromium 151, Firefox 153 and WebKit 26: same motion, same blur, same stop under reduced motion. Cost measured in Chromium with software rendering: 1.0 ms of rasterization per frame at the sold size, frame rate halved once the lamp is scaled up four times.
Without filter: blur (very old browsers), the blobs stay sharp: three red and orange disks rising and sinking while changing shape, which then makes the border-radius changes visible. Without CSS animations, the blobs stay half hidden below the edge of the glass.
The code
HTML structure to paste into your page (the CSS + JS come with your purchase):
<div class="fx-0396-root">
<div class="lava-container" style="width:100%;min-height:300px;">
<div class="lava-blob"></div> … (3 blobs)
<div class="lava-glass"></div>
</div>
</div>
One-time payment, no subscription — the code is yours forever
Customize
Options passed to the API or data-* attributes:
| Option / property | Default | Effect |
|---|---|---|
Colors (CSS — background of .lava-blob:nth-child(1/2/3)) |
#ff6b6b → #ee5a5a (1 and 3), #feca57 → #ff9f43 (2) | One radial gradient per blob. Blue and green (#4dd2ff, #5ce1a6) give a cool lamp; keep one blob lighter than the others for depth. |
Size and position (CSS — width, height, left, bottom of each blob) |
120, 80, 100 px; 20, 50, 70%; half below the edge | In a narrow glass (a 130 px wide lamp), bring the left values closer (2 to 42%): otherwise the third blob leaves the frame. Keep bottom at minus half the size so the blob starts from the bottom. |
Blur (CSS — filter: blur(20px)) |
20 px | At 8 to 10 px, the border-radius changes become visible and the blob turns back into a drop; at 30 px, a diffuse glow. The painting cost follows the blur radius and the blobs' size. |
Speed (CSS — 8s and delays -2s, -4s) |
8 s, 2 s apart | Keep the delays at a quarter and half of the duration (12 s → −3 and −6 s) so the blobs stay spread through the cycle. |
Rise height (CSS — -180px, -120px, -200px in lavaMove) |
up to 200 px | For a 450 px glass, multiply all three values by 1.5. Beyond the glass's height, the blobs leave through the top and can no longer be seen. |
Glass (CSS — .lava-glass) |
white 10% outline, 100 px rounding, 10 px from the edge | For a lamp, round it to half the width; for a banner, replace the frame with a single rule (border: 0; border-bottom: 2px solid …). |
FAQ
border-radius radii between 40 and 60%, but a 20 px blur erases most of those differences: what reads is mostly the swelling (from ×0.9 to ×1.2) and the rise. Lower the blur to 8 to 10 px to see the blob flatten and stretch, at the cost of a sharper, less glowing look.