# Cup anemometer loader

> The three cups of a weather station spin with the gusts while the wind speed reading rises and falls with them.

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

## Where to use it

A weather station anemometer in CSS 3D: three hemispherical cups on thin arms turn around a mast, fast during a gust and slower in the lull, while streaks of wind cross the scene. A small display counts the speed in km/h with a registered integer property kept in step with the spin. It suits weather apps, sailing and outdoor sports.

The main color paints the cups and the second the wind streaks. Show it while a forecast or live sensor data loads, and keep the reading if your product deals with real measurements.

## Code

### HTML

```html
<div class="uvq10-anm" role="status"><span class="sr">Loading</span><div class="wd" aria-hidden="true"><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></div><div class="st" aria-hidden="true"><i class="ms"></i><div class="rot"><span class="arm" style="--i:0"><i class="cp"><b class="or"></b><b class="d"></b></i></span><span class="arm" style="--i:1"><i class="cp"><b class="or"></b><b class="d"></b></i></span><span class="arm" style="--i:2"><i class="cp"><b class="or"></b><b class="d"></b></i></span></div><i class="hb"></i></div><span class="ro" aria-hidden="true"><b></b> km/h</span></div>
```

### CSS

```css
.uvq10-anm {
  --c1: #e63946;
  --c2: #8ecae6;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

@property --uvq10-w {
  syntax: "<integer>";
  inherits: true;
  initial-value: 12;
}

.uvq10-anm {
  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: 11em;
  height: 8.4em;
  overflow: hidden;
}

.uvq10-anm .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.uvq10-anm .wd i {
  position: absolute;
  left: 0;
  top: calc(.9em + var(--i) * 1.35em);
  width: 3.2em;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg,transparent,var(--c2),transparent);
  opacity: 0;
  animation: uvq10-anm-w calc(1.5s / var(--k)) linear infinite;
  animation-delay: calc(var(--i) * calc(-0.37s / var(--k)));
}

.uvq10-anm .wd i:nth-child(2n) {
  animation-duration: calc(1.1s / var(--k));
}

.uvq10-anm .st {
  position: absolute;
  left: 50%;
  top: 1.6em;
  width: 0;
  height: 0;
  perspective: 18em;
}

.uvq10-anm .ms {
  position: absolute;
  left: -.12em;
  top: 0;
  width: .24em;
  height: 6.4em;
  background: linear-gradient(90deg,#6b7280,#e5e7eb,#4b5563);
}

.uvq10-anm .ms::after {
  content: "";
  position: absolute;
  left: -1.1em;
  bottom: 0;
  width: 2.44em;
  height: .3em;
  border-radius: .15em;
  background: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq10-anm .rot {
  position: absolute;
  left: 0;
  top: 0;
  transform-style: preserve-3d;
  transform: rotateX(-18deg);
  animation: uvq10-anm calc(3s / var(--k)) infinite;
}

.uvq10-anm .arm {
  position: absolute;
  left: 0;
  top: -.04em;
  width: 2.7em;
  height: .08em;
  transform-origin: 0 50%;
  transform: rotateY(calc(var(--i) * 120deg));
  transform-style: preserve-3d;
  background: linear-gradient(#d1d5db,#6b7280);
}

.uvq10-anm .cp {
  position: absolute;
  right: -.55em;
  top: -.5em;
  width: 1.1em;
  height: 1.1em;
  transform-style: preserve-3d;
}

.uvq10-anm .cp b {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
}

.uvq10-anm .o {
  background: radial-gradient(circle at 55% 45%,color-mix(in srgb,var(--c1) 40%,#000),color-mix(in srgb,var(--c1) 75%,#000) 60%,var(--c1) 64%);
}

.uvq10-anm .d {
  background: radial-gradient(circle at 38% 32%,color-mix(in srgb,var(--c1) 40%,#fff),var(--c1) 55%,color-mix(in srgb,var(--c1) 70%,#000));
  transform: rotateY(180deg);
}

.uvq10-anm .hb {
  position: absolute;
  left: -.32em;
  top: -.36em;
  width: .64em;
  height: .7em;
  border-radius: .3em .3em .15em .15em;
  background: linear-gradient(90deg,#6b7280,#f3f4f6,#4b5563);
}

.uvq10-anm .ro {
  position: absolute;
  right: .2em;
  top: .3em;
  padding: .3em .5em;
  border-radius: .35em;
  background: color-mix(in srgb,var(--fg) 88%,var(--bg));
  color: var(--bg);
  font: 700 .78em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-variant-numeric: tabular-nums;
  counter-reset: uvq10-w var(--uvq10-w);
  animation: uvq10-anm-n calc(3s / var(--k)) linear infinite;
}

.uvq10-anm .ro b::before {
  content: counter(uvq10-w);
}

@keyframes uvq10-anm {
  0% {
    transform: rotateX(-18deg) rotateY(0);
    animation-timing-function: cubic-bezier(.3,.2,.6,1);
  }
  45% {
    transform: rotateX(-18deg) rotateY(-1080deg);
    animation-timing-function: cubic-bezier(.4,0,.6,1);
  }
  100% {
    transform: rotateX(-18deg) rotateY(-1440deg);
  }
}

@keyframes uvq10-anm-n {
  0% {
    --uvq10-w: 14;
  }
  12% {
    --uvq10-w: 37;
  }
  38% {
    --uvq10-w: 41;
  }
  55% {
    --uvq10-w: 19;
  }
  100% {
    --uvq10-w: 14;
  }
}

@keyframes uvq10-anm-w {
  0% {
    transform: translateX(-3.5em);
    opacity: 0;
  }
  20%,70% {
    opacity: .8;
  }
  100% {
    transform: translateX(11em);
    opacity: 0;
  }
}

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

### React

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

const css = `
@property --uvq10-w {
  syntax: "<integer>";
  inherits: true;
  initial-value: 12;
}

