# Submarine porthole

> A brass porthole with thick glass that bends the sea at the edges; go deeper and the jellyfish arrive.

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

## Where to use it

A riveted hull with a brass porthole and eight bolts, looking out onto the open sea. The view is slightly magnified and a ring of stronger blur at the rim imitates thick, curved glass, with curved reflections on top. Light rays, fish, drifting particles and glowing jellyfish all react to the depth you set.

Drag the depth slider from the surface to two hundred meters to darken the water, fade the sunbeams and bring out the bioluminescence. Recolor the shallow water and the brass for diving schools, aquariums or ocean education.

## Code

### HTML

```html
<div class="uvq11-port" style="--dp:.25"><div class="ph"><div class="gl"><div class="sea" aria-hidden="true"><i class="ry"></i><span class="fs"><svg viewBox="0 0 24 12" style="top:30%;--sz:1.6em;--dl:0"><path d="M2 6c4-5 11-5 16 0-5 5-12 5-16 0zM18 6l5-4v8z"/></svg><svg viewBox="0 0 24 12" style="top:44%;--sz:3em;--dl:-3"><path d="M2 6c4-5 11-5 16 0-5 5-12 5-16 0zM18 6l5-4v8z"/></svg><svg viewBox="0 0 24 12" style="top:58%;--sz:2.2em;--dl:-6"><path d="M2 6c4-5 11-5 16 0-5 5-12 5-16 0zM18 6l5-4v8z"/></svg><svg viewBox="0 0 24 12" style="top:70%;--sz:1.1em;--dl:-2"><path d="M2 6c4-5 11-5 16 0-5 5-12 5-16 0zM18 6l5-4v8z"/></svg></span><i class="jf"></i><i class="jf b"></i><span class="sn"><i style="left:0%;--d:10.3;--dl:-8.2"></i><i style="left:96%;--d:11.6;--dl:-8.5"></i><i style="left:61%;--d:11.0;--dl:-8.3"></i><i style="left:15%;--d:11.9;--dl:-7.5"></i><i style="left:80%;--d:8.7;--dl:-7.0"></i><i style="left:89%;--d:10.3;--dl:-1.0"></i><i style="left:98%;--d:11.2;--dl:-4.3"></i><i style="left:93%;--d:9.9;--dl:-1.0"></i><i style="left:0%;--d:11.1;--dl:-2.0"></i><i style="left:50%;--d:8.4;--dl:-1.2"></i><i style="left:83%;--d:11.5;--dl:-4.1"></i><i style="left:62%;--d:9.4;--dl:-2.7"></i><i style="left:22%;--d:11.0;--dl:-8.8"></i><i style="left:75%;--d:7.3;--dl:-7.7"></i><i style="left:39%;--d:10.8;--dl:-4.7"></i><i style="left:94%;--d:7.3;--dl:-5.0"></i></span></div><i class="rim"></i><i class="rf"></i></div><i class="bt" style="--i:0"></i><i class="bt" style="--i:1"></i><i class="bt" style="--i:2"></i><i class="bt" style="--i:3"></i><i class="bt" style="--i:4"></i><i class="bt" style="--i:5"></i><i class="bt" style="--i:6"></i><i class="bt" style="--i:7"></i></div><div class="pn"><p class="lb">Depth</p><output class="dv">50 m</output><input type="range" min="0" max="200" value="50" aria-label="Depth"><p class="zn"><span class="z1">Sunlit zone</span><span class="z2">Twilight zone</span></p></div></div>
```

### CSS

