# Rewinding cassette loader

> A cassette tape with both reels turning while the tape winds from one spool to the other and back again.

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

## Where to use it

A compact cassette drawn in CSS with a label, screws, a tinted window and two toothed hubs that spin. The brown tape pack shrinks on one reel and grows on the other, so the rewind reads at a glance. It suits retro music sites, audio editors, voice notes and nostalgic campaigns.

The main color sets the plastic shell and the second color the paper label, so you can go from orange to clear or black. Use it while audio uploads or a mix renders.

## Code

### HTML

```html
<div class="uvq10-cas" role="status"><span class="sr">Rewinding</span><div class="lab" aria-hidden="true"><b class="sd">A</b><i class="ln"></i><div class="win"><span class="rl a"><i></i></span><span class="rl b"><i></i></span></div></div><i class="bt" aria-hidden="true"></i><i class="sc" style="inset:.5em .45em" aria-hidden="true"></i><i class="sc" style="inset:auto .45em .45em auto" aria-hidden="true"></i><i class="sc" style="inset:auto auto .45em .5em" aria-hidden="true"></i><i class="sc" style="inset:.5em auto auto .45em" aria-hidden="true"></i></div>
```

### CSS

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

.uvq10-cas {
  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: 7em;
  border-radius: .55em;
  background: linear-gradient(170deg,color-mix(in srgb,var(--c1) 82%,#fff),var(--c1) 40%,color-mix(in srgb,var(--c1) 80%,#000));
  box-shadow: 0 1em 1.6em -1em rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.35),inset 0 -.15em .2em rgba(0,0,0,.2);
}

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

.uvq10-cas .lab {
  position: absolute;
  left: .75em;
  right: .75em;
  top: .6em;
  height: 4.4em;
  border-radius: .35em;
  background: linear-gradient(transparent 3.65em,var(--c1) 3.65em 3.8em,transparent 3.8em 3.9em,color-mix(in srgb,var(--c1) 60%,#000) 3.9em 4.05em,transparent 4.05em),var(--c2);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.uvq10-cas .sd {
  position: absolute;
  left: .45em;
  top: .25em;
  font: 800 1.1em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: color-mix(in srgb,var(--c1) 80%,#000);
}

.uvq10-cas .ln {
  position: absolute;
  left: 1.8em;
  right: .7em;
  top: .35em;
  height: .85em;
  background: repeating-linear-gradient(transparent 0 .38em,rgba(0,0,0,.22) .38em calc(.38em + 1px));
}

.uvq10-cas .win {
  position: absolute;
  left: 50%;
  top: 1.45em;
  width: 6.2em;
  height: 2em;
  margin-left: -3.1em;
  border-radius: 1em;
  background: linear-gradient(rgba(255,255,255,.12),transparent 40%),rgba(28,22,20,.88);
  overflow: hidden;
  box-shadow: inset 0 .1em .3em rgba(0,0,0,.6);
}

.uvq10-cas .rl {
  position: absolute;
  top: 50%;
  width: 1.05em;
  height: 1.05em;
  margin: -.525em 0 0 -.525em;
}

.uvq10-cas .rl.a {
  left: 1.45em;
}

.uvq10-cas .rl.b {
  left: 4.75em;
}

.uvq10-cas .rl::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3em;
  height: 3em;
  margin: -1.5em;
  border-radius: 50%;
  background: radial-gradient(circle,#6a4a35,#2e2019 72%);
  animation: uvq10-cas-p calc(5s / var(--k)) ease-in-out infinite alternate;
}

.uvq10-cas .rl.b::before {
  animation-direction: alternate-reverse;
}

.uvq10-cas .rl i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle,#1a1a1a 0 .13em,transparent .14em .3em,#f4f1ea .31em),repeating-conic-gradient(#f4f1ea 0 18deg,transparent 18deg 60deg);
  box-shadow: 0 0 0 .07em #f4f1ea;
  -webkit-mask: radial-gradient(circle,#000 .5em,transparent .52em);
  mask: radial-gradient(circle,#000 .5em,transparent .52em);
  animation: uvq10-cas-r calc(0.9s / var(--k)) linear infinite;
}

.uvq10-cas .bt {
  position: absolute;
  left: 2.2em;
  right: 2.2em;
  bottom: 0;
  height: 1.45em;
  clip-path: polygon(9% 0,91% 0,100% 100%,0 100%);
  background: radial-gradient(circle at 20% 58%,#151515 .2em,transparent .23em),radial-gradient(circle at 80% 58%,#151515 .2em,transparent .23em),radial-gradient(circle at 40% 62%,#151515 .13em,transparent .16em),radial-gradient(circle at 60% 62%,#151515 .13em,transparent .16em),linear-gradient(color-mix(in srgb,var(--c1) 70%,#000),color-mix(in srgb,var(--c1) 85%,#000));
}

.uvq10-cas .sc {
  position: absolute;
  width: .42em;
  height: .42em;
  border-radius: 50%;
  background: linear-gradient(45deg,transparent 42%,rgba(0,0,0,.55) 42% 58%,transparent 58%),radial-gradient(circle at 35% 30%,#f3f4f6,#9ca3af);
}

@keyframes uvq10-cas-p {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(.52);
  }
}

@keyframes uvq10-cas-r {
  to {
    transform: rotate(-1turn);
  }
}

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

### React

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

const css = `
.uvq10-cas {
  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: 7em;
  border-radius: .55em;
  background: linear-gradient(170deg,color-mix(in srgb,var(--c1) 82%,#fff),var(--c1) 40%,color-mix(in srgb,var(--c1) 80%,#000));
  box-shadow: 0 1em 1.6em -1em rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.35),inset 0 -.15em .2em rgba(0,0,0,.2);
}

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

.uvq10-cas .lab {
  position: absolute;
  left: .75em;
  right: .75em;
  top: .6em;
  height: 4.4em;
  border-radius: .35em;
  background: linear-gradient(transparent 3.65em,var(--c1) 3.65em 3.8em,transparent 3.8em 3.9em,color-mix(in srgb,var(--c1) 60%,#000) 3.9em 4.05em,transparent 4.05em),var(--c2);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.uvq10-cas .sd {
  position: absolute;
  left: .45em;
  top: .25em;
  font: 800 1.1em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: color-mix(in srgb,var(--c1) 80%,#000);
}

.uvq10-cas .ln {
  position: absolute;
  left: 1.8em;
  right: .7em;
  top: .35em;
  height: .85em;
  background: repeating-linear-gradient(transparent 0 .38em,rgba(0,0,0,.22) .38em calc(.38em + 1px));
}

.uvq10-cas .win {
  position: absolute;
  left: 50%;
  top: 1.45em;
  width: 6.2em;
  height: 2em;
  margin-left: -3.1em;
  border-radius: 1em;
  background: linear-gradient(rgba(255,255,255,.12),transparent 40%),rgba(28,22,20,.88);
  overflow: hidden;
  box-shadow: inset 0 .1em .3em rgba(0,0,0,.6);
}

.uvq10-cas .rl {
  position: absolute;
  top: 50%;
  width: 1.05em;
  height: 1.05em;
  margin: -.525em 0 0 -.525em;
}

.uvq10-cas .rl.a {
  left: 1.45em;
}

.uvq10-cas .rl.b {
  left: 4.75em;
}

.uvq10-cas .rl::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3em;
  height: 3em;
  margin: -1.5em;
  border-radius: 50%;
  background: radial-gradient(circle,#6a4a35,#2e2019 72%);
  animation: uvq10-cas-p calc(5s / var(--k)) ease-in-out infinite alternate;
}

.uvq10-cas .rl.b::before {
  animation-direction: alternate-reverse;
}

.uvq10-cas .rl i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle,#1a1a1a 0 .13em,transparent .14em .3em,#f4f1ea .31em),repeating-conic-gradient(#f4f1ea 0 18deg,transparent 18deg 60deg);
  box-shadow: 0 0 0 .07em #f4f1ea;
  -webkit-mask: radial-gradient(circle,#000 .5em,transparent .52em);
  mask: radial-gradient(circle,#000 .5em,transparent .52em);
  animation: uvq10-cas-r calc(0.9s / var(--k)) linear infinite;
}

.uvq10-cas .bt {
  position: absolute;
  left: 2.2em;
  right: 2.2em;
  bottom: 0;
  height: 1.45em;
  clip-path: polygon(9% 0,91% 0,100% 100%,0 100%);
  background: radial-gradient(circle at 20% 58%,#151515 .2em,transparent .23em),radial-gradient(circle at 80% 58%,#151515 .2em,transparent .23em),radial-gradient(circle at 40% 62%,#151515 .13em,transparent .16em),radial-gradient(circle at 60% 62%,#151515 .13em,transparent .16em),linear-gradient(color-mix(in srgb,var(--c1) 70%,#000),color-mix(in srgb,var(--c1) 85%,#000));
}

.uvq10-cas .sc {
  position: absolute;
  width: .42em;
  height: .42em;
  border-radius: 50%;
  background: linear-gradient(45deg,transparent 42%,rgba(0,0,0,.55) 42% 58%,transparent 58%),radial-gradient(circle at 35% 30%,#f3f4f6,#9ca3af);
}

@keyframes uvq10-cas-p {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(.52);
  }
}

@keyframes uvq10-cas-r {
  to {
    transform: rotate(-1turn);
  }
}

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

export default function LdCassetteRewind() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#e76f51",
          "--c2": "#f4ecd8",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq10-cas" role="status"><span className="sr">Rewinding</span><div className="lab" aria-hidden="true"><b className="sd">A</b><i className="ln"></i><div className="win"><span className="rl a"><i></i></span><span className="rl b"><i></i></span></div></div><i className="bt" aria-hidden="true"></i><i className="sc" style={{ inset: ".5em .45em" }} aria-hidden="true"></i><i className="sc" style={{ inset: "auto .45em .45em auto" }} aria-hidden="true"></i><i className="sc" style={{ inset: "auto auto .45em .5em" }} aria-hidden="true"></i><i className="sc" style={{ inset: ".5em auto auto .45em" }} aria-hidden="true"></i></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 “Rewinding cassette loader” block (Loaders) from AIMRAN Library to my project.

## What it is
A cassette tape with both reels turning while the tape winds from one spool to the other and back again.

## Chosen settings
- Main color: #e76f51
- Secondary color: #f4ecd8
- 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 = `
.uvq10-cas {
  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: 7em;
  border-radius: .55em;
  background: linear-gradient(170deg,color-mix(in srgb,var(--c1) 82%,#fff),var(--c1) 40%,color-mix(in srgb,var(--c1) 80%,#000));
  box-shadow: 0 1em 1.6em -1em rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.35),inset 0 -.15em .2em rgba(0,0,0,.2);
}

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

.uvq10-cas .lab {
  position: absolute;
  left: .75em;
  right: .75em;
  top: .6em;
  height: 4.4em;
  border-radius: .35em;
  background: linear-gradient(transparent 3.65em,var(--c1) 3.65em 3.8em,transparent 3.8em 3.9em,color-mix(in srgb,var(--c1) 60%,#000) 3.9em 4.05em,transparent 4.05em),var(--c2);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.uvq10-cas .sd {
  position: absolute;
  left: .45em;
  top: .25em;
  font: 800 1.1em/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: color-mix(in srgb,var(--c1) 80%,#000);
}

.uvq10-cas .ln {
  position: absolute;
  left: 1.8em;
  right: .7em;
  top: .35em;
  height: .85em;
  background: repeating-linear-gradient(transparent 0 .38em,rgba(0,0,0,.22) .38em calc(.38em + 1px));
}

.uvq10-cas .win {
  position: absolute;
  left: 50%;
  top: 1.45em;
  width: 6.2em;
  height: 2em;
  margin-left: -3.1em;
  border-radius: 1em;
  background: linear-gradient(rgba(255,255,255,.12),transparent 40%),rgba(28,22,20,.88);
  overflow: hidden;
  box-shadow: inset 0 .1em .3em rgba(0,0,0,.6);
}

.uvq10-cas .rl {
  position: absolute;
  top: 50%;
  width: 1.05em;
  height: 1.05em;
  margin: -.525em 0 0 -.525em;
}

.uvq10-cas .rl.a {
  left: 1.45em;
}

.uvq10-cas .rl.b {
  left: 4.75em;
}

.uvq10-cas .rl::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3em;
  height: 3em;
  margin: -1.5em;
  border-radius: 50%;
  background: radial-gradient(circle,#6a4a35,#2e2019 72%);
  animation: uvq10-cas-p calc(5s / var(--k)) ease-in-out infinite alternate;
}

.uvq10-cas .rl.b::before {
  animation-direction: alternate-reverse;
}

.uvq10-cas .rl i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle,#1a1a1a 0 .13em,transparent .14em .3em,#f4f1ea .31em),repeating-conic-gradient(#f4f1ea 0 18deg,transparent 18deg 60deg);
  box-shadow: 0 0 0 .07em #f4f1ea;
  -webkit-mask: radial-gradient(circle,#000 .5em,transparent .52em);
  mask: radial-gradient(circle,#000 .5em,transparent .52em);
  animation: uvq10-cas-r calc(0.9s / var(--k)) linear infinite;
}

.uvq10-cas .bt {
  position: absolute;
  left: 2.2em;
  right: 2.2em;
  bottom: 0;
  height: 1.45em;
  clip-path: polygon(9% 0,91% 0,100% 100%,0 100%);
  background: radial-gradient(circle at 20% 58%,#151515 .2em,transparent .23em),radial-gradient(circle at 80% 58%,#151515 .2em,transparent .23em),radial-gradient(circle at 40% 62%,#151515 .13em,transparent .16em),radial-gradient(circle at 60% 62%,#151515 .13em,transparent .16em),linear-gradient(color-mix(in srgb,var(--c1) 70%,#000),color-mix(in srgb,var(--c1) 85%,#000));
}

.uvq10-cas .sc {
  position: absolute;
  width: .42em;
  height: .42em;
  border-radius: 50%;
  background: linear-gradient(45deg,transparent 42%,rgba(0,0,0,.55) 42% 58%,transparent 58%),radial-gradient(circle at 35% 30%,#f3f4f6,#9ca3af);
}

@keyframes uvq10-cas-p {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(.52);
  }
}

@keyframes uvq10-cas-r {
  to {
    transform: rotate(-1turn);
  }
}

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

export default function LdCassetteRewind() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#e76f51",
          "--c2": "#f4ecd8",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq10-cas" role="status"><span className="sr">Rewinding</span><div className="lab" aria-hidden="true"><b className="sd">A</b><i className="ln"></i><div className="win"><span className="rl a"><i></i></span><span className="rl b"><i></i></span></div></div><i className="bt" aria-hidden="true"></i><i className="sc" style={{ inset: ".5em .45em" }} aria-hidden="true"></i><i className="sc" style={{ inset: "auto .45em .45em auto" }} aria-hidden="true"></i><i className="sc" style={{ inset: "auto auto .45em .5em" }} aria-hidden="true"></i><i className="sc" style={{ inset: ".5em auto auto .45em" }} aria-hidden="true"></i></div>
      </div>
    </>
  );
}
```

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