# Cassette tape toast

> A cassette spins its reels while the song plays; the button pauses it and starts it again.

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

## Where to use it

A now playing notice gets more character when it looks like the thing that used to play music. This cassette is pure CSS: striped label, handwritten title, a window where two spoked reels turn while the tape slowly moves from one to the other through an animated custom property. A small equaliser bounces beside the track name. Perfect for music apps, podcasts and radio players.

The two colors paint the label stripes and the main one also tints the label and equaliser. Pausing freezes the reels with animation-play-state and updates the button label for screen readers, so you can drive it from a real audio element.

## Code

### HTML

```html
<div class="uvq09-cst"><button type="button" class="fire">Show again</button><div class="tt" role="status"><span class="cs" aria-hidden="true"><span class="lb"><em>Summer mix 86</em></span><span class="wd"><i class="r r1"></i><i class="r r2"></i></span></span><span class="tx"><small>Now playing</small><b>Side A · Track 3</b><span class="eq" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></span></span><button type="button" class="pl" aria-label="Pause"><svg class="pa" viewBox="0 0 24 24" aria-hidden="true"><rect x="6" y="5" width="4" height="14" rx="1.2"/><rect x="14" y="5" width="4" height="14" rx="1.2"/></svg><svg class="py" viewBox="0 0 24 24" aria-hidden="true"><path d="M7.5 4.8v14.4a.8.8 0 0 0 1.2.7l11.3-7.2a.8.8 0 0 0 0-1.4L8.7 4.1a.8.8 0 0 0-1.2.7z"/></svg></button></div></div>
```

### CSS

