# Gooey blobs background

> Coloured drops orbit, merge and pull apart like liquid. A full‑screen background in pure HTML and CSS.

- Category: [Backgrounds](https://library.aimran.es/components/patterns)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/pt-goo
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A gooey blob background gives a hero section something soft and alive behind the headline: a creative studio, a sweets or drinks brand, a music app, the launch page of a playful product. Nine drops in three colours drift around and melt into each other, and it is all CSS, so it drops into any page without a framework.

The blur that makes the drops merge is heavy work for the browser, so on older phones it can stutter; keep it to one section rather than the whole site. If there is text on top, lower the opacity first, then the speed.

## Code

### HTML

```html
<div class="pt-goo"><svg width="0" height="0" style="position:absolute"><filter id="pt-goo-f"><feGaussianBlur in="SourceGraphic" stdDeviation="22"/><feColorMatrix values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 30 -13"/></filter></svg><b><i style="--cc:var(--c1);--z:12.0cqmin;--r:21.3cqmin;--t:16.5s;--wx:-7.4cqmin;--wy:-19.1cqmin"></i><i style="--cc:var(--c2);--z:22.3cqmin;--r:34.2cqmin;--t:17.8s;--wx:-7.8cqmin;--wy:18.9cqmin"></i><i style="--cc:var(--c3);--z:18.4cqmin;--r:43.9cqmin;--t:27.8s;--wx:6.5cqmin;--wy:-15.3cqmin"></i><i style="--cc:var(--c1);--z:21.4cqmin;--r:35.6cqmin;--t:22.3s;--wx:0.9cqmin;--wy:-14.1cqmin"></i><i style="--cc:var(--c2);--z:13.8cqmin;--r:40.9cqmin;--t:18.9s;--wx:5.7cqmin;--wy:-13.8cqmin"></i><i style="--cc:var(--c3);--z:18.9cqmin;--r:20.1cqmin;--t:18.9s;--wx:-18.7cqmin;--wy:19.7cqmin"></i><i style="--cc:var(--c1);--z:13.1cqmin;--r:35.9cqmin;--t:16.9s;--wx:6.2cqmin;--wy:7.1cqmin"></i><i style="--cc:var(--c2);--z:15.3cqmin;--r:36.5cqmin;--t:17.4s;--wx:-7.6cqmin;--wy:-14.8cqmin"></i><i style="--cc:var(--c3);--z:12.3cqmin;--r:35.1cqmin;--t:23.0s;--wx:-19.7cqmin;--wy:-13.3cqmin"></i></b></div>
```

### CSS

```css
.pt-goo {
  --c1: #0071e3;
  --c2: #8b5cf6;
  --c3: #14b8a6;
  --k: 1;
  /* velocidad */
  --d: 1;
  /* densidad / escala */
  --o: 1;
  /* opacidad */
  --bg: #05060a;
  --fg: #ffffff;
  --blend: screen;
  min-height: 100vh;
}

.pt-goo {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

.pt-goo>* {
  opacity: var(--o);
}

.pt-goo b {
  position: absolute;
  inset: 0;
  filter: url(#pt-goo-f);
}

.pt-goo i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--z) * var(--d));
  aspect-ratio: 1;
  margin: calc(var(--z) * var(--d) / -2) 0 0 calc(var(--z) * var(--d) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,color-mix(in srgb,var(--cc) 55%,#fff),var(--cc) 60%);
  animation: pt-goo-o calc(var(--t) / var(--k)) linear infinite,pt-goo-w calc(var(--t) / 2.3 / var(--k)) ease-in-out infinite alternate;
}

.pt-goo i:nth-child(even) {
  animation-direction: reverse,alternate;
}

@keyframes pt-goo-o {
  from {
    transform: rotate(0deg) translateX(var(--r)) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(var(--r)) rotate(-360deg);
  }
}

@keyframes pt-goo-w {
  from {
    translate: 0 0;
  }
  to {
    translate: var(--wx) var(--wy);
  }
}
```

### React

```tsx
// @ts-nocheck
import { useEffect, useRef } from "react";

const css = `
.pt-goo {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

.pt-goo>* {
  opacity: var(--o);
}

.pt-goo b {
  position: absolute;
  inset: 0;
  filter: url(#pt-goo-f);
}

.pt-goo i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--z) * var(--d));
  aspect-ratio: 1;
  margin: calc(var(--z) * var(--d) / -2) 0 0 calc(var(--z) * var(--d) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,color-mix(in srgb,var(--cc) 55%,#fff),var(--cc) 60%);
  animation: pt-goo-o calc(var(--t) / var(--k)) linear infinite,pt-goo-w calc(var(--t) / 2.3 / var(--k)) ease-in-out infinite alternate;
}

.pt-goo i:nth-child(even) {
  animation-direction: reverse,alternate;
}

@keyframes pt-goo-o {
  from {
    transform: rotate(0deg) translateX(var(--r)) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(var(--r)) rotate(-360deg);
  }
}

@keyframes pt-goo-w {
  from {
    translate: 0 0;
  }
  to {
    translate: var(--wx) var(--wy);
  }
}

`;

export default function PatternGoo() {
  const ref = useRef(null);
  return (
    <>
      <style>{css}</style>
      <div
        ref={ref}
        className="pt-goo"
        style={{
          "--c1": "#0071e3",
          "--c2": "#8b5cf6",
          "--c3": "#14b8a6",
          "--k": 1,
          "--d": 1,
          "--o": 1,
          "--bg": "#05060a",
          "--fg": "#ffffff",
          "--blend": "screen",
          minHeight: "100vh",
        }}
      >
        <svg width="0" height="0" style={{ position: "absolute" }}><filter id="pt-goo-f"><feGaussianBlur in="SourceGraphic" stdDeviation="22" /><feColorMatrix values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 30 -13" /></filter></svg><b><i style={{ "--cc": "var(--c1)", "--z": "12.0cqmin", "--r": "21.3cqmin", "--t": "16.5s", "--wx": "-7.4cqmin", "--wy": "-19.1cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c2)", "--z": "22.3cqmin", "--r": "34.2cqmin", "--t": "17.8s", "--wx": "-7.8cqmin", "--wy": "18.9cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c3)", "--z": "18.4cqmin", "--r": "43.9cqmin", "--t": "27.8s", "--wx": "6.5cqmin", "--wy": "-15.3cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c1)", "--z": "21.4cqmin", "--r": "35.6cqmin", "--t": "22.3s", "--wx": "0.9cqmin", "--wy": "-14.1cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c2)", "--z": "13.8cqmin", "--r": "40.9cqmin", "--t": "18.9s", "--wx": "5.7cqmin", "--wy": "-13.8cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c3)", "--z": "18.9cqmin", "--r": "20.1cqmin", "--t": "18.9s", "--wx": "-18.7cqmin", "--wy": "19.7cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c1)", "--z": "13.1cqmin", "--r": "35.9cqmin", "--t": "16.9s", "--wx": "6.2cqmin", "--wy": "7.1cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c2)", "--z": "15.3cqmin", "--r": "36.5cqmin", "--t": "17.4s", "--wx": "-7.6cqmin", "--wy": "-14.8cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c3)", "--z": "12.3cqmin", "--r": "35.1cqmin", "--t": "23.0s", "--wx": "-19.7cqmin", "--wy": "-13.3cqmin" } as CSSProperties}></i></b>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Gooey blobs background” block (Backgrounds) from AIMRAN Library to my project.

## What it is
Coloured drops orbit, merge and pull apart like liquid. A full‑screen background in pure HTML and CSS.

## Chosen settings
- Color 1: #0071e3
- Color 2: #8b5cf6
- Color 3: #14b8a6
- Speed: 1x (from 0.2 to 3x)
- Density / scale: 1x (from 0.5 to 2x)
- Opacity: 1 (from 0.2 to 1)

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
// @ts-nocheck
import { useEffect, useRef } from "react";

const css = `
.pt-goo {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

.pt-goo>* {
  opacity: var(--o);
}

.pt-goo b {
  position: absolute;
  inset: 0;
  filter: url(#pt-goo-f);
}

.pt-goo i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--z) * var(--d));
  aspect-ratio: 1;
  margin: calc(var(--z) * var(--d) / -2) 0 0 calc(var(--z) * var(--d) / -2);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,color-mix(in srgb,var(--cc) 55%,#fff),var(--cc) 60%);
  animation: pt-goo-o calc(var(--t) / var(--k)) linear infinite,pt-goo-w calc(var(--t) / 2.3 / var(--k)) ease-in-out infinite alternate;
}

.pt-goo i:nth-child(even) {
  animation-direction: reverse,alternate;
}

@keyframes pt-goo-o {
  from {
    transform: rotate(0deg) translateX(var(--r)) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(var(--r)) rotate(-360deg);
  }
}

@keyframes pt-goo-w {
  from {
    translate: 0 0;
  }
  to {
    translate: var(--wx) var(--wy);
  }
}

`;

export default function PatternGoo() {
  const ref = useRef(null);
  return (
    <>
      <style>{css}</style>
      <div
        ref={ref}
        className="pt-goo"
        style={{
          "--c1": "#0071e3",
          "--c2": "#8b5cf6",
          "--c3": "#14b8a6",
          "--k": 1,
          "--d": 1,
          "--o": 1,
          "--bg": "#05060a",
          "--fg": "#ffffff",
          "--blend": "screen",
          minHeight: "100vh",
        }}
      >
        <svg width="0" height="0" style={{ position: "absolute" }}><filter id="pt-goo-f"><feGaussianBlur in="SourceGraphic" stdDeviation="22" /><feColorMatrix values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 30 -13" /></filter></svg><b><i style={{ "--cc": "var(--c1)", "--z": "12.0cqmin", "--r": "21.3cqmin", "--t": "16.5s", "--wx": "-7.4cqmin", "--wy": "-19.1cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c2)", "--z": "22.3cqmin", "--r": "34.2cqmin", "--t": "17.8s", "--wx": "-7.8cqmin", "--wy": "18.9cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c3)", "--z": "18.4cqmin", "--r": "43.9cqmin", "--t": "27.8s", "--wx": "6.5cqmin", "--wy": "-15.3cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c1)", "--z": "21.4cqmin", "--r": "35.6cqmin", "--t": "22.3s", "--wx": "0.9cqmin", "--wy": "-14.1cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c2)", "--z": "13.8cqmin", "--r": "40.9cqmin", "--t": "18.9s", "--wx": "5.7cqmin", "--wy": "-13.8cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c3)", "--z": "18.9cqmin", "--r": "20.1cqmin", "--t": "18.9s", "--wx": "-18.7cqmin", "--wy": "19.7cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c1)", "--z": "13.1cqmin", "--r": "35.9cqmin", "--t": "16.9s", "--wx": "6.2cqmin", "--wy": "7.1cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c2)", "--z": "15.3cqmin", "--r": "36.5cqmin", "--t": "17.4s", "--wx": "-7.6cqmin", "--wy": "-14.8cqmin" } as CSSProperties}></i><i style={{ "--cc": "var(--c3)", "--z": "12.3cqmin", "--r": "35.1cqmin", "--t": "23.0s", "--wx": "-19.7cqmin", "--wy": "-13.3cqmin" } as CSSProperties}></i></b>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
