# Water glass with straw

> A water intake counter: the level rises with each tap, and the straw and stripes look broken inside the water.

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

## Where to use it

A hydration tracker built around a glass tumbler in CSS. Behind it there is a striped wall, and inside the water the stripes appear wider and shifted, while the straw seems to snap at the surface, the classic refraction you see at any table. Each glass added pours in with a wobble of the meniscus and rising bubbles.

Change the water and straw colors, rename the label, and use the plus and minus buttons or tap the glass itself. Eight glasses fill it to the top, which makes it handy for health apps and daily habit trackers.

## Code

### HTML

```html
<div class="uvq11-wg" style="--lv:.375"><div class="gs"><i class="s1" aria-hidden="true"></i><button type="button" class="tb" aria-label="Add a glass"><span class="bk"></span><span class="wt"><span class="s2"></span><span class="wr"></span><span class="bb"><i style="--i:0"></i><i style="--i:1"></i><i style="--i:2"></i><i style="--i:3"></i><i style="--i:4"></i></span></span><span class="po"></span><span class="gw"></span></button></div><div class="cn"><p class="lb">Water today</p><p class="ct"><output class="n">3</output><span>/8</span></p><p class="un">glasses</p><div class="bt"><button type="button" class="ch mn" aria-label="Remove a glass"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/></svg></button><button type="button" class="ch pl" aria-label="Add a glass"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button></div></div></div>
```

### CSS