```css
.uvq09-cst {
  --c1: #e11d48;
  --c2: #f59e0b;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

@property --uvq09-cst-t {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.uvq09-cst {
  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: 21em;
  height: 15em;
}

.uvq09-cst .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 50%;
  top: 1.2em;
  translate: -50% 0;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-size: .82em;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-cst .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq09-cst .fire:active {
  scale: .96;
}

.uvq09-cst .fire:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-cst .tt {
  position: absolute;
  left: 50%;
  bottom: 1em;
  width: 19em;
  translate: -50% 0;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.2em 2.4em -1em rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  gap: .85em;
  padding: .75em .85em;
  transform: translateY(130%) scale(.92);
  opacity: 0;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-cst .tt.in {
  transform: none;
  opacity: 1;
}

.uvq09-cst .cs {
  position: relative;
  flex: none;
  width: 6.4em;
  height: 4.1em;
  padding: .35em .4em;
  border-radius: .45em;
  background: linear-gradient(#2c2c2e,#161617);
  box-shadow: inset 0 1px rgba(255,255,255,.14),0 .3em .6em -.2em rgba(0,0,0,.5);
}

.uvq09-cst .cs::after {
  content: "";
  position: absolute;
  left: 1.3em;
  right: 1.3em;
  bottom: 0;
  height: .7em;
  background: #0c0c0d;
  clip-path: polygon(10% 0,90% 0,100% 100%,0 100%);
}

.uvq09-cst .lb {
  position: relative;
  display: block;
  height: 2.75em;
  border-radius: .2em;
  background: linear-gradient(#f5efe0 0 36%,var(--c1) 36% 50%,var(--c2) 50% 64%,#f5efe0 64%);
}

.uvq09-cst .lb em {
  position: absolute;
  left: .4em;
  top: .22em;
  font: italic 700 .56em/1 "Segoe Print","Bradley Hand","Marker Felt","Chalkboard SE","Comic Sans MS",cursive;
  color: #1e3a8a;
  white-space: nowrap;
}

.uvq09-cst .wd {
  position: absolute;
  left: 50%;
  top: 1.5em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 4em;
  height: 1.3em;
  padding: 0 .25em;
  translate: -50% 0;
  border-radius: .65em;
  background: rgba(18,12,8,.88);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
  overflow: hidden;
}

.uvq09-cst .r {
  width: .95em;
  height: .95em;
  border-radius: 50%;
  background: radial-gradient(circle,#111 0 24%,transparent 26%),repeating-conic-gradient(#e7e5e4 0 12deg,#8b8b90 12deg 60deg);
  box-shadow: 0 0 0 var(--uvq09-cst-t) #4b2e1b;
  animation: uvq09-cst-s calc(1.8s / var(--k)) linear infinite,uvq09-cst-a calc(24s / var(--k)) linear infinite alternate;
}

.uvq09-cst .r2 {
  animation-direction: normal,alternate-reverse;
}

.uvq09-cst .tx {
  display: grid;
  flex: 1;
  gap: .15em;
  min-width: 0;
}

.uvq09-cst .tx small {
  font-size: .66em;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--c1) 75%,var(--fg));
}

.uvq09-cst .tx b {
  font-size: .92em;
  line-height: 1.2;
}

.uvq09-cst .eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: .85em;
  margin-top: .15em;
}

.uvq09-cst .eq i {
  width: 3px;
  height: 100%;
  border-radius: 1px;
  background: var(--c1);
  transform-origin: bottom;
  animation: uvq09-cst-e calc(0.8s / var(--k)) ease-in-out infinite alternate;
}

.uvq09-cst .eq i:nth-child(2) {
  animation-delay: -.3s;
}

.uvq09-cst .eq i:nth-child(3) {
  animation-delay: -.55s;
}

.uvq09-cst .eq i:nth-child(4) {
  animation-delay: -.15s;
}

.uvq09-cst .eq i:nth-child(5) {
  animation-delay: -.7s;
}

.uvq09-cst .pl {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  color: var(--bg);
  background: var(--fg);
  transition: scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1),opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-cst .pl:hover {
  opacity: .85;
}

.uvq09-cst .pl:active {
  scale: .92;
}

.uvq09-cst .pl:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-cst .pl svg {
  grid-area: 1/1;
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.uvq09-cst .py {
  display: none;
}

.uvq09-cst .tt.ps .pa {
  display: none;
}

.uvq09-cst .tt.ps .py {
  display: block;
}

.uvq09-cst .tt.ps .r,.uvq09-cst .tt.ps .eq i {
  animation-play-state: paused;
}

@keyframes uvq09-cst-s {
  to {
    rotate: 1turn;
  }
}

@keyframes uvq09-cst-a {
  from {
    --uvq09-cst-t: .04em;
  }
  to {
    --uvq09-cst-t: .32em;
  }
}

@keyframes uvq09-cst-e {
  from {
    transform: scaleY(.2);
  }
  to {
    transform: scaleY(1);
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq09-cst").forEach(el => {
  const t=el.querySelector(".tt"),f=el.querySelector(".fire");let tm=[];const clr=()=>{tm.forEach(clearTimeout);tm=[]};const later=(fn,ms)=>tm.push(setTimeout(fn,ms));
const show=()=>{clr();t.classList.remove("in","out");void t.offsetWidth;later(()=>{t.classList.add("in");t.classList.remove('ps');p.setAttribute('aria-label','Pause')},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();const p=t.querySelector(".pl");p.addEventListener("click",()=>{const s=t.classList.toggle("ps");p.setAttribute("aria-label",s?"Play":"Pause")});return clr
});
```

