Distortion✨ Premium

Oil Slick

Oil on water: four very soft colour patches that swell, shrink and slowly turn inside a dark card.

CSSOrganicBlur

Updated

This effect is part of Effect.Labs — 840 vanilla effects, some free, some premium. Distortion has 31 effects, including 5 free. Explore the category →

3 usage examples

Hero background for an ambient music label (Ondraviel) — Oil Slick example 1

① Hero background for an ambient music label (Ondraviel)

WhenThe card fills the whole hero; on top sit the menu, a "New release" tag, the album title, its length and the listening buttons.
WhySlowly drifting colours set the mood of music without a strong beat, and the white text laid over them stays crisp.
Settings--osk-w: 100%, --osk-h: 360px, square corners, blur raised to 36 px, 6 s loop, a stronger violet (rgba(128,0,255,.5)), root with no background or minimum height.
Oil slick on the map of a coastal watch app (Ostrande) — Oil Slick example 2

② Oil slick on the map of a coastal watch app (Ostrande)

WhenOn the sea chart of the western sector, the slick spotted by satellite is an irregular shape with an iridescent sheen, ringed by a dotted outline, with a drift arrow; on the right, the panel gives its area, drift and time before it reaches the coast.
WhyThe material that swells and slowly turns reads at once as oil on water, and the zone seems to drift with no animation to write.
SettingsRoot placed absolutely on the map, with no background or minimum height; --osk-w: 160px, --osk-h: 100px, uneven corners --osk-radius: 58% 42% 63% 37% / 46% 60% 40% 54%, a dark see-through base rgba(14,20,28,.7) so the sea shows, 11 px blur, 6 s loop, hues at 45–55%. The outline, arrow and label come from the page.
Soap bubbles to pop in a children's mini-game (Pirouvelle) — Oil Slick example 3

③ Soap bubbles to pop in a children's mini-game (Pirouvelle)

WhenSeven bubbles of different sizes float over a pastel sky; the child taps one, it vanishes, the “Popped” counter goes up, then the bubble comes back in its place.
WhyThe colours turning on the surface are those of a real soap bubble, and each bubble stays a real button, usable from the keyboard.
SettingsSeven roots, the .osk-slick class set on a <button>; --osk-w and --osk-h from 34 to 98 px, --osk-radius: 50%, white base at 10%, 6 px blur, 6 s loop, hues at 40–45%, root with no background or minimum height. The white glint, the floating, the pop on click and the counter come from the page.

How it works

The .osk-slick card (300×200 px, 20 px corners, #111 base) hides whatever overflows. Above its content, a ::before pseudo-element stacks four radial gradients at 40% opacity: pink top left, aqua top right, yellow at the bottom, violet on the right. A 20 px blur melts them together.

The oskFlow animation makes this layer breathe over 8 seconds: it grows to 120% while turning 10°, drops to 90% while turning −10°, then returns. The patches move as one, never drifting apart, like an iridescent puddle shifting.

The card's text stays under the colours and picks up their tint, which is part of the look. The layer ignores clicks (pointer-events: none), so you can put the .osk-slick class on a link or a button.

Accessibility

  • Real text: "OIL SLICK" is in the HTML and reads normally; the colours are only a background.
  • Reduced motion: with prefers-reduced-motion: reduce the layer stops in its starting position and all four patches stay visible (measured: 2 looping animations → 0 for two copies).
  • Legibility: white text sits under colours at 40%; keep it bold and fairly large, or lower the hue opacity for small type.
  • No interaction of its own: the effect reacts to neither hover nor keyboard. Placed on a link or button, that element handles focus and activation.

Browser compatibility

CSS only, no JavaScript. Measured in Chromium 151, Firefox 153 and Playwright's WebKit 26.5: 0 errors, two independent copies, nothing overflowing at 390 px, layer frozen under reduced motion. Minimum versions come from the inset property.

Chrome 87+✓ Full (measured)
Firefox 66+✓ Full (measured)
Safari 14.1+✓ Full (measured in Playwright's WebKit)
Edge 87+✓ Full (Chromium engine)
Safari iOS 14.5+✓ Full (same engine as Safari)
Chrome Android 87+✓ Full (Chromium engine)

Without filter: blur() the four patches stay sharp, as gradient discs; the card and its text display normally.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0265-root">
  <div class="osk-slick">OIL SLICK</div>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
--osk-w and --osk-h 300px and 200px Card size; 100% makes it follow its container (it never exceeds its width).
--osk-radius 20px Corner rounding; 0 for a section background, half the height for a pill button.
--osk-base #111 Colour under the patches.
--osk-c1 to --osk-c4 pink, aqua, yellow, violet at 40% The four patches, in order top left, top right, bottom, right. Keep some transparency so they blend.
--osk-blur 20px Patch softness: stronger on a large surface, lighter on a small button.
--osk-speed 8s Length of a full cycle (swell, shrink, return).
--osk-bg and --osk-min-h #0a0a0f and 300px Root background and minimum height; transparent and 0 to fit it into your page.

FAQ

Yes: the patches are drawn above the content. For pure white text, place it next to the root and position it absolutely on top, as in the music label example.
Yes. Put the .osk-slick class on an <a> or a <button> inside the root: the colour layer lets clicks through. Remove the element's default underline or border in your CSS.
No, the four gradients share one layer that grows and turns as a block. Independent motion would need one layer per patch, which this code does not do.