```css
.uvq11-port {
  --c1: #0ea5e9;
  --c2: #c08a3e;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq11-port {
  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;
  background: radial-gradient(circle,#7d8a95 0 .12em,transparent .16em) .5em .5em/1.4em 7em,linear-gradient(180deg,transparent 49.6%,rgba(0,0,0,.35) 49.6% 50.4%,transparent 50.4%),linear-gradient(160deg,#5b6873,#3a444e);
}

.uvq11-port .ph {
  position: absolute;
  left: .9em;
  top: 1.8em;
  width: 10.4em;
  height: 10.4em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%,#f6dc9a,var(--c2) 45%,#5e3f15 100%);
  box-shadow: 0 .8em 1.4em -.4em rgba(0,0,0,.65),inset 0 0 0 .12em rgba(255,240,200,.45);
}

.uvq11-port .bt {
  position: absolute;
  left: 50%;
  top: 50%;
  width: .55em;
  height: .55em;
  margin: -.275em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff1c6,#9a7330 60%,#4a3210);
  transform: rotate(calc(var(--i) * 45deg + 22.5deg)) translateY(-4.65em);
}

.uvq11-port .gl {
  position: absolute;
  inset: 1.2em;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 .22em #3d2a0e,0 0 0 .3em rgba(255,230,180,.35);
}

.uvq11-port .sea {
  position: absolute;
  inset: 0;
  transform: scale(1.12);
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) calc(100% - var(--dp) * 88%),#020814),color-mix(in srgb,color-mix(in srgb,var(--c1) 55%,#03183a) calc(100% - var(--dp) * 95%),#01040c));
  transition: background calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-port .ry {
  position: absolute;
  left: -30%;
  right: -30%;
  top: -10%;
  height: 90%;
  background: repeating-conic-gradient(from 160deg at 50% 0,rgba(255,255,255,.22) 0 3deg,transparent 3deg 9deg);
  -webkit-mask: linear-gradient(#000,transparent);
  mask: linear-gradient(#000,transparent);
  opacity: calc(.9 - var(--dp) * 1.6);
  animation: uvq11-port-r calc(6s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite alternate;
}

.uvq11-port .fs svg {
  position: absolute;
  left: 0;
  width: var(--sz);
  fill: color-mix(in srgb,var(--c1) 30%,#04223a);
  opacity: calc(1 - var(--dp) * 1.5);
  animation: uvq11-port-f calc(9s / var(--k)) linear infinite;
  animation-delay: calc(var(--dl) * 1s / var(--k));
}

.uvq11-port .jf {
  position: absolute;
  left: 58%;
  top: 34%;
  width: 1.6em;
  height: 1.1em;
  border-radius: 50% 50% 20% 20%;
  background: radial-gradient(circle at 50% 70%,rgba(255,170,240,.9),rgba(200,110,255,.4) 60%,transparent 72%);
  box-shadow: 0 0 1em rgba(230,140,255,.6);
  opacity: calc((var(--dp) - .4) * 2.4);
  animation: uvq11-port-j calc(3s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite;
}

.uvq11-port .jf::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  top: 80%;
  height: 1.4em;
  background: repeating-linear-gradient(90deg,rgba(255,180,250,.6) 0 1px,transparent 1px .25em);
  -webkit-mask: linear-gradient(#000,transparent);
  mask: linear-gradient(#000,transparent);
}

.uvq11-port .jf.b {
  left: 24%;
  top: 58%;
  transform: scale(.6);
  animation-delay: calc(-1.4s / var(--k));
}

.uvq11-port .sn i {
  position: absolute;
  bottom: -5%;
  width: .16em;
  height: .16em;
  border-radius: 50%;
  background: rgba(220,240,255,.7);
  animation: uvq11-port-s calc(var(--d) * 1s / var(--k)) linear infinite;
  animation-delay: calc(var(--dl) * 1s / var(--k));
}

.uvq11-port.mv .sn i {
  animation-duration: calc(var(--d) * .25s / var(--k));
}

.uvq11-port .rim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  -webkit-backdrop-filter: blur(2.5px) brightness(1.15) saturate(1.4);
  backdrop-filter: blur(2.5px) brightness(1.15) saturate(1.4);
  -webkit-mask: radial-gradient(closest-side,transparent 68%,#000 92%);
  mask: radial-gradient(closest-side,transparent 68%,#000 92%);
}

.uvq11-port .rf {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(60% 35% at 40% 18%,rgba(255,255,255,.35),transparent 70%),radial-gradient(circle at 72% 78%,rgba(255,255,255,.18),transparent 22%);
  box-shadow: inset 0 0 1.4em rgba(0,0,0,.55),inset 0 .25em .3em -.1em rgba(255,255,255,.45);
}

.uvq11-port .rf::after {
  content: "";
  position: absolute;
  left: 18%;
  top: 14%;
  width: 28%;
  height: 12%;
  border-radius: 50%;
  border-top: .18em solid rgba(255,255,255,.75);
  transform: rotate(-28deg);
  filter: blur(.5px);
}

.uvq11-port .pn {
  position: absolute;
  left: 12.2em;
  top: 2.6em;
  width: 7em;
}

.uvq11-port .lb {
  margin: 0;
  font-size: .62em;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .7;
}

.uvq11-port .dv {
  display: block;
  margin: .05em 0 .5em;
  font-size: 2.1em;
  font-weight: 250;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.uvq11-port input {
  width: 100%;
  height: 1.6em;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  cursor: pointer;
}

.uvq11-port input::-webkit-slider-runnable-track {
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c1),#01040c);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}

.uvq11-port input::-moz-range-track {
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c1),#01040c);
}

.uvq11-port input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.3em;
  height: 1.3em;
  margin-top: -.45em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff1c6,var(--c2) 60%,#5e3f15);
  box-shadow: 0 .15em .35em rgba(0,0,0,.5);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq11-port input::-moz-range-thumb {
  width: 1.3em;
  height: 1.3em;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff1c6,var(--c2) 60%,#5e3f15);
}

.uvq11-port input:active::-webkit-slider-thumb {
  transform: scale(1.2);
}

.uvq11-port input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 1em;
}

.uvq11-port .zn {
  margin: .5em 0 0;
  font-size: .72em;
  font-weight: 600;
  opacity: .85;
}

.uvq11-port .z2,.uvq11-port.deep .z1 {
  display: none;
}

.uvq11-port.deep .z2 {
  display: inline;
}

@keyframes uvq11-port-r {
  to {
    transform: rotate(6deg);
  }
}

@keyframes uvq11-port-f {
  from {
    transform: translateX(-2em);
  }
  to {
    transform: translateX(10em);
  }
}

@keyframes uvq11-port-j {
  50% {
    transform: translateY(-.4em) scaleX(.85);
  }
}

.uvq11-port .jf.b {
  animation-name: uvq11-port-j2;
}

@keyframes uvq11-port-j2 {
  0%,100% {
    transform: scale(.6);
  }
  50% {
    transform: scale(.6) translateY(-.4em) scaleX(.85);
  }
}

@keyframes uvq11-port-s {
  to {
    transform: translateY(-9em);
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq11-port").forEach(el => {
  const r=el.querySelector("input"),dv=el.querySelector(".dv");let t=0;const set=()=>{const v=+r.value;el.style.setProperty("--dp",(v/200).toFixed(3));dv.textContent=v+" m";el.classList.toggle("deep",v>=90)};r.addEventListener("input",()=>{set();el.classList.add("mv");clearTimeout(t);t=setTimeout(()=>el.classList.remove("mv"),500)});set();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-port {
  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;
  background: radial-gradient(circle,#7d8a95 0 .12em,transparent .16em) .5em .5em/1.4em 7em,linear-gradient(180deg,transparent 49.6%,rgba(0,0,0,.35) 49.6% 50.4%,transparent 50.4%),linear-gradient(160deg,#5b6873,#3a444e);
}

.uvq11-port .ph {
  position: absolute;
  left: .9em;
  top: 1.8em;
  width: 10.4em;
  height: 10.4em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%,#f6dc9a,var(--c2) 45%,#5e3f15 100%);
  box-shadow: 0 .8em 1.4em -.4em rgba(0,0,0,.65),inset 0 0 0 .12em rgba(255,240,200,.45);
}

.uvq11-port .bt {
  position: absolute;
  left: 50%;
  top: 50%;
  width: .55em;
  height: .55em;
  margin: -.275em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff1c6,#9a7330 60%,#4a3210);
  transform: rotate(calc(var(--i) * 45deg + 22.5deg)) translateY(-4.65em);
}

.uvq11-port .gl {
  position: absolute;
  inset: 1.2em;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 .22em #3d2a0e,0 0 0 .3em rgba(255,230,180,.35);
}

.uvq11-port .sea {
  position: absolute;
  inset: 0;
  transform: scale(1.12);
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) calc(100% - var(--dp) * 88%),#020814),color-mix(in srgb,color-mix(in srgb,var(--c1) 55%,#03183a) calc(100% - var(--dp) * 95%),#01040c));
  transition: background calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-port .ry {
  position: absolute;
  left: -30%;
  right: -30%;
  top: -10%;
  height: 90%;
  background: repeating-conic-gradient(from 160deg at 50% 0,rgba(255,255,255,.22) 0 3deg,transparent 3deg 9deg);
  -webkit-mask: linear-gradient(#000,transparent);
  mask: linear-gradient(#000,transparent);
  opacity: calc(.9 - var(--dp) * 1.6);
  animation: uvq11-port-r calc(6s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite alternate;
}

.uvq11-port .fs svg {
  position: absolute;
  left: 0;
  width: var(--sz);
  fill: color-mix(in srgb,var(--c1) 30%,#04223a);
  opacity: calc(1 - var(--dp) * 1.5);
  animation: uvq11-port-f calc(9s / var(--k)) linear infinite;
  animation-delay: calc(var(--dl) * 1s / var(--k));
}

.uvq11-port .jf {
  position: absolute;
  left: 58%;
  top: 34%;
  width: 1.6em;
  height: 1.1em;
  border-radius: 50% 50% 20% 20%;
  background: radial-gradient(circle at 50% 70%,rgba(255,170,240,.9),rgba(200,110,255,.4) 60%,transparent 72%);
  box-shadow: 0 0 1em rgba(230,140,255,.6);
  opacity: calc((var(--dp) - .4) * 2.4);
  animation: uvq11-port-j calc(3s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite;
}

.uvq11-port .jf::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  top: 80%;
  height: 1.4em;
  background: repeating-linear-gradient(90deg,rgba(255,180,250,.6) 0 1px,transparent 1px .25em);
  -webkit-mask: linear-gradient(#000,transparent);
  mask: linear-gradient(#000,transparent);
}

.uvq11-port .jf.b {
  left: 24%;
  top: 58%;
  transform: scale(.6);
  animation-delay: calc(-1.4s / var(--k));
}

.uvq11-port .sn i {
  position: absolute;
  bottom: -5%;
  width: .16em;
  height: .16em;
  border-radius: 50%;
  background: rgba(220,240,255,.7);
  animation: uvq11-port-s calc(var(--d) * 1s / var(--k)) linear infinite;
  animation-delay: calc(var(--dl) * 1s / var(--k));
}

.uvq11-port.mv .sn i {
  animation-duration: calc(var(--d) * .25s / var(--k));
}

.uvq11-port .rim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  -webkit-backdrop-filter: blur(2.5px) brightness(1.15) saturate(1.4);
  backdrop-filter: blur(2.5px) brightness(1.15) saturate(1.4);
  -webkit-mask: radial-gradient(closest-side,transparent 68%,#000 92%);
  mask: radial-gradient(closest-side,transparent 68%,#000 92%);
}

.uvq11-port .rf {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(60% 35% at 40% 18%,rgba(255,255,255,.35),transparent 70%),radial-gradient(circle at 72% 78%,rgba(255,255,255,.18),transparent 22%);
  box-shadow: inset 0 0 1.4em rgba(0,0,0,.55),inset 0 .25em .3em -.1em rgba(255,255,255,.45);
}

.uvq11-port .rf::after {
  content: "";
  position: absolute;
  left: 18%;
  top: 14%;
  width: 28%;
  height: 12%;
  border-radius: 50%;
  border-top: .18em solid rgba(255,255,255,.75);
  transform: rotate(-28deg);
  filter: blur(.5px);
}

.uvq11-port .pn {
  position: absolute;
  left: 12.2em;
  top: 2.6em;
  width: 7em;
}

.uvq11-port .lb {
  margin: 0;
  font-size: .62em;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .7;
}

.uvq11-port .dv {
  display: block;
  margin: .05em 0 .5em;
  font-size: 2.1em;
  font-weight: 250;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.uvq11-port input {
  width: 100%;
  height: 1.6em;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  cursor: pointer;
}

.uvq11-port input::-webkit-slider-runnable-track {
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c1),#01040c);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}

.uvq11-port input::-moz-range-track {
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c1),#01040c);
}

.uvq11-port input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.3em;
  height: 1.3em;
  margin-top: -.45em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff1c6,var(--c2) 60%,#5e3f15);
  box-shadow: 0 .15em .35em rgba(0,0,0,.5);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq11-port input::-moz-range-thumb {
  width: 1.3em;
  height: 1.3em;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff1c6,var(--c2) 60%,#5e3f15);
}

.uvq11-port input:active::-webkit-slider-thumb {
  transform: scale(1.2);
}

.uvq11-port input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 1em;
}

.uvq11-port .zn {
  margin: .5em 0 0;
  font-size: .72em;
  font-weight: 600;
  opacity: .85;
}

.uvq11-port .z2,.uvq11-port.deep .z1 {
  display: none;
}

.uvq11-port.deep .z2 {
  display: inline;
}

@keyframes uvq11-port-r {
  to {
    transform: rotate(6deg);
  }
}

@keyframes uvq11-port-f {
  from {
    transform: translateX(-2em);
  }
  to {
    transform: translateX(10em);
  }
}

@keyframes uvq11-port-j {
  50% {
    transform: translateY(-.4em) scaleX(.85);
  }
}

.uvq11-port .jf.b {
  animation-name: uvq11-port-j2;
}

@keyframes uvq11-port-j2 {
  0%,100% {
    transform: scale(.6);
  }
  50% {
    transform: scale(.6) translateY(-.4em) scaleX(.85);
  }
}

@keyframes uvq11-port-s {
  to {
    transform: translateY(-9em);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq11-port,.uvq11-port *,.uvq11-port *::before,.uvq11-port *::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 r=el.querySelector("input"),dv=el.querySelector(".dv");let t=0;const set=()=>{const v=+r.value;el.style.setProperty("--dp",(v/200).toFixed(3));dv.textContent=v+" m";el.classList.toggle("deep",v>=90)};r.addEventListener("input",()=>{set();el.classList.add("mv");clearTimeout(t);t=setTimeout(()=>el.classList.remove("mv"),500)});set();return()=>clearTimeout(t)
}

export default function LgPorthole() {
  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": "#0ea5e9",
          "--c2": "#c08a3e",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq11-port" style={{ "--dp": ".25" } as CSSProperties}><div className="ph"><div className="gl"><div className="sea" aria-hidden="true"><i className="ry"></i><span className="fs"><svg viewBox="0 0 24 12" style={{ top: "30%", "--sz": "1.6em", "--dl": "0" } as CSSProperties}><path d="M2 6c4-5 11-5 16 0-5 5-12 5-16 0zM18 6l5-4v8z" /></svg><svg viewBox="0 0 24 12" style={{ top: "44%", "--sz": "3em", "--dl": "-3" } as CSSProperties}><path d="M2 6c4-5 11-5 16 0-5 5-12 5-16 0zM18 6l5-4v8z" /></svg><svg viewBox="0 0 24 12" style={{ top: "58%", "--sz": "2.2em", "--dl": "-6" } as CSSProperties}><path d="M2 6c4-5 11-5 16 0-5 5-12 5-16 0zM18 6l5-4v8z" /></svg><svg viewBox="0 0 24 12" style={{ top: "70%", "--sz": "1.1em", "--dl": "-2" } as CSSProperties}><path d="M2 6c4-5 11-5 16 0-5 5-12 5-16 0zM18 6l5-4v8z" /></svg></span><i className="jf"></i><i className="jf b"></i><span className="sn"><i style={{ left: "0%", "--d": "10.3", "--dl": "-8.2" } as CSSProperties}></i><i style={{ left: "96%", "--d": "11.6", "--dl": "-8.5" } as CSSProperties}></i><i style={{ left: "61%", "--d": "11.0", "--dl": "-8.3" } as CSSProperties}></i><i style={{ left: "15%", "--d": "11.9", "--dl": "-7.5" } as CSSProperties}></i><i style={{ left: "80%", "--d": "8.7", "--dl": "-7.0" } as CSSProperties}></i><i style={{ left: "89%", "--d": "10.3", "--dl": "-1.0" } as CSSProperties}></i><i style={{ left: "98%", "--d": "11.2", "--dl": "-4.3" } as CSSProperties}></i><i style={{ left: "93%", "--d": "9.9", "--dl": "-1.0" } as CSSProperties}></i><i style={{ left: "0%", "--d": "11.1", "--dl": "-2.0" } as CSSProperties}></i><i style={{ left: "50%", "--d": "8.4", "--dl": "-1.2" } as CSSProperties}></i><i style={{ left: "83%", "--d": "11.5", "--dl": "-4.1" } as CSSProperties}></i><i style={{ left: "62%", "--d": "9.4", "--dl": "-2.7" } as CSSProperties}></i><i style={{ left: "22%", "--d": "11.0", "--dl": "-8.8" } as CSSProperties}></i><i style={{ left: "75%", "--d": "7.3", "--dl": "-7.7" } as CSSProperties}></i><i style={{ left: "39%", "--d": "10.8", "--dl": "-4.7" } as CSSProperties}></i><i style={{ left: "94%", "--d": "7.3", "--dl": "-5.0" } as CSSProperties}></i></span></div><i className="rim"></i><i className="rf"></i></div><i className="bt" style={{ "--i": "0" } as CSSProperties}></i><i className="bt" style={{ "--i": "1" } as CSSProperties}></i><i className="bt" style={{ "--i": "2" } as CSSProperties}></i><i className="bt" style={{ "--i": "3" } as CSSProperties}></i><i className="bt" style={{ "--i": "4" } as CSSProperties}></i><i className="bt" style={{ "--i": "5" } as CSSProperties}></i><i className="bt" style={{ "--i": "6" } as CSSProperties}></i><i className="bt" style={{ "--i": "7" } as CSSProperties}></i></div><div className="pn"><p className="lb">Depth</p><output className="dv">50 m</output><input type="range" min="0" max="200" value="50" aria-label="Depth" /><p className="zn"><span className="z1">Sunlit zone</span><span className="z2">Twilight zone</span></p></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 “Submarine porthole” block (Liquid Glass) from AIMRAN Library to my project.

## What it is
A brass porthole with thick glass that bends the sea at the edges; go deeper and the jellyfish arrive.

## Chosen settings
- Main color: #0ea5e9
- Secondary color: #c08a3e
- Size: 16px (from 12 to 24px)
- 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
// @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-port {
  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;
  background: radial-gradient(circle,#7d8a95 0 .12em,transparent .16em) .5em .5em/1.4em 7em,linear-gradient(180deg,transparent 49.6%,rgba(0,0,0,.35) 49.6% 50.4%,transparent 50.4%),linear-gradient(160deg,#5b6873,#3a444e);
}

.uvq11-port .ph {
  position: absolute;
  left: .9em;
  top: 1.8em;
  width: 10.4em;
  height: 10.4em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%,#f6dc9a,var(--c2) 45%,#5e3f15 100%);
  box-shadow: 0 .8em 1.4em -.4em rgba(0,0,0,.65),inset 0 0 0 .12em rgba(255,240,200,.45);
}

.uvq11-port .bt {
  position: absolute;
  left: 50%;
  top: 50%;
  width: .55em;
  height: .55em;
  margin: -.275em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff1c6,#9a7330 60%,#4a3210);
  transform: rotate(calc(var(--i) * 45deg + 22.5deg)) translateY(-4.65em);
}

.uvq11-port .gl {
  position: absolute;
  inset: 1.2em;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 .22em #3d2a0e,0 0 0 .3em rgba(255,230,180,.35);
}

.uvq11-port .sea {
  position: absolute;
  inset: 0;
  transform: scale(1.12);
  background: linear-gradient(180deg,color-mix(in srgb,var(--c1) calc(100% - var(--dp) * 88%),#020814),color-mix(in srgb,color-mix(in srgb,var(--c1) 55%,#03183a) calc(100% - var(--dp) * 95%),#01040c));
  transition: background calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq11-port .ry {
  position: absolute;
  left: -30%;
  right: -30%;
  top: -10%;
  height: 90%;
  background: repeating-conic-gradient(from 160deg at 50% 0,rgba(255,255,255,.22) 0 3deg,transparent 3deg 9deg);
  -webkit-mask: linear-gradient(#000,transparent);
  mask: linear-gradient(#000,transparent);
  opacity: calc(.9 - var(--dp) * 1.6);
  animation: uvq11-port-r calc(6s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite alternate;
}

.uvq11-port .fs svg {
  position: absolute;
  left: 0;
  width: var(--sz);
  fill: color-mix(in srgb,var(--c1) 30%,#04223a);
  opacity: calc(1 - var(--dp) * 1.5);
  animation: uvq11-port-f calc(9s / var(--k)) linear infinite;
  animation-delay: calc(var(--dl) * 1s / var(--k));
}

.uvq11-port .jf {
  position: absolute;
  left: 58%;
  top: 34%;
  width: 1.6em;
  height: 1.1em;
  border-radius: 50% 50% 20% 20%;
  background: radial-gradient(circle at 50% 70%,rgba(255,170,240,.9),rgba(200,110,255,.4) 60%,transparent 72%);
  box-shadow: 0 0 1em rgba(230,140,255,.6);
  opacity: calc((var(--dp) - .4) * 2.4);
  animation: uvq11-port-j calc(3s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite;
}

.uvq11-port .jf::after {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  top: 80%;
  height: 1.4em;
  background: repeating-linear-gradient(90deg,rgba(255,180,250,.6) 0 1px,transparent 1px .25em);
  -webkit-mask: linear-gradient(#000,transparent);
  mask: linear-gradient(#000,transparent);
}

.uvq11-port .jf.b {
  left: 24%;
  top: 58%;
  transform: scale(.6);
  animation-delay: calc(-1.4s / var(--k));
}

.uvq11-port .sn i {
  position: absolute;
  bottom: -5%;
  width: .16em;
  height: .16em;
  border-radius: 50%;
  background: rgba(220,240,255,.7);
  animation: uvq11-port-s calc(var(--d) * 1s / var(--k)) linear infinite;
  animation-delay: calc(var(--dl) * 1s / var(--k));
}

.uvq11-port.mv .sn i {
  animation-duration: calc(var(--d) * .25s / var(--k));
}

.uvq11-port .rim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  -webkit-backdrop-filter: blur(2.5px) brightness(1.15) saturate(1.4);
  backdrop-filter: blur(2.5px) brightness(1.15) saturate(1.4);
  -webkit-mask: radial-gradient(closest-side,transparent 68%,#000 92%);
  mask: radial-gradient(closest-side,transparent 68%,#000 92%);
}

.uvq11-port .rf {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(60% 35% at 40% 18%,rgba(255,255,255,.35),transparent 70%),radial-gradient(circle at 72% 78%,rgba(255,255,255,.18),transparent 22%);
  box-shadow: inset 0 0 1.4em rgba(0,0,0,.55),inset 0 .25em .3em -.1em rgba(255,255,255,.45);
}

.uvq11-port .rf::after {
  content: "";
  position: absolute;
  left: 18%;
  top: 14%;
  width: 28%;
  height: 12%;
  border-radius: 50%;
  border-top: .18em solid rgba(255,255,255,.75);
  transform: rotate(-28deg);
  filter: blur(.5px);
}

.uvq11-port .pn {
  position: absolute;
  left: 12.2em;
  top: 2.6em;
  width: 7em;
}

.uvq11-port .lb {
  margin: 0;
  font-size: .62em;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .7;
}

.uvq11-port .dv {
  display: block;
  margin: .05em 0 .5em;
  font-size: 2.1em;
  font-weight: 250;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.uvq11-port input {
  width: 100%;
  height: 1.6em;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  cursor: pointer;
}

.uvq11-port input::-webkit-slider-runnable-track {
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c1),#01040c);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}

.uvq11-port input::-moz-range-track {
  height: .4em;
  border-radius: 1em;
  background: linear-gradient(90deg,var(--c1),#01040c);
}

.uvq11-port input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.3em;
  height: 1.3em;
  margin-top: -.45em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff1c6,var(--c2) 60%,#5e3f15);
  box-shadow: 0 .15em .35em rgba(0,0,0,.5);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq11-port input::-moz-range-thumb {
  width: 1.3em;
  height: 1.3em;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff1c6,var(--c2) 60%,#5e3f15);
}

.uvq11-port input:active::-webkit-slider-thumb {
  transform: scale(1.2);
}

.uvq11-port input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 1em;
}

.uvq11-port .zn {
  margin: .5em 0 0;
  font-size: .72em;
  font-weight: 600;
  opacity: .85;
}

.uvq11-port .z2,.uvq11-port.deep .z1 {
  display: none;
}

.uvq11-port.deep .z2 {
  display: inline;
}

@keyframes uvq11-port-r {
  to {
    transform: rotate(6deg);
  }
}

@keyframes uvq11-port-f {
  from {
    transform: translateX(-2em);
  }
  to {
    transform: translateX(10em);
  }
}

@keyframes uvq11-port-j {
  50% {
    transform: translateY(-.4em) scaleX(.85);
  }
}

.uvq11-port .jf.b {
  animation-name: uvq11-port-j2;
}

@keyframes uvq11-port-j2 {
  0%,100% {
    transform: scale(.6);
  }
  50% {
    transform: scale(.6) translateY(-.4em) scaleX(.85);
  }
}

@keyframes uvq11-port-s {
  to {
    transform: translateY(-9em);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq11-port,.uvq11-port *,.uvq11-port *::before,.uvq11-port *::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 r=el.querySelector("input"),dv=el.querySelector(".dv");let t=0;const set=()=>{const v=+r.value;el.style.setProperty("--dp",(v/200).toFixed(3));dv.textContent=v+" m";el.classList.toggle("deep",v>=90)};r.addEventListener("input",()=>{set();el.classList.add("mv");clearTimeout(t);t=setTimeout(()=>el.classList.remove("mv"),500)});set();return()=>clearTimeout(t)
}

export default function LgPorthole() {
  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": "#0ea5e9",
          "--c2": "#c08a3e",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq11-port" style={{ "--dp": ".25" } as CSSProperties}><div className="ph"><div className="gl"><div className="sea" aria-hidden="true"><i className="ry"></i><span className="fs"><svg viewBox="0 0 24 12" style={{ top: "30%", "--sz": "1.6em", "--dl": "0" } as CSSProperties}><path d="M2 6c4-5 11-5 16 0-5 5-12 5-16 0zM18 6l5-4v8z" /></svg><svg viewBox="0 0 24 12" style={{ top: "44%", "--sz": "3em", "--dl": "-3" } as CSSProperties}><path d="M2 6c4-5 11-5 16 0-5 5-12 5-16 0zM18 6l5-4v8z" /></svg><svg viewBox="0 0 24 12" style={{ top: "58%", "--sz": "2.2em", "--dl": "-6" } as CSSProperties}><path d="M2 6c4-5 11-5 16 0-5 5-12 5-16 0zM18 6l5-4v8z" /></svg><svg viewBox="0 0 24 12" style={{ top: "70%", "--sz": "1.1em", "--dl": "-2" } as CSSProperties}><path d="M2 6c4-5 11-5 16 0-5 5-12 5-16 0zM18 6l5-4v8z" /></svg></span><i className="jf"></i><i className="jf b"></i><span className="sn"><i style={{ left: "0%", "--d": "10.3", "--dl": "-8.2" } as CSSProperties}></i><i style={{ left: "96%", "--d": "11.6", "--dl": "-8.5" } as CSSProperties}></i><i style={{ left: "61%", "--d": "11.0", "--dl": "-8.3" } as CSSProperties}></i><i style={{ left: "15%", "--d": "11.9", "--dl": "-7.5" } as CSSProperties}></i><i style={{ left: "80%", "--d": "8.7", "--dl": "-7.0" } as CSSProperties}></i><i style={{ left: "89%", "--d": "10.3", "--dl": "-1.0" } as CSSProperties}></i><i style={{ left: "98%", "--d": "11.2", "--dl": "-4.3" } as CSSProperties}></i><i style={{ left: "93%", "--d": "9.9", "--dl": "-1.0" } as CSSProperties}></i><i style={{ left: "0%", "--d": "11.1", "--dl": "-2.0" } as CSSProperties}></i><i style={{ left: "50%", "--d": "8.4", "--dl": "-1.2" } as CSSProperties}></i><i style={{ left: "83%", "--d": "11.5", "--dl": "-4.1" } as CSSProperties}></i><i style={{ left: "62%", "--d": "9.4", "--dl": "-2.7" } as CSSProperties}></i><i style={{ left: "22%", "--d": "11.0", "--dl": "-8.8" } as CSSProperties}></i><i style={{ left: "75%", "--d": "7.3", "--dl": "-7.7" } as CSSProperties}></i><i style={{ left: "39%", "--d": "10.8", "--dl": "-4.7" } as CSSProperties}></i><i style={{ left: "94%", "--d": "7.3", "--dl": "-5.0" } as CSSProperties}></i></span></div><i className="rim"></i><i className="rf"></i></div><i className="bt" style={{ "--i": "0" } as CSSProperties}></i><i className="bt" style={{ "--i": "1" } as CSSProperties}></i><i className="bt" style={{ "--i": "2" } as CSSProperties}></i><i className="bt" style={{ "--i": "3" } as CSSProperties}></i><i className="bt" style={{ "--i": "4" } as CSSProperties}></i><i className="bt" style={{ "--i": "5" } as CSSProperties}></i><i className="bt" style={{ "--i": "6" } as CSSProperties}></i><i className="bt" style={{ "--i": "7" } as CSSProperties}></i></div><div className="pn"><p className="lb">Depth</p><output className="dv">50 m</output><input type="range" min="0" max="200" value="50" aria-label="Depth" /><p className="zn"><span className="z1">Sunlit zone</span><span className="z2">Twilight zone</span></p></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.
````
