# Water fill checkbox

> Water rises in waves inside the box, lets out a couple of bubbles and then shows the tick on top.

- Category: [Checkboxes](https://library.aimran.es/components/checkboxes)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-chk-water
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

This checkbox fills up like a glass. Two rotating wave layers rise from the bottom when it is checked, a pair of bubbles float up, and a white tick appears once the water settles near the top. Hovering raises the level a little as a hint. It is HTML and CSS only and fits habit trackers, hydration reminders, garden apps and wellness checklists.

The main color is the front wave and the secondary color the lighter back wave, so try teal and aqua, amber and honey, or berry tones for juice. The speed slider changes how fast the waves roll and the water climbs.

## Code

### HTML

```html
<label class="uvq02-liq"><input type="checkbox"><span class="bx"><i class="w2"></i><i class="w1"></i><i class="bu"></i><i class="bu"></i><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" pathLength="1"/></svg></span>Drink 2 litres of water</label>
```

### CSS

```css
.uvq02-liq {
  --c1: #139fd0;
  --c2: #6fe0f2;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq02-liq {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .75em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-weight: 550;
}

.uvq02-liq input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq02-liq .bx {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.1em;
  height: 2.1em;
  border-radius: .6em;
  overflow: hidden;
  isolation: isolate;
  background: color-mix(in srgb,var(--c1) 6%,transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--fg) 24%,transparent);
}

.uvq02-liq .bx::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(130deg,rgba(255,255,255,.55),transparent 35%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--c1) 0%,transparent);
  z-index: 3;
  pointer-events: none;
  transition: box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-liq .w1,.uvq02-liq .w2 {
  position: absolute;
  left: -95%;
  top: 115%;
  width: 290%;
  aspect-ratio: 1;
  border-radius: 42%;
  background: var(--c1);
  animation: uvq02-liq calc(5s / var(--k)) linear infinite;
  transition: top calc(0.9s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq02-liq .w2 {
  background: var(--c2);
  border-radius: 38%;
  animation-duration: calc(7s / var(--k));
  animation-direction: reverse;
}

.uvq02-liq .bu {
  position: absolute;
  bottom: .2em;
  left: 30%;
  width: .22em;
  height: .22em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.85);
  opacity: 0;
  z-index: 1;
}

.uvq02-liq .bu + .bu {
  left: 62%;
  width: .16em;
  height: .16em;
}

.uvq02-liq svg {
  position: relative;
  z-index: 2;
  width: 1.15em;
  height: 1.15em;
  color: #fff;
  transform: scale(0);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-liq:hover input:not(:checked) + .bx .w1 {
  top: 92%;
}

.uvq02-liq:hover input:not(:checked) + .bx .w2 {
  top: 88%;
}

.uvq02-liq:active .bx {
  scale: .94;
}

.uvq02-liq input:checked + .bx .w1 {
  top: 10%;
}

.uvq02-liq input:checked + .bx .w2 {
  top: 4%;
}

.uvq02-liq input:checked + .bx::after {
  box-shadow: inset 0 0 0 2px var(--c1);
}

.uvq02-liq input:checked + .bx svg {
  transform: scale(1);
  transition-delay: calc(0.45s / var(--k));
}

.uvq02-liq input:checked + .bx .bu {
  animation: uvq02-liq-b calc(1.2s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.3s / var(--k));
}

.uvq02-liq input:checked + .bx .bu + .bu {
  animation-delay: calc(0.55s / var(--k));
}

@keyframes uvq02-liq {
  to {
    transform: rotate(360deg);
  }
}

@keyframes uvq02-liq-b {
  0% {
    opacity: 0;
    transform: none;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(.15em,-1.6em);
  }
}

.uvq02-liq input:focus-visible + .bx {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq02-liq,.uvq02-liq *,.uvq02-liq *::before,.uvq02-liq *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### React

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

const css = `
.uvq02-liq {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .75em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-weight: 550;
}

.uvq02-liq input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq02-liq .bx {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.1em;
  height: 2.1em;
  border-radius: .6em;
  overflow: hidden;
  isolation: isolate;
  background: color-mix(in srgb,var(--c1) 6%,transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--fg) 24%,transparent);
}

