# Raindrops on a pond

> Rings spread across dark water at random spots, as if drops were landing on a still pond.

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

## Where to use it

Ripples on water are about calm and presence, so they work for the home screen of a mindfulness app, the website of a spa or thermal baths, or the booking page of a lakeside retreat. The drops land at random, which keeps the rhythm from feeling mechanical. An animated water ripple background in HTML and CSS.

Slow it down a touch for meditation or sleep content; the default is closer to light rain. Big, thin headings in white look great floating over the rings, especially if you drop the opacity slightly.

## Code

### HTML

```html
<div class="pt-pond"><i style="left:5.0%;top:35.7%;--t:8.7s;--dl:-1.2s"></i><i style="left:57.3%;top:25.3%;--t:7.2s;--dl:-3.6s"></i><i style="left:42.5%;top:81.0%;--t:7.6s;--dl:-1.3s"></i><i style="left:43.0%;top:17.7%;--t:8.1s;--dl:-4.3s"></i><i style="left:18.3%;top:27.9%;--t:7.6s;--dl:-1.9s"></i><i style="left:74.9%;top:64.7%;--t:6.7s;--dl:-6.3s"></i><i style="left:88.1%;top:40.0%;--t:5.1s;--dl:-5.2s"></i><i style="left:70.5%;top:17.5%;--t:5.2s;--dl:-1.4s"></i><i style="left:64.5%;top:56.0%;--t:6.2s;--dl:-7.5s"></i><i style="left:83.9%;top:91.5%;--t:7.8s;--dl:-0.5s"></i><i style="left:18.7%;top:43.2%;--t:8.4s;--dl:-7.7s"></i><i style="left:50.0%;top:40.9%;--t:8.4s;--dl:-1.8s"></i><i style="left:94.9%;top:41.1%;--t:6.2s;--dl:-6.9s"></i><i style="left:81.2%;top:11.5%;--t:8.4s;--dl:-4.5s"></i></div>
```

### CSS

```css
.pt-pond {
  --c1: #8ec5ff;
  --c2: #22d3ee;
  --c3: #0c4a6e;
  --k: 1;
  /* velocidad */
  --d: 1;
  /* densidad / escala */
  --o: 1;
  /* opacidad */
  --bg: #05060a;
  --fg: #ffffff;
  --blend: screen;
  min-height: 100vh;
}

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

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

.pt-pond {
  background: radial-gradient(120% 100% at 50% 0%,color-mix(in srgb,var(--c3) 45%,var(--bg)),var(--bg))!important;
}

.pt-pond i {
  position: absolute;
  width: calc(260px * var(--d));
  aspect-ratio: 1;
  margin: calc(-130px * var(--d)) 0 0 calc(-130px * var(--d));
  border-radius: 50%;
  border: 3px solid var(--c1);
  box-shadow: 0 0 12px var(--c1),inset 0 0 12px var(--c1);
  opacity: 0;
  animation: pt-pond-r calc(var(--t) / var(--k)) cubic-bezier(.2,.6,.3,1) infinite;
  animation-delay: var(--dl);
}

.pt-pond i::before,.pt-pond i::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 1.5px solid var(--c2);
}

.pt-pond i::after {
  inset: 32%;
  border-color: var(--c1);
  opacity: .6;
}

@keyframes pt-pond-r {
  0% {
    transform: scale(0,0);
    opacity: var(--o);
  }
  100% {
    transform: scale(1,.5);
    opacity: 0;
  }
}
```

### React

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

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

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

.pt-pond {
  background: radial-gradient(120% 100% at 50% 0%,color-mix(in srgb,var(--c3) 45%,var(--bg)),var(--bg))!important;
}

.pt-pond i {
  position: absolute;
  width: calc(260px * var(--d));
  aspect-ratio: 1;
  margin: calc(-130px * var(--d)) 0 0 calc(-130px * var(--d));
  border-radius: 50%;
  border: 3px solid var(--c1);
  box-shadow: 0 0 12px var(--c1),inset 0 0 12px var(--c1);
  opacity: 0;
  animation: pt-pond-r calc(var(--t) / var(--k)) cubic-bezier(.2,.6,.3,1) infinite;
  animation-delay: var(--dl);
}

.pt-pond i::before,.pt-pond i::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 1.5px solid var(--c2);
}

.pt-pond i::after {
  inset: 32%;
  border-color: var(--c1);
  opacity: .6;
}

@keyframes pt-pond-r {
  0% {
    transform: scale(0,0);
    opacity: var(--o);
  }
  100% {
    transform: scale(1,.5);
    opacity: 0;
  }
}