```css
.uvq11-wg {
  --c1: #38bdf8;
  --c2: #f97316;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq11-wg {
  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;
  width: 20em;
  height: 14em;
  border-radius: 1.6em;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
  --st: #1e3a5f;
  color: #1b2a3d;
  background: linear-gradient(180deg,transparent 80%,#d9c3a0 80%,#e8d6b8 83%,#cdb08a),repeating-linear-gradient(90deg,var(--st) 0 .72em,#f6f1e7 .72em 1.44em);
}

.uvq11-wg .gs {
  position: absolute;
  left: 2.2em;
  top: 2.4em;
  width: 6.6em;
  height: 9.1em;
}

.uvq11-wg .gs::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: -.35em;
  height: .7em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 .1em rgba(255,255,255,.85),0 0 0 1px rgba(30,58,95,.15);
  z-index: 2;
  pointer-events: none;
}

.uvq11-wg .gs::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: -.45em;
  height: .9em;
  border-radius: 50%;
  background: radial-gradient(closest-side,rgba(40,30,10,.35),transparent);
  z-index: -1;
}

.uvq11-wg .s1,.uvq11-wg .s2 {
  position: absolute;
  left: 56%;
  bottom: .6em;
  width: .5em;
  height: 10.4em;
  border-radius: .25em;
  transform-origin: 50% 100%;
  transform: rotate(14deg);
  background: repeating-linear-gradient(0deg,var(--c2) 0 .55em,#fff .55em 1.1em);
  box-shadow: inset -.12em 0 .1em rgba(0,0,0,.2),inset .1em 0 .1em rgba(255,255,255,.5);
}

.uvq11-wg .tb {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0,100% 0,91% 100%,9% 100%);
}

.uvq11-wg .tb:focus-visible {
  outline: 0;
}

.uvq11-wg .gs:has(.tb:focus-visible) {
  outline: 2px solid #1b2a3d;
  outline-offset: 6px;
  border-radius: .4em;
}

.uvq11-wg .bk {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.12);
}

.uvq11-wg .wt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(.7em + var(--lv) * 86%);
  overflow: hidden;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) 30%,transparent),color-mix(in srgb,var(--c1) 55%,transparent)),repeating-linear-gradient(90deg,var(--st) 0 1.15em,#f6f1e7 1.15em 2.3em) 50% 0;
  transition: height calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq11-wg .s2 {
  left: 56%;
  bottom: .6em;
  transform: translateX(.9em) rotate(14deg) scaleX(1.45);
  opacity: .92;
}

.uvq11-wg .wr {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: .5em;
  background: linear-gradient(180deg,rgba(255,255,255,.85),color-mix(in srgb,var(--c1) 45%,rgba(255,255,255,.3)));
  border-radius: 0 0 50% 50%/0 0 100% 100%;
  transform-origin: 50% 0;
}

.uvq11-wg.pour .wr {
  animation: uvq11-wg-w calc(0.9s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-wg .bb i {
  position: absolute;
  bottom: 0;
  left: calc(18% + var(--i) * 15%);
  width: .3em;
  height: .3em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
  animation: uvq11-wg-b calc(3s / var(--k)) linear infinite;
  animation-delay: calc(var(--i) * calc(-0.7s / var(--k)));
}

.uvq11-wg .po {
  position: absolute;
  left: 44%;
  top: 0;
  width: .45em;
  height: 100%;
  background: linear-gradient(90deg,color-mix(in srgb,var(--c1) 60%,#fff),var(--c1));
  transform: scaleY(0);
  transform-origin: 50% 0;
  opacity: .85;
}

.uvq11-wg.pour .po {
  animation: uvq11-wg-p calc(0.9s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-wg .gw {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,rgba(255,255,255,.55) 0 4%,rgba(255,255,255,.1) 11%,transparent 28% 70%,rgba(255,255,255,.22) 84%,rgba(255,255,255,.6) 93%,rgba(255,255,255,.15)),linear-gradient(0deg,rgba(255,255,255,.6) 0 .45em,rgba(255,255,255,.15) .8em,transparent 1.2em);
}

.uvq11-wg .cn {
  position: absolute;
  right: 1em;
  top: 1.6em;
  width: 7.2em;
  padding: .8em .9em;
  border-radius: 1.1em;
  box-sizing: border-box;
  background: rgba(255,255,255,.6);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9),inset 0 0 0 1px rgba(255,255,255,.5),0 .8em 1.6em -.8em rgba(20,30,50,.45);
}

.uvq11-wg .lb {
  margin: 0;
  font-size: .72em;
  font-weight: 700;
  opacity: .7;
}

.uvq11-wg .ct {
  margin: .1em 0 0;
  display: flex;
  align-items: baseline;
  gap: .15em;
}

.uvq11-wg .n {
  font-size: 2.6em;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb,var(--c1) 55%,#0b2540);
}

.uvq11-wg .ct span {
  font-size: 1em;
  font-weight: 700;
  opacity: .55;
}

.uvq11-wg .un {
  margin: 0 0 .6em;
  font-size: .72em;
  font-weight: 600;
  opacity: .7;
}

.uvq11-wg .bt {
  display: flex;
  gap: .4em;
}

.uvq11-wg .ch {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .55em 1em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 650;
  line-height: 1;
  color: #fff;
  background: rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(10px) saturate(1.7);
  backdrop-filter: blur(10px) saturate(1.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55),inset 0 -1px 0 rgba(255,255,255,.1),inset 0 0 0 1px rgba(255,255,255,.24),0 .5em 1.2em -.5em rgba(0,0,0,.45);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-wg .ch:hover {
  background: rgba(255,255,255,.28);
}

.uvq11-wg .ch:active {
  transform: scale(.92);
}

.uvq11-wg .ch:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.uvq11-wg .ch svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq11-wg .ch {
  flex: 1;
  padding: .6em 0;
  color: #fff;
  background: color-mix(in srgb,var(--c1) 75%,#0b2540);
}

.uvq11-wg .ch.mn {
  color: #1b2a3d;
  background: rgba(27,42,61,.1);
}

.uvq11-wg .ch:hover {
  background: color-mix(in srgb,var(--c1) 90%,#0b2540);
}

.uvq11-wg .ch.mn:hover {
  background: rgba(27,42,61,.18);
}

.uvq11-wg .ch:focus-visible {
  outline-color: #1b2a3d;
}

.uvq11-wg.full .n {
  color: #16a34a;
}

@keyframes uvq11-wg-p {
  0% {
    transform: scaleY(0);
  }
  35% {
    transform: scaleY(1);
  }
  70% {
    transform: scaleY(1);
    opacity: .85;
  }
  100% {
    transform: scaleY(1);
    opacity: 0;
  }
}

@keyframes uvq11-wg-w {
  0%,100% {
    transform: none;
  }
  25% {
    transform: scaleY(2.2) skewY(-3deg);
  }
  50% {
    transform: scaleY(.7) skewY(2deg);
  }
  75% {
    transform: scaleY(1.3);
  }
}

@keyframes uvq11-wg-b {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-7em);
    opacity: 0;
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq11-wg").forEach(el => {
  const rm=matchMedia("(prefers-reduced-motion: reduce)").matches;const n=el.querySelector(".n");let c=3,t=0;
const set=(v,p)=>{const o=c;c=Math.max(0,Math.min(8,v));n.textContent=String(c);el.style.setProperty("--lv",String(c/8));el.classList.toggle("full",c===8);if(p&&c>o&&!rm){el.classList.remove("pour");void el.offsetWidth;el.classList.add("pour");clearTimeout(t);t=setTimeout(()=>el.classList.remove("pour"),950)}};
el.querySelectorAll(".tb,.pl").forEach(b=>b.addEventListener("click",()=>set(c+1,true)));el.querySelector(".mn").addEventListener("click",()=>set(c-1,false));
return()=>clearTimeout(t)
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq11-wg {
  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;
  width: 20em;
  height: 14em;
  border-radius: 1.6em;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
  --st: #1e3a5f;
  color: #1b2a3d;
  background: linear-gradient(180deg,transparent 80%,#d9c3a0 80%,#e8d6b8 83%,#cdb08a),repeating-linear-gradient(90deg,var(--st) 0 .72em,#f6f1e7 .72em 1.44em);
}

.uvq11-wg .gs {
  position: absolute;
  left: 2.2em;
  top: 2.4em;
  width: 6.6em;
  height: 9.1em;
}

.uvq11-wg .gs::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: -.35em;
  height: .7em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 .1em rgba(255,255,255,.85),0 0 0 1px rgba(30,58,95,.15);
  z-index: 2;
  pointer-events: none;
}

.uvq11-wg .gs::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: -.45em;
  height: .9em;
  border-radius: 50%;
  background: radial-gradient(closest-side,rgba(40,30,10,.35),transparent);
  z-index: -1;
}

.uvq11-wg .s1,.uvq11-wg .s2 {
  position: absolute;
  left: 56%;
  bottom: .6em;
  width: .5em;
  height: 10.4em;
  border-radius: .25em;
  transform-origin: 50% 100%;
  transform: rotate(14deg);
  background: repeating-linear-gradient(0deg,var(--c2) 0 .55em,#fff .55em 1.1em);
  box-shadow: inset -.12em 0 .1em rgba(0,0,0,.2),inset .1em 0 .1em rgba(255,255,255,.5);
}

.uvq11-wg .tb {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0,100% 0,91% 100%,9% 100%);
}

.uvq11-wg .tb:focus-visible {
  outline: 0;
}

.uvq11-wg .gs:has(.tb:focus-visible) {
  outline: 2px solid #1b2a3d;
  outline-offset: 6px;
  border-radius: .4em;
}

.uvq11-wg .bk {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.12);
}

.uvq11-wg .wt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(.7em + var(--lv) * 86%);
  overflow: hidden;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) 30%,transparent),color-mix(in srgb,var(--c1) 55%,transparent)),repeating-linear-gradient(90deg,var(--st) 0 1.15em,#f6f1e7 1.15em 2.3em) 50% 0;
  transition: height calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq11-wg .s2 {
  left: 56%;
  bottom: .6em;
  transform: translateX(.9em) rotate(14deg) scaleX(1.45);
  opacity: .92;
}

.uvq11-wg .wr {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: .5em;
  background: linear-gradient(180deg,rgba(255,255,255,.85),color-mix(in srgb,var(--c1) 45%,rgba(255,255,255,.3)));
  border-radius: 0 0 50% 50%/0 0 100% 100%;
  transform-origin: 50% 0;
}

.uvq11-wg.pour .wr {
  animation: uvq11-wg-w calc(0.9s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-wg .bb i {
  position: absolute;
  bottom: 0;
  left: calc(18% + var(--i) * 15%);
  width: .3em;
  height: .3em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
  animation: uvq11-wg-b calc(3s / var(--k)) linear infinite;
  animation-delay: calc(var(--i) * calc(-0.7s / var(--k)));
}

.uvq11-wg .po {
  position: absolute;
  left: 44%;
  top: 0;
  width: .45em;
  height: 100%;
  background: linear-gradient(90deg,color-mix(in srgb,var(--c1) 60%,#fff),var(--c1));
  transform: scaleY(0);
  transform-origin: 50% 0;
  opacity: .85;
}

.uvq11-wg.pour .po {
  animation: uvq11-wg-p calc(0.9s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-wg .gw {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,rgba(255,255,255,.55) 0 4%,rgba(255,255,255,.1) 11%,transparent 28% 70%,rgba(255,255,255,.22) 84%,rgba(255,255,255,.6) 93%,rgba(255,255,255,.15)),linear-gradient(0deg,rgba(255,255,255,.6) 0 .45em,rgba(255,255,255,.15) .8em,transparent 1.2em);
}

.uvq11-wg .cn {
  position: absolute;
  right: 1em;
  top: 1.6em;
  width: 7.2em;
  padding: .8em .9em;
  border-radius: 1.1em;
  box-sizing: border-box;
  background: rgba(255,255,255,.6);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9),inset 0 0 0 1px rgba(255,255,255,.5),0 .8em 1.6em -.8em rgba(20,30,50,.45);
}

.uvq11-wg .lb {
  margin: 0;
  font-size: .72em;
  font-weight: 700;
  opacity: .7;
}

.uvq11-wg .ct {
  margin: .1em 0 0;
  display: flex;
  align-items: baseline;
  gap: .15em;
}

.uvq11-wg .n {
  font-size: 2.6em;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb,var(--c1) 55%,#0b2540);
}

.uvq11-wg .ct span {
  font-size: 1em;
  font-weight: 700;
  opacity: .55;
}

.uvq11-wg .un {
  margin: 0 0 .6em;
  font-size: .72em;
  font-weight: 600;
  opacity: .7;
}

.uvq11-wg .bt {
  display: flex;
  gap: .4em;
}

.uvq11-wg .ch {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .55em 1em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 650;
  line-height: 1;
  color: #fff;
  background: rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(10px) saturate(1.7);
  backdrop-filter: blur(10px) saturate(1.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55),inset 0 -1px 0 rgba(255,255,255,.1),inset 0 0 0 1px rgba(255,255,255,.24),0 .5em 1.2em -.5em rgba(0,0,0,.45);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-wg .ch:hover {
  background: rgba(255,255,255,.28);
}

.uvq11-wg .ch:active {
  transform: scale(.92);
}

.uvq11-wg .ch:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.uvq11-wg .ch svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq11-wg .ch {
  flex: 1;
  padding: .6em 0;
  color: #fff;
  background: color-mix(in srgb,var(--c1) 75%,#0b2540);
}

.uvq11-wg .ch.mn {
  color: #1b2a3d;
  background: rgba(27,42,61,.1);
}

.uvq11-wg .ch:hover {
  background: color-mix(in srgb,var(--c1) 90%,#0b2540);
}

.uvq11-wg .ch.mn:hover {
  background: rgba(27,42,61,.18);
}

.uvq11-wg .ch:focus-visible {
  outline-color: #1b2a3d;
}

.uvq11-wg.full .n {
  color: #16a34a;
}

@keyframes uvq11-wg-p {
  0% {
    transform: scaleY(0);
  }
  35% {
    transform: scaleY(1);
  }
  70% {
    transform: scaleY(1);
    opacity: .85;
  }
  100% {
    transform: scaleY(1);
    opacity: 0;
  }
}

@keyframes uvq11-wg-w {
  0%,100% {
    transform: none;
  }
  25% {
    transform: scaleY(2.2) skewY(-3deg);
  }
  50% {
    transform: scaleY(.7) skewY(2deg);
  }
  75% {
    transform: scaleY(1.3);
  }
}

@keyframes uvq11-wg-b {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-7em);
    opacity: 0;
  }
}

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

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const rm=matchMedia("(prefers-reduced-motion: reduce)").matches;const n=el.querySelector(".n");let c=3,t=0;
const set=(v,p)=>{const o=c;c=Math.max(0,Math.min(8,v));n.textContent=String(c);el.style.setProperty("--lv",String(c/8));el.classList.toggle("full",c===8);if(p&&c>o&&!rm){el.classList.remove("pour");void el.offsetWidth;el.classList.add("pour");clearTimeout(t);t=setTimeout(()=>el.classList.remove("pour"),950)}};
el.querySelectorAll(".tb,.pl").forEach(b=>b.addEventListener("click",()=>set(c+1,true)));el.querySelector(".mn").addEventListener("click",()=>set(c-1,false));
return()=>clearTimeout(t)
}

export default function LgWaterGlass() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#38bdf8",
          "--c2": "#f97316",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq11-wg" style={{ "--lv": ".375" } as CSSProperties}><div className="gs"><i className="s1" aria-hidden="true"></i><button type="button" className="tb" aria-label="Add a glass"><span className="bk"></span><span className="wt"><span className="s2"></span><span className="wr"></span><span className="bb"><i style={{ "--i": "0" } as CSSProperties}></i><i style={{ "--i": "1" } as CSSProperties}></i><i style={{ "--i": "2" } as CSSProperties}></i><i style={{ "--i": "3" } as CSSProperties}></i><i style={{ "--i": "4" } as CSSProperties}></i></span></span><span className="po"></span><span className="gw"></span></button></div><div className="cn"><p className="lb">Water today</p><p className="ct"><output className="n">3</output><span>/8</span></p><p className="un">glasses</p><div className="bt"><button type="button" className="ch mn" aria-label="Remove a glass"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 12h14" /></svg></button><button type="button" className="ch pl" aria-label="Add a glass"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14" /></svg></button></div></div></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 “Water glass with straw” block (Liquid Glass) from AIMRAN Library to my project.

## What it is
A water intake counter: the level rises with each tap, and the straw and stripes look broken inside the water.

## Chosen settings
- Main color: #38bdf8
- Secondary color: #f97316
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Agua de hoy"

## 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: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq11-wg {
  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;
  width: 20em;
  height: 14em;
  border-radius: 1.6em;
  overflow: hidden;
  color: #fff;
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
  --st: #1e3a5f;
  color: #1b2a3d;
  background: linear-gradient(180deg,transparent 80%,#d9c3a0 80%,#e8d6b8 83%,#cdb08a),repeating-linear-gradient(90deg,var(--st) 0 .72em,#f6f1e7 .72em 1.44em);
}

.uvq11-wg .gs {
  position: absolute;
  left: 2.2em;
  top: 2.4em;
  width: 6.6em;
  height: 9.1em;
}

.uvq11-wg .gs::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: -.35em;
  height: .7em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 .1em rgba(255,255,255,.85),0 0 0 1px rgba(30,58,95,.15);
  z-index: 2;
  pointer-events: none;
}

.uvq11-wg .gs::after {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: -.45em;
  height: .9em;
  border-radius: 50%;
  background: radial-gradient(closest-side,rgba(40,30,10,.35),transparent);
  z-index: -1;
}

.uvq11-wg .s1,.uvq11-wg .s2 {
  position: absolute;
  left: 56%;
  bottom: .6em;
  width: .5em;
  height: 10.4em;
  border-radius: .25em;
  transform-origin: 50% 100%;
  transform: rotate(14deg);
  background: repeating-linear-gradient(0deg,var(--c2) 0 .55em,#fff .55em 1.1em);
  box-shadow: inset -.12em 0 .1em rgba(0,0,0,.2),inset .1em 0 .1em rgba(255,255,255,.5);
}

.uvq11-wg .tb {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0,100% 0,91% 100%,9% 100%);
}

.uvq11-wg .tb:focus-visible {
  outline: 0;
}

.uvq11-wg .gs:has(.tb:focus-visible) {
  outline: 2px solid #1b2a3d;
  outline-offset: 6px;
  border-radius: .4em;
}

.uvq11-wg .bk {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.12);
}

.uvq11-wg .wt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(.7em + var(--lv) * 86%);
  overflow: hidden;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) 30%,transparent),color-mix(in srgb,var(--c1) 55%,transparent)),repeating-linear-gradient(90deg,var(--st) 0 1.15em,#f6f1e7 1.15em 2.3em) 50% 0;
  transition: height calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq11-wg .s2 {
  left: 56%;
  bottom: .6em;
  transform: translateX(.9em) rotate(14deg) scaleX(1.45);
  opacity: .92;
}

.uvq11-wg .wr {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: .5em;
  background: linear-gradient(180deg,rgba(255,255,255,.85),color-mix(in srgb,var(--c1) 45%,rgba(255,255,255,.3)));
  border-radius: 0 0 50% 50%/0 0 100% 100%;
  transform-origin: 50% 0;
}

.uvq11-wg.pour .wr {
  animation: uvq11-wg-w calc(0.9s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-wg .bb i {
  position: absolute;
  bottom: 0;
  left: calc(18% + var(--i) * 15%);
  width: .3em;
  height: .3em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
  animation: uvq11-wg-b calc(3s / var(--k)) linear infinite;
  animation-delay: calc(var(--i) * calc(-0.7s / var(--k)));
}

.uvq11-wg .po {
  position: absolute;
  left: 44%;
  top: 0;
  width: .45em;
  height: 100%;
  background: linear-gradient(90deg,color-mix(in srgb,var(--c1) 60%,#fff),var(--c1));
  transform: scaleY(0);
  transform-origin: 50% 0;
  opacity: .85;
}

.uvq11-wg.pour .po {
  animation: uvq11-wg-p calc(0.9s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-wg .gw {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,rgba(255,255,255,.55) 0 4%,rgba(255,255,255,.1) 11%,transparent 28% 70%,rgba(255,255,255,.22) 84%,rgba(255,255,255,.6) 93%,rgba(255,255,255,.15)),linear-gradient(0deg,rgba(255,255,255,.6) 0 .45em,rgba(255,255,255,.15) .8em,transparent 1.2em);
}

.uvq11-wg .cn {
  position: absolute;
  right: 1em;
  top: 1.6em;
  width: 7.2em;
  padding: .8em .9em;
  border-radius: 1.1em;
  box-sizing: border-box;
  background: rgba(255,255,255,.6);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9),inset 0 0 0 1px rgba(255,255,255,.5),0 .8em 1.6em -.8em rgba(20,30,50,.45);
}

.uvq11-wg .lb {
  margin: 0;
  font-size: .72em;
  font-weight: 700;
  opacity: .7;
}

.uvq11-wg .ct {
  margin: .1em 0 0;
  display: flex;
  align-items: baseline;
  gap: .15em;
}

.uvq11-wg .n {
  font-size: 2.6em;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb,var(--c1) 55%,#0b2540);
}

.uvq11-wg .ct span {
  font-size: 1em;
  font-weight: 700;
  opacity: .55;
}

.uvq11-wg .un {
  margin: 0 0 .6em;
  font-size: .72em;
  font-weight: 600;
  opacity: .7;
}

.uvq11-wg .bt {
  display: flex;
  gap: .4em;
}

.uvq11-wg .ch {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .55em 1em;
  border-radius: 2em;
  font-size: .78em;
  font-weight: 650;
  line-height: 1;
  color: #fff;
  background: rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(10px) saturate(1.7);
  backdrop-filter: blur(10px) saturate(1.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55),inset 0 -1px 0 rgba(255,255,255,.1),inset 0 0 0 1px rgba(255,255,255,.24),0 .5em 1.2em -.5em rgba(0,0,0,.45);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-wg .ch:hover {
  background: rgba(255,255,255,.28);
}

.uvq11-wg .ch:active {
  transform: scale(.92);
}

.uvq11-wg .ch:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.uvq11-wg .ch svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq11-wg .ch {
  flex: 1;
  padding: .6em 0;
  color: #fff;
  background: color-mix(in srgb,var(--c1) 75%,#0b2540);
}

.uvq11-wg .ch.mn {
  color: #1b2a3d;
  background: rgba(27,42,61,.1);
}

.uvq11-wg .ch:hover {
  background: color-mix(in srgb,var(--c1) 90%,#0b2540);
}

.uvq11-wg .ch.mn:hover {
  background: rgba(27,42,61,.18);
}

.uvq11-wg .ch:focus-visible {
  outline-color: #1b2a3d;
}

.uvq11-wg.full .n {
  color: #16a34a;
}

@keyframes uvq11-wg-p {
  0% {
    transform: scaleY(0);
  }
  35% {
    transform: scaleY(1);
  }
  70% {
    transform: scaleY(1);
    opacity: .85;
  }
  100% {
    transform: scaleY(1);
    opacity: 0;
  }
}

@keyframes uvq11-wg-w {
  0%,100% {
    transform: none;
  }
  25% {
    transform: scaleY(2.2) skewY(-3deg);
  }
  50% {
    transform: scaleY(.7) skewY(2deg);
  }
  75% {
    transform: scaleY(1.3);
  }
}

@keyframes uvq11-wg-b {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-7em);
    opacity: 0;
  }
}

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

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const rm=matchMedia("(prefers-reduced-motion: reduce)").matches;const n=el.querySelector(".n");let c=3,t=0;
const set=(v,p)=>{const o=c;c=Math.max(0,Math.min(8,v));n.textContent=String(c);el.style.setProperty("--lv",String(c/8));el.classList.toggle("full",c===8);if(p&&c>o&&!rm){el.classList.remove("pour");void el.offsetWidth;el.classList.add("pour");clearTimeout(t);t=setTimeout(()=>el.classList.remove("pour"),950)}};
el.querySelectorAll(".tb,.pl").forEach(b=>b.addEventListener("click",()=>set(c+1,true)));el.querySelector(".mn").addEventListener("click",()=>set(c-1,false));
return()=>clearTimeout(t)
}

export default function LgWaterGlass() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#38bdf8",
          "--c2": "#f97316",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq11-wg" style={{ "--lv": ".375" } as CSSProperties}><div className="gs"><i className="s1" aria-hidden="true"></i><button type="button" className="tb" aria-label="Add a glass"><span className="bk"></span><span className="wt"><span className="s2"></span><span className="wr"></span><span className="bb"><i style={{ "--i": "0" } as CSSProperties}></i><i style={{ "--i": "1" } as CSSProperties}></i><i style={{ "--i": "2" } as CSSProperties}></i><i style={{ "--i": "3" } as CSSProperties}></i><i style={{ "--i": "4" } as CSSProperties}></i></span></span><span className="po"></span><span className="gw"></span></button></div><div className="cn"><p className="lb">Water today</p><p className="ct"><output className="n">3</output><span>/8</span></p><p className="un">glasses</p><div className="bt"><button type="button" className="ch mn" aria-label="Remove a glass"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 12h14" /></svg></button><button type="button" className="ch pl" aria-label="Add a glass"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14" /></svg></button></div></div></div>
      </div>
    </>
  );
}
```

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