.uvq02-liq .bx::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(130deg,rgba(255,255,255,.55),transparent 35%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--c1) 0%,transparent);
  z-index: 3;
  pointer-events: none;
  transition: box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-liq .w1,.uvq02-liq .w2 {
  position: absolute;
  left: -95%;
  top: 115%;
  width: 290%;
  aspect-ratio: 1;
  border-radius: 42%;
  background: var(--c1);
  animation: uvq02-liq calc(5s / var(--k)) linear infinite;
  transition: top calc(0.9s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq02-liq .w2 {
  background: var(--c2);
  border-radius: 38%;
  animation-duration: calc(7s / var(--k));
  animation-direction: reverse;
}

.uvq02-liq .bu {
  position: absolute;
  bottom: .2em;
  left: 30%;
  width: .22em;
  height: .22em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.85);
  opacity: 0;
  z-index: 1;
}

.uvq02-liq .bu + .bu {
  left: 62%;
  width: .16em;
  height: .16em;
}

.uvq02-liq svg {
  position: relative;
  z-index: 2;
  width: 1.15em;
  height: 1.15em;
  color: #fff;
  transform: scale(0);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-liq:hover input:not(:checked) + .bx .w1 {
  top: 92%;
}

.uvq02-liq:hover input:not(:checked) + .bx .w2 {
  top: 88%;
}

.uvq02-liq:active .bx {
  scale: .94;
}

.uvq02-liq input:checked + .bx .w1 {
  top: 10%;
}

.uvq02-liq input:checked + .bx .w2 {
  top: 4%;
}

.uvq02-liq input:checked + .bx::after {
  box-shadow: inset 0 0 0 2px var(--c1);
}

.uvq02-liq input:checked + .bx svg {
  transform: scale(1);
  transition-delay: calc(0.45s / var(--k));
}

.uvq02-liq input:checked + .bx .bu {
  animation: uvq02-liq-b calc(1.2s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.3s / var(--k));
}

.uvq02-liq input:checked + .bx .bu + .bu {
  animation-delay: calc(0.55s / var(--k));
}

@keyframes uvq02-liq {
  to {
    transform: rotate(360deg);
  }
}

@keyframes uvq02-liq-b {
  0% {
    opacity: 0;
    transform: none;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(.15em,-1.6em);
  }
}

.uvq02-liq input:focus-visible + .bx {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq02-liq,.uvq02-liq *,.uvq02-liq *::before,.uvq02-liq *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

export default function ChkWater() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#139fd0",
          "--c2": "#6fe0f2",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-liq"><input type="checkbox" /><span className="bx"><i className="w2"></i><i className="w1"></i><i className="bu"></i><i className="bu"></i><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" pathLength="1" /></svg></span>Drink 2 litres of water</label>
      </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 “Water fill checkbox” block (Checkboxes) from AIMRAN Library to my project.

## What it is
Water rises in waves inside the box, lets out a couple of bubbles and then shows the tick on top.

## Chosen settings
- Main color: #139fd0
- Secondary color: #6fe0f2
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Beber 2 litros de agua"

## 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 = `
.uvq02-liq {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .75em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-weight: 550;
}

.uvq02-liq input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq02-liq .bx {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.1em;
  height: 2.1em;
  border-radius: .6em;
  overflow: hidden;
  isolation: isolate;
  background: color-mix(in srgb,var(--c1) 6%,transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--fg) 24%,transparent);
}

.uvq02-liq .bx::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(130deg,rgba(255,255,255,.55),transparent 35%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb,var(--c1) 0%,transparent);
  z-index: 3;
  pointer-events: none;
  transition: box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-liq .w1,.uvq02-liq .w2 {
  position: absolute;
  left: -95%;
  top: 115%;
  width: 290%;
  aspect-ratio: 1;
  border-radius: 42%;
  background: var(--c1);
  animation: uvq02-liq calc(5s / var(--k)) linear infinite;
  transition: top calc(0.9s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq02-liq .w2 {
  background: var(--c2);
  border-radius: 38%;
  animation-duration: calc(7s / var(--k));
  animation-direction: reverse;
}

.uvq02-liq .bu {
  position: absolute;
  bottom: .2em;
  left: 30%;
  width: .22em;
  height: .22em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.85);
  opacity: 0;
  z-index: 1;
}

.uvq02-liq .bu + .bu {
  left: 62%;
  width: .16em;
  height: .16em;
}

.uvq02-liq svg {
  position: relative;
  z-index: 2;
  width: 1.15em;
  height: 1.15em;
  color: #fff;
  transform: scale(0);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-liq:hover input:not(:checked) + .bx .w1 {
  top: 92%;
}

.uvq02-liq:hover input:not(:checked) + .bx .w2 {
  top: 88%;
}

.uvq02-liq:active .bx {
  scale: .94;
}

.uvq02-liq input:checked + .bx .w1 {
  top: 10%;
}

.uvq02-liq input:checked + .bx .w2 {
  top: 4%;
}

.uvq02-liq input:checked + .bx::after {
  box-shadow: inset 0 0 0 2px var(--c1);
}

.uvq02-liq input:checked + .bx svg {
  transform: scale(1);
  transition-delay: calc(0.45s / var(--k));
}

.uvq02-liq input:checked + .bx .bu {
  animation: uvq02-liq-b calc(1.2s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.3s / var(--k));
}

.uvq02-liq input:checked + .bx .bu + .bu {
  animation-delay: calc(0.55s / var(--k));
}

@keyframes uvq02-liq {
  to {
    transform: rotate(360deg);
  }
}

@keyframes uvq02-liq-b {
  0% {
    opacity: 0;
    transform: none;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(.15em,-1.6em);
  }
}

.uvq02-liq input:focus-visible + .bx {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq02-liq,.uvq02-liq *,.uvq02-liq *::before,.uvq02-liq *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

export default function ChkWater() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#139fd0",
          "--c2": "#6fe0f2",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-liq"><input type="checkbox" /><span className="bx"><i className="w2"></i><i className="w1"></i><i className="bu"></i><i className="bu"></i><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" pathLength="1" /></svg></span>Drink 2 litres of water</label>
      </div>
    </>
  );
}
```

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