.uvq10-anm {
  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: 11em;
  height: 8.4em;
  overflow: hidden;
}

.uvq10-anm .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.uvq10-anm .wd i {
  position: absolute;
  left: 0;
  top: calc(.9em + var(--i) * 1.35em);
  width: 3.2em;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg,transparent,var(--c2),transparent);
  opacity: 0;
  animation: uvq10-anm-w calc(1.5s / var(--k)) linear infinite;
  animation-delay: calc(var(--i) * calc(-0.37s / var(--k)));
}

.uvq10-anm .wd i:nth-child(2n) {
  animation-duration: calc(1.1s / var(--k));
}

.uvq10-anm .st {
  position: absolute;
  left: 50%;
  top: 1.6em;
  width: 0;
  height: 0;
  perspective: 18em;
}

.uvq10-anm .ms {
  position: absolute;
  left: -.12em;
  top: 0;
  width: .24em;
  height: 6.4em;
  background: linear-gradient(90deg,#6b7280,#e5e7eb,#4b5563);
}

.uvq10-anm .ms::after {
  content: "";
  position: absolute;
  left: -1.1em;
  bottom: 0;
  width: 2.44em;
  height: .3em;
  border-radius: .15em;
  background: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq10-anm .rot {
  position: absolute;
  left: 0;
  top: 0;
  transform-style: preserve-3d;
  transform: rotateX(-18deg);
  animation: uvq10-anm calc(3s / var(--k)) infinite;
}

.uvq10-anm .arm {
  position: absolute;
  left: 0;
  top: -.04em;
  width: 2.7em;
  height: .08em;
  transform-origin: 0 50%;
  transform: rotateY(calc(var(--i) * 120deg));
  transform-style: preserve-3d;
  background: linear-gradient(#d1d5db,#6b7280);
}

.uvq10-anm .cp {
  position: absolute;
  right: -.55em;
  top: -.5em;
  width: 1.1em;
  height: 1.1em;
  transform-style: preserve-3d;
}

.uvq10-anm .cp b {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
}

.uvq10-anm .o {
  background: radial-gradient(circle at 55% 45%,color-mix(in srgb,var(--c1) 40%,#000),color-mix(in srgb,var(--c1) 75%,#000) 60%,var(--c1) 64%);
}

.uvq10-anm .d {
  background: radial-gradient(circle at 38% 32%,color-mix(in srgb,var(--c1) 40%,#fff),var(--c1) 55%,color-mix(in srgb,var(--c1) 70%,#000));
  transform: rotateY(180deg);
}

.uvq10-anm .hb {
  position: absolute;
  left: -.32em;
  top: -.36em;
  width: .64em;
  height: .7em;
  border-radius: .3em .3em .15em .15em;
  background: linear-gradient(90deg,#6b7280,#f3f4f6,#4b5563);
}

.uvq10-anm .ro {
  position: absolute;
  right: .2em;
  top: .3em;
  padding: .3em .5em;
  border-radius: .35em;
  background: color-mix(in srgb,var(--fg) 88%,var(--bg));
  color: var(--bg);
  font: 700 .78em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-variant-numeric: tabular-nums;
  counter-reset: uvq10-w var(--uvq10-w);
  animation: uvq10-anm-n calc(3s / var(--k)) linear infinite;
}

.uvq10-anm .ro b::before {
  content: counter(uvq10-w);
}

@keyframes uvq10-anm {
  0% {
    transform: rotateX(-18deg) rotateY(0);
    animation-timing-function: cubic-bezier(.3,.2,.6,1);
  }
  45% {
    transform: rotateX(-18deg) rotateY(-1080deg);
    animation-timing-function: cubic-bezier(.4,0,.6,1);
  }
  100% {
    transform: rotateX(-18deg) rotateY(-1440deg);
  }
}

@keyframes uvq10-anm-n {
  0% {
    --uvq10-w: 14;
  }
  12% {
    --uvq10-w: 37;
  }
  38% {
    --uvq10-w: 41;
  }
  55% {
    --uvq10-w: 19;
  }
  100% {
    --uvq10-w: 14;
  }
}

@keyframes uvq10-anm-w {
  0% {
    transform: translateX(-3.5em);
    opacity: 0;
  }
  20%,70% {
    opacity: .8;
  }
  100% {
    transform: translateX(11em);
    opacity: 0;
  }
}

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

export default function LdCupAnemometer() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#e63946",
          "--c2": "#8ecae6",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq10-anm" role="status"><span className="sr">Loading</span><div className="wd" aria-hidden="true"><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></div><div className="st" aria-hidden="true"><i className="ms"></i><div className="rot"><span className="arm" style={{ "--i": "0" } as CSSProperties}><i className="cp"><b className="or"></b><b className="d"></b></i></span><span className="arm" style={{ "--i": "1" } as CSSProperties}><i className="cp"><b className="or"></b><b className="d"></b></i></span><span className="arm" style={{ "--i": "2" } as CSSProperties}><i className="cp"><b className="or"></b><b className="d"></b></i></span></div><i className="hb"></i></div><span className="ro" aria-hidden="true"><b></b> km/h</span></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 “Cup anemometer loader” block (Loaders) from AIMRAN Library to my project.

## What it is
The three cups of a weather station spin with the gusts while the wind speed reading rises and falls with them.

## Chosen settings
- Main color: #e63946
- Secondary color: #8ecae6
- 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
import type { CSSProperties } from "react";

const css = `
@property --uvq10-w {
  syntax: "<integer>";
  inherits: true;
  initial-value: 12;
}

.uvq10-anm {
  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: 11em;
  height: 8.4em;
  overflow: hidden;
}

.uvq10-anm .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.uvq10-anm .wd i {
  position: absolute;
  left: 0;
  top: calc(.9em + var(--i) * 1.35em);
  width: 3.2em;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg,transparent,var(--c2),transparent);
  opacity: 0;
  animation: uvq10-anm-w calc(1.5s / var(--k)) linear infinite;
  animation-delay: calc(var(--i) * calc(-0.37s / var(--k)));
}

.uvq10-anm .wd i:nth-child(2n) {
  animation-duration: calc(1.1s / var(--k));
}

.uvq10-anm .st {
  position: absolute;
  left: 50%;
  top: 1.6em;
  width: 0;
  height: 0;
  perspective: 18em;
}

.uvq10-anm .ms {
  position: absolute;
  left: -.12em;
  top: 0;
  width: .24em;
  height: 6.4em;
  background: linear-gradient(90deg,#6b7280,#e5e7eb,#4b5563);
}

.uvq10-anm .ms::after {
  content: "";
  position: absolute;
  left: -1.1em;
  bottom: 0;
  width: 2.44em;
  height: .3em;
  border-radius: .15em;
  background: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq10-anm .rot {
  position: absolute;
  left: 0;
  top: 0;
  transform-style: preserve-3d;
  transform: rotateX(-18deg);
  animation: uvq10-anm calc(3s / var(--k)) infinite;
}

.uvq10-anm .arm {
  position: absolute;
  left: 0;
  top: -.04em;
  width: 2.7em;
  height: .08em;
  transform-origin: 0 50%;
  transform: rotateY(calc(var(--i) * 120deg));
  transform-style: preserve-3d;
  background: linear-gradient(#d1d5db,#6b7280);
}

.uvq10-anm .cp {
  position: absolute;
  right: -.55em;
  top: -.5em;
  width: 1.1em;
  height: 1.1em;
  transform-style: preserve-3d;
}

.uvq10-anm .cp b {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
}

.uvq10-anm .o {
  background: radial-gradient(circle at 55% 45%,color-mix(in srgb,var(--c1) 40%,#000),color-mix(in srgb,var(--c1) 75%,#000) 60%,var(--c1) 64%);
}

.uvq10-anm .d {
  background: radial-gradient(circle at 38% 32%,color-mix(in srgb,var(--c1) 40%,#fff),var(--c1) 55%,color-mix(in srgb,var(--c1) 70%,#000));
  transform: rotateY(180deg);
}

.uvq10-anm .hb {
  position: absolute;
  left: -.32em;
  top: -.36em;
  width: .64em;
  height: .7em;
  border-radius: .3em .3em .15em .15em;
  background: linear-gradient(90deg,#6b7280,#f3f4f6,#4b5563);
}

.uvq10-anm .ro {
  position: absolute;
  right: .2em;
  top: .3em;
  padding: .3em .5em;
  border-radius: .35em;
  background: color-mix(in srgb,var(--fg) 88%,var(--bg));
  color: var(--bg);
  font: 700 .78em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-variant-numeric: tabular-nums;
  counter-reset: uvq10-w var(--uvq10-w);
  animation: uvq10-anm-n calc(3s / var(--k)) linear infinite;
}

.uvq10-anm .ro b::before {
  content: counter(uvq10-w);
}

@keyframes uvq10-anm {
  0% {
    transform: rotateX(-18deg) rotateY(0);
    animation-timing-function: cubic-bezier(.3,.2,.6,1);
  }
  45% {
    transform: rotateX(-18deg) rotateY(-1080deg);
    animation-timing-function: cubic-bezier(.4,0,.6,1);
  }
  100% {
    transform: rotateX(-18deg) rotateY(-1440deg);
  }
}

@keyframes uvq10-anm-n {
  0% {
    --uvq10-w: 14;
  }
  12% {
    --uvq10-w: 37;
  }
  38% {
    --uvq10-w: 41;
  }
  55% {
    --uvq10-w: 19;
  }
  100% {
    --uvq10-w: 14;
  }
}

@keyframes uvq10-anm-w {
  0% {
    transform: translateX(-3.5em);
    opacity: 0;
  }
  20%,70% {
    opacity: .8;
  }
  100% {
    transform: translateX(11em);
    opacity: 0;
  }
}

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

export default function LdCupAnemometer() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#e63946",
          "--c2": "#8ecae6",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq10-anm" role="status"><span className="sr">Loading</span><div className="wd" aria-hidden="true"><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></div><div className="st" aria-hidden="true"><i className="ms"></i><div className="rot"><span className="arm" style={{ "--i": "0" } as CSSProperties}><i className="cp"><b className="or"></b><b className="d"></b></i></span><span className="arm" style={{ "--i": "1" } as CSSProperties}><i className="cp"><b className="or"></b><b className="d"></b></i></span><span className="arm" style={{ "--i": "2" } as CSSProperties}><i className="cp"><b className="or"></b><b className="d"></b></i></span></div><i className="hb"></i></div><span className="ro" aria-hidden="true"><b></b> km/h</span></div>
      </div>
    </>
  );
}
```

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