# Gooey balls loader

> Three balls that slide into each other and melt together like liquid, then pull apart with a stretchy neck.

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

## Where to use it

The gooey effect makes shapes look like drops of something thick, which is great for brands with a liquid personality: a bubble tea shop, a juice bar’s ordering page or a paint and ink store. Two balls glide back and forth through a third that gently breathes, and they melt into one wherever they touch.

Only the main color is used, since the melt looks best when the blobs seem made of one material. Keep it at a medium or large size; when it is tiny, the stretchy neck between the balls disappears and it looks like three plain dots.

## Code

### HTML

```html
<svg width="0" height="0" style="position:absolute"><filter id="ul-goo"><feGaussianBlur stdDeviation="6"/><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 22 -9"/></filter></svg><div class="ul-goo"><i></i><i></i><i></i></div>
```

### CSS

```css
.ul-goo {
  --c1: #0071e3;
  --c2: #8ec5ff;
  --s: 72px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --bg: #f5f5f7;
}

.ul-goo {
  position: relative;
  width: calc(var(--s) * 2.4);
  height: var(--s);
  filter: url(#ul-goo);
}

.ul-goo i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--s) * .6);
  height: calc(var(--s) * .6);
  margin: calc(var(--s) * -.3);
  border-radius: 50%;
  background: var(--c1);
}

.ul-goo i:nth-child(1) {
  animation: ul-goo-a calc(2s / var(--k)) cubic-bezier(.65,0,.35,1) infinite;
}

.ul-goo i:nth-child(3) {
  animation: ul-goo-a calc(2s / var(--k)) cubic-bezier(.65,0,.35,1) infinite reverse;
}

.ul-goo i:nth-child(2) {
  animation: ul-br calc(1s / var(--k)) ease-in-out infinite;
}

@keyframes ul-goo-a {
  0%,100% {
    transform: translateX(calc(var(--s) * -.9));
  }
  50% {
    transform: translateX(calc(var(--s) * .9));
  }
}

@keyframes ul-br {
  0%,100% {
    transform: scale(.85);
  }
  50% {
    transform: scale(1);
  }
}
```

### React

```tsx
import type { CSSProperties } from "react";

const css = `
.ul-goo {
  position: relative;
  width: calc(var(--s) * 2.4);
  height: var(--s);
  filter: url(#ul-goo);
}

.ul-goo i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--s) * .6);
  height: calc(var(--s) * .6);
  margin: calc(var(--s) * -.3);
  border-radius: 50%;
  background: var(--c1);
}

.ul-goo i:nth-child(1) {
  animation: ul-goo-a calc(2s / var(--k)) cubic-bezier(.65,0,.35,1) infinite;
}

.ul-goo i:nth-child(3) {
  animation: ul-goo-a calc(2s / var(--k)) cubic-bezier(.65,0,.35,1) infinite reverse;
}

.ul-goo i:nth-child(2) {
  animation: ul-br calc(1s / var(--k)) ease-in-out infinite;
}

@keyframes ul-goo-a {
  0%,100% {
    transform: translateX(calc(var(--s) * -.9));
  }
  50% {
    transform: translateX(calc(var(--s) * .9));
  }
}

@keyframes ul-br {
  0%,100% {
    transform: scale(.85);
  }
  50% {
    transform: scale(1);
  }
}
`;

export default function LoaderGooey() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#0071e3",
          "--c2": "#8ec5ff",
          "--s": "72px",
          "--k": "1",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <svg width="0" height="0" style={{ position: "absolute" }}><filter id="ul-goo"><feGaussianBlur stdDeviation="6" /><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 22 -9" /></filter></svg><div className="ul-goo"><i></i><i></i><i></i></div>
      </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 balls loader” block (Loaders) from AIMRAN Library to my project.

## What it is
Three balls that slide into each other and melt together like liquid, then pull apart with a stretchy neck.

## Chosen settings
- Main color: #0071e3
- Secondary color: #8ec5ff
- Size: 72px (from 24 to 120px)
- Speed: 1x (from 0.5 to 2x)

## 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
import type { CSSProperties } from "react";

const css = `
.ul-goo {
  position: relative;
  width: calc(var(--s) * 2.4);
  height: var(--s);
  filter: url(#ul-goo);
}

.ul-goo i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--s) * .6);
  height: calc(var(--s) * .6);
  margin: calc(var(--s) * -.3);
  border-radius: 50%;
  background: var(--c1);
}

.ul-goo i:nth-child(1) {
  animation: ul-goo-a calc(2s / var(--k)) cubic-bezier(.65,0,.35,1) infinite;
}

.ul-goo i:nth-child(3) {
  animation: ul-goo-a calc(2s / var(--k)) cubic-bezier(.65,0,.35,1) infinite reverse;
}

.ul-goo i:nth-child(2) {
  animation: ul-br calc(1s / var(--k)) ease-in-out infinite;
}

@keyframes ul-goo-a {
  0%,100% {
    transform: translateX(calc(var(--s) * -.9));
  }
  50% {
    transform: translateX(calc(var(--s) * .9));
  }
}

@keyframes ul-br {
  0%,100% {
    transform: scale(.85);
  }
  50% {
    transform: scale(1);
  }
}
`;

export default function LoaderGooey() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#0071e3",
          "--c2": "#8ec5ff",
          "--s": "72px",
          "--k": "1",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <svg width="0" height="0" style={{ position: "absolute" }}><filter id="ul-goo"><feGaussianBlur stdDeviation="6" /><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 22 -9" /></filter></svg><div className="ul-goo"><i></i><i></i><i></i></div>
      </div>
    </>
  );
}
```

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