`;

export default function PatternPond() {
  const ref = useRef(null);
  return (
    <>
      <style>{css}</style>
      <div
        ref={ref}
        className="pt-pond"
        style={{
          "--c1": "#8ec5ff",
          "--c2": "#22d3ee",
          "--c3": "#0c4a6e",
          "--k": 1,
          "--d": 1,
          "--o": 1,
          "--bg": "#05060a",
          "--fg": "#ffffff",
          "--blend": "screen",
          minHeight: "100vh",
        }}
      >
        <i style={{ left: "5.0%", top: "35.7%", "--t": "8.7s", "--dl": "-1.2s" } as CSSProperties}></i><i style={{ left: "57.3%", top: "25.3%", "--t": "7.2s", "--dl": "-3.6s" } as CSSProperties}></i><i style={{ left: "42.5%", top: "81.0%", "--t": "7.6s", "--dl": "-1.3s" } as CSSProperties}></i><i style={{ left: "43.0%", top: "17.7%", "--t": "8.1s", "--dl": "-4.3s" } as CSSProperties}></i><i style={{ left: "18.3%", top: "27.9%", "--t": "7.6s", "--dl": "-1.9s" } as CSSProperties}></i><i style={{ left: "74.9%", top: "64.7%", "--t": "6.7s", "--dl": "-6.3s" } as CSSProperties}></i><i style={{ left: "88.1%", top: "40.0%", "--t": "5.1s", "--dl": "-5.2s" } as CSSProperties}></i><i style={{ left: "70.5%", top: "17.5%", "--t": "5.2s", "--dl": "-1.4s" } as CSSProperties}></i><i style={{ left: "64.5%", top: "56.0%", "--t": "6.2s", "--dl": "-7.5s" } as CSSProperties}></i><i style={{ left: "83.9%", top: "91.5%", "--t": "7.8s", "--dl": "-0.5s" } as CSSProperties}></i><i style={{ left: "18.7%", top: "43.2%", "--t": "8.4s", "--dl": "-7.7s" } as CSSProperties}></i><i style={{ left: "50.0%", top: "40.9%", "--t": "8.4s", "--dl": "-1.8s" } as CSSProperties}></i><i style={{ left: "94.9%", top: "41.1%", "--t": "6.2s", "--dl": "-6.9s" } as CSSProperties}></i><i style={{ left: "81.2%", top: "11.5%", "--t": "8.4s", "--dl": "-4.5s" } as CSSProperties}></i>
      </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 “Raindrops on a pond” block (Backgrounds) from AIMRAN Library to my project.

## What it is
Rings spread across dark water at random spots, as if drops were landing on a still pond.

## Chosen settings
- Color 1: #8ec5ff
- Color 2: #22d3ee
- Color 3: #0c4a6e
- 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-pond {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

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

.pt-pond {
  background: radial-gradient(120% 100% at 50% 0%,color-mix(in srgb,var(--c3) 45%,var(--bg)),var(--bg))!important;
}

.pt-pond i {
  position: absolute;
  width: calc(260px * var(--d));
  aspect-ratio: 1;
  margin: calc(-130px * var(--d)) 0 0 calc(-130px * var(--d));
  border-radius: 50%;
  border: 3px solid var(--c1);
  box-shadow: 0 0 12px var(--c1),inset 0 0 12px var(--c1);
  opacity: 0;
  animation: pt-pond-r calc(var(--t) / var(--k)) cubic-bezier(.2,.6,.3,1) infinite;
  animation-delay: var(--dl);
}

.pt-pond i::before,.pt-pond i::after {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 1.5px solid var(--c2);
}

.pt-pond i::after {
  inset: 32%;
  border-color: var(--c1);
  opacity: .6;
}

@keyframes pt-pond-r {
  0% {
    transform: scale(0,0);
    opacity: var(--o);
  }
  100% {
    transform: scale(1,.5);
    opacity: 0;
  }
}

`;

export default function PatternPond() {
  const ref = useRef(null);
  return (
    <>
      <style>{css}</style>
      <div
        ref={ref}
        className="pt-pond"
        style={{
          "--c1": "#8ec5ff",
          "--c2": "#22d3ee",
          "--c3": "#0c4a6e",
          "--k": 1,
          "--d": 1,
          "--o": 1,
          "--bg": "#05060a",
          "--fg": "#ffffff",
          "--blend": "screen",
          minHeight: "100vh",
        }}
      >
        <i style={{ left: "5.0%", top: "35.7%", "--t": "8.7s", "--dl": "-1.2s" } as CSSProperties}></i><i style={{ left: "57.3%", top: "25.3%", "--t": "7.2s", "--dl": "-3.6s" } as CSSProperties}></i><i style={{ left: "42.5%", top: "81.0%", "--t": "7.6s", "--dl": "-1.3s" } as CSSProperties}></i><i style={{ left: "43.0%", top: "17.7%", "--t": "8.1s", "--dl": "-4.3s" } as CSSProperties}></i><i style={{ left: "18.3%", top: "27.9%", "--t": "7.6s", "--dl": "-1.9s" } as CSSProperties}></i><i style={{ left: "74.9%", top: "64.7%", "--t": "6.7s", "--dl": "-6.3s" } as CSSProperties}></i><i style={{ left: "88.1%", top: "40.0%", "--t": "5.1s", "--dl": "-5.2s" } as CSSProperties}></i><i style={{ left: "70.5%", top: "17.5%", "--t": "5.2s", "--dl": "-1.4s" } as CSSProperties}></i><i style={{ left: "64.5%", top: "56.0%", "--t": "6.2s", "--dl": "-7.5s" } as CSSProperties}></i><i style={{ left: "83.9%", top: "91.5%", "--t": "7.8s", "--dl": "-0.5s" } as CSSProperties}></i><i style={{ left: "18.7%", top: "43.2%", "--t": "8.4s", "--dl": "-7.7s" } as CSSProperties}></i><i style={{ left: "50.0%", top: "40.9%", "--t": "8.4s", "--dl": "-1.8s" } as CSSProperties}></i><i style={{ left: "94.9%", top: "41.1%", "--t": "6.2s", "--dl": "-6.9s" } as CSSProperties}></i><i style={{ left: "81.2%", top: "11.5%", "--t": "8.4s", "--dl": "-4.5s" } as CSSProperties}></i>
      </div>
    </>
  );
}
```

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