### 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 = `
@property --uvq09-cst-t {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.uvq09-cst {
  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: 21em;
  height: 15em;
}

.uvq09-cst .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 50%;
  top: 1.2em;
  translate: -50% 0;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-size: .82em;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-cst .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq09-cst .fire:active {
  scale: .96;
}

.uvq09-cst .fire:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-cst .tt {
  position: absolute;
  left: 50%;
  bottom: 1em;
  width: 19em;
  translate: -50% 0;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.2em 2.4em -1em rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  gap: .85em;
  padding: .75em .85em;
  transform: translateY(130%) scale(.92);
  opacity: 0;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-cst .tt.in {
  transform: none;
  opacity: 1;
}

.uvq09-cst .cs {
  position: relative;
  flex: none;
  width: 6.4em;
  height: 4.1em;
  padding: .35em .4em;
  border-radius: .45em;
  background: linear-gradient(#2c2c2e,#161617);
  box-shadow: inset 0 1px rgba(255,255,255,.14),0 .3em .6em -.2em rgba(0,0,0,.5);
}

.uvq09-cst .cs::after {
  content: "";
  position: absolute;
  left: 1.3em;
  right: 1.3em;
  bottom: 0;
  height: .7em;
  background: #0c0c0d;
  clip-path: polygon(10% 0,90% 0,100% 100%,0 100%);
}

.uvq09-cst .lb {
  position: relative;
  display: block;
  height: 2.75em;
  border-radius: .2em;
  background: linear-gradient(#f5efe0 0 36%,var(--c1) 36% 50%,var(--c2) 50% 64%,#f5efe0 64%);
}

.uvq09-cst .lb em {
  position: absolute;
  left: .4em;
  top: .22em;
  font: italic 700 .56em/1 "Segoe Print","Bradley Hand","Marker Felt","Chalkboard SE","Comic Sans MS",cursive;
  color: #1e3a8a;
  white-space: nowrap;
}

.uvq09-cst .wd {
  position: absolute;
  left: 50%;
  top: 1.5em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 4em;
  height: 1.3em;
  padding: 0 .25em;
  translate: -50% 0;
  border-radius: .65em;
  background: rgba(18,12,8,.88);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
  overflow: hidden;
}

.uvq09-cst .r {
  width: .95em;
  height: .95em;
  border-radius: 50%;
  background: radial-gradient(circle,#111 0 24%,transparent 26%),repeating-conic-gradient(#e7e5e4 0 12deg,#8b8b90 12deg 60deg);
  box-shadow: 0 0 0 var(--uvq09-cst-t) #4b2e1b;
  animation: uvq09-cst-s calc(1.8s / var(--k)) linear infinite,uvq09-cst-a calc(24s / var(--k)) linear infinite alternate;
}

.uvq09-cst .r2 {
  animation-direction: normal,alternate-reverse;
}

.uvq09-cst .tx {
  display: grid;
  flex: 1;
  gap: .15em;
  min-width: 0;
}

.uvq09-cst .tx small {
  font-size: .66em;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--c1) 75%,var(--fg));
}

.uvq09-cst .tx b {
  font-size: .92em;
  line-height: 1.2;
}

.uvq09-cst .eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: .85em;
  margin-top: .15em;
}

.uvq09-cst .eq i {
  width: 3px;
  height: 100%;
  border-radius: 1px;
  background: var(--c1);
  transform-origin: bottom;
  animation: uvq09-cst-e calc(0.8s / var(--k)) ease-in-out infinite alternate;
}

.uvq09-cst .eq i:nth-child(2) {
  animation-delay: -.3s;
}

.uvq09-cst .eq i:nth-child(3) {
  animation-delay: -.55s;
}

.uvq09-cst .eq i:nth-child(4) {
  animation-delay: -.15s;
}

.uvq09-cst .eq i:nth-child(5) {
  animation-delay: -.7s;
}

.uvq09-cst .pl {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  color: var(--bg);
  background: var(--fg);
  transition: scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1),opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-cst .pl:hover {
  opacity: .85;
}

.uvq09-cst .pl:active {
  scale: .92;
}

.uvq09-cst .pl:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-cst .pl svg {
  grid-area: 1/1;
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.uvq09-cst .py {
  display: none;
}

.uvq09-cst .tt.ps .pa {
  display: none;
}

.uvq09-cst .tt.ps .py {
  display: block;
}

.uvq09-cst .tt.ps .r,.uvq09-cst .tt.ps .eq i {
  animation-play-state: paused;
}

@keyframes uvq09-cst-s {
  to {
    rotate: 1turn;
  }
}

@keyframes uvq09-cst-a {
  from {
    --uvq09-cst-t: .04em;
  }
  to {
    --uvq09-cst-t: .32em;
  }
}

@keyframes uvq09-cst-e {
  from {
    transform: scaleY(.2);
  }
  to {
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq09-cst,.uvq09-cst *,.uvq09-cst *::before,.uvq09-cst *::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 t=el.querySelector(".tt"),f=el.querySelector(".fire");let tm=[];const clr=()=>{tm.forEach(clearTimeout);tm=[]};const later=(fn,ms)=>tm.push(setTimeout(fn,ms));
const show=()=>{clr();t.classList.remove("in","out");void t.offsetWidth;later(()=>{t.classList.add("in");t.classList.remove('ps');p.setAttribute('aria-label','Pause')},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();const p=t.querySelector(".pl");p.addEventListener("click",()=>{const s=t.classList.toggle("ps");p.setAttribute("aria-label",s?"Play":"Pause")});return clr
}

export default function ToastCassetteTape() {
  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": "#e11d48",
          "--c2": "#f59e0b",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq09-cst"><button type="button" className="fire">Show again</button><div className="tt" role="status"><span className="cs" aria-hidden="true"><span className="lb"><em>Summer mix 86</em></span><span className="wd"><i className="r r1"></i><i className="r r2"></i></span></span><span className="tx"><small>Now playing</small><b>Side A · Track 3</b><span className="eq" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></span></span><button type="button" className="pl" aria-label="Pause"><svg className="pa" viewBox="0 0 24 24" aria-hidden="true"><rect x="6" y="5" width="4" height="14" rx="1.2" /><rect x="14" y="5" width="4" height="14" rx="1.2" /></svg><svg className="py" viewBox="0 0 24 24" aria-hidden="true"><path d="M7.5 4.8v14.4a.8.8 0 0 0 1.2.7l11.3-7.2a.8.8 0 0 0 0-1.4L8.7 4.1a.8.8 0 0 0-1.2.7z" /></svg></button></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 “Cassette tape toast” block (Toasts) from AIMRAN Library to my project.

## What it is
A cassette spins its reels while the song plays; the button pauses it and starts it again.

## Chosen settings
- Main color: #e11d48
- Secondary color: #f59e0b
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Cara A · Pista 3"

## 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 = `
@property --uvq09-cst-t {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.uvq09-cst {
  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: 21em;
  height: 15em;
}

.uvq09-cst .fire {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  left: 50%;
  top: 1.2em;
  translate: -50% 0;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-size: .82em;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  transition: color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-cst .fire:hover {
  color: var(--fg);
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq09-cst .fire:active {
  scale: .96;
}

.uvq09-cst .fire:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-cst .tt {
  position: absolute;
  left: 50%;
  bottom: 1em;
  width: 19em;
  translate: -50% 0;
  border-radius: 1.1em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.2em 2.4em -1em rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  gap: .85em;
  padding: .75em .85em;
  transform: translateY(130%) scale(.92);
  opacity: 0;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-cst .tt.in {
  transform: none;
  opacity: 1;
}

.uvq09-cst .cs {
  position: relative;
  flex: none;
  width: 6.4em;
  height: 4.1em;
  padding: .35em .4em;
  border-radius: .45em;
  background: linear-gradient(#2c2c2e,#161617);
  box-shadow: inset 0 1px rgba(255,255,255,.14),0 .3em .6em -.2em rgba(0,0,0,.5);
}

.uvq09-cst .cs::after {
  content: "";
  position: absolute;
  left: 1.3em;
  right: 1.3em;
  bottom: 0;
  height: .7em;
  background: #0c0c0d;
  clip-path: polygon(10% 0,90% 0,100% 100%,0 100%);
}

.uvq09-cst .lb {
  position: relative;
  display: block;
  height: 2.75em;
  border-radius: .2em;
  background: linear-gradient(#f5efe0 0 36%,var(--c1) 36% 50%,var(--c2) 50% 64%,#f5efe0 64%);
}

.uvq09-cst .lb em {
  position: absolute;
  left: .4em;
  top: .22em;
  font: italic 700 .56em/1 "Segoe Print","Bradley Hand","Marker Felt","Chalkboard SE","Comic Sans MS",cursive;
  color: #1e3a8a;
  white-space: nowrap;
}

.uvq09-cst .wd {
  position: absolute;
  left: 50%;
  top: 1.5em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 4em;
  height: 1.3em;
  padding: 0 .25em;
  translate: -50% 0;
  border-radius: .65em;
  background: rgba(18,12,8,.88);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
  overflow: hidden;
}

.uvq09-cst .r {
  width: .95em;
  height: .95em;
  border-radius: 50%;
  background: radial-gradient(circle,#111 0 24%,transparent 26%),repeating-conic-gradient(#e7e5e4 0 12deg,#8b8b90 12deg 60deg);
  box-shadow: 0 0 0 var(--uvq09-cst-t) #4b2e1b;
  animation: uvq09-cst-s calc(1.8s / var(--k)) linear infinite,uvq09-cst-a calc(24s / var(--k)) linear infinite alternate;
}

.uvq09-cst .r2 {
  animation-direction: normal,alternate-reverse;
}

.uvq09-cst .tx {
  display: grid;
  flex: 1;
  gap: .15em;
  min-width: 0;
}

.uvq09-cst .tx small {
  font-size: .66em;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: color-mix(in srgb,var(--c1) 75%,var(--fg));
}

.uvq09-cst .tx b {
  font-size: .92em;
  line-height: 1.2;
}

.uvq09-cst .eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: .85em;
  margin-top: .15em;
}

.uvq09-cst .eq i {
  width: 3px;
  height: 100%;
  border-radius: 1px;
  background: var(--c1);
  transform-origin: bottom;
  animation: uvq09-cst-e calc(0.8s / var(--k)) ease-in-out infinite alternate;
}

.uvq09-cst .eq i:nth-child(2) {
  animation-delay: -.3s;
}

.uvq09-cst .eq i:nth-child(3) {
  animation-delay: -.55s;
}

.uvq09-cst .eq i:nth-child(4) {
  animation-delay: -.15s;
}

.uvq09-cst .eq i:nth-child(5) {
  animation-delay: -.7s;
}

.uvq09-cst .pl {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  color: var(--bg);
  background: var(--fg);
  transition: scale calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1),opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq09-cst .pl:hover {
  opacity: .85;
}

.uvq09-cst .pl:active {
  scale: .92;
}

.uvq09-cst .pl:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq09-cst .pl svg {
  grid-area: 1/1;
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.uvq09-cst .py {
  display: none;
}

.uvq09-cst .tt.ps .pa {
  display: none;
}

.uvq09-cst .tt.ps .py {
  display: block;
}

.uvq09-cst .tt.ps .r,.uvq09-cst .tt.ps .eq i {
  animation-play-state: paused;
}

@keyframes uvq09-cst-s {
  to {
    rotate: 1turn;
  }
}

@keyframes uvq09-cst-a {
  from {
    --uvq09-cst-t: .04em;
  }
  to {
    --uvq09-cst-t: .32em;
  }
}

@keyframes uvq09-cst-e {
  from {
    transform: scaleY(.2);
  }
  to {
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq09-cst,.uvq09-cst *,.uvq09-cst *::before,.uvq09-cst *::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 t=el.querySelector(".tt"),f=el.querySelector(".fire");let tm=[];const clr=()=>{tm.forEach(clearTimeout);tm=[]};const later=(fn,ms)=>tm.push(setTimeout(fn,ms));
const show=()=>{clr();t.classList.remove("in","out");void t.offsetWidth;later(()=>{t.classList.add("in");t.classList.remove('ps');p.setAttribute('aria-label','Pause')},60)};
const hide=()=>{t.classList.remove("in");t.classList.add("out")};f.addEventListener("click",show);show();const p=t.querySelector(".pl");p.addEventListener("click",()=>{const s=t.classList.toggle("ps");p.setAttribute("aria-label",s?"Play":"Pause")});return clr
}

export default function ToastCassetteTape() {
  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": "#e11d48",
          "--c2": "#f59e0b",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq09-cst"><button type="button" className="fire">Show again</button><div className="tt" role="status"><span className="cs" aria-hidden="true"><span className="lb"><em>Summer mix 86</em></span><span className="wd"><i className="r r1"></i><i className="r r2"></i></span></span><span className="tx"><small>Now playing</small><b>Side A · Track 3</b><span className="eq" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></span></span><button type="button" className="pl" aria-label="Pause"><svg className="pa" viewBox="0 0 24 24" aria-hidden="true"><rect x="6" y="5" width="4" height="14" rx="1.2" /><rect x="14" y="5" width="4" height="14" rx="1.2" /></svg><svg className="py" viewBox="0 0 24 24" aria-hidden="true"><path d="M7.5 4.8v14.4a.8.8 0 0 0 1.2.7l11.3-7.2a.8.8 0 0 0 0-1.4L8.7 4.1a.8.8 0 0 0-1.2.7z" /></svg></button></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.
````
