# Rolling film end credits

> A film's end credits drift up the dark cinema screen on their own; they stop under the pointer and can be scrolled by hand.

- Category: [Text & scroll](https://library.aimran.es/components/text-scroll)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-tx-end-credits
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

End credits are the last thing an audience reads in a cinema, and this block turns them into a closing section: roles and names in two columns, a serif title, film grain and a soft vignette, rolling up slowly inside their own scroll box. It fits team pages, project wrap-ups, event thank-you pages and the footer of a portfolio.

Write the film title in the text field and edit the roles and names in the list. The main color tints the title and section heads, the secondary one the screen. The roll pauses on hover or focus, the button stops it, and with reduced motion it starts paused.

## Code

### HTML

```html
<div class="uvq14-crd"><div class="sc" tabindex="0" aria-label="Credits"><div class="rl"><p class="kc">A film by Estudio Aurora</p><h3>The last show</h3><p class="ln"><span class="r">Director</span><span class="n">Lucía Ferrer</span></p><p class="ln"><span class="r">Screenplay</span><span class="n">Marcos Ibáñez</span></p><p class="ln"><span class="r">Cinematography</span><span class="n">Ana Beltrán</span></p><p class="ln"><span class="r">Editing</span><span class="n">Tomás Rey</span></p><p class="ln"><span class="r">Music</span><span class="n">Orquesta del Puerto</span></p><p class="hd">Cast</p><p class="ln"><span class="r">Elena</span><span class="n">Carmen Soler</span></p><p class="ln"><span class="r">The usher</span><span class="n">Diego Lara</span></p><p class="ln"><span class="r">The box office clerk</span><span class="n">Nuria Vidal</span></p><p class="hd">Filmed in Valencia and Teruel</p><p class="fin">The End</p></div></div><i class="gr" aria-hidden="true"></i><button type="button" class="pl" aria-pressed="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6v12M15 6v12"/></svg><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 5.5v13l10.5-6.5z" fill="currentColor"/></svg><span>Roll credits</span></button></div>
```

### CSS

```css
.uvq14-crd {
  --c1: #f5d28a;
  --c2: #0b0b0d;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq14-crd {
  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: 22em;
  height: 17em;
  border-radius: 1.2em;
  overflow: hidden;
  color: #ecebe6;
  background: radial-gradient(120% 90% at 50% 40%,color-mix(in srgb,var(--c2) 80%,#2a2620),var(--c2));
  box-shadow: 0 0 0 1px rgba(255,255,255,.07),0 1.6em 2.8em -1.4em rgba(0,0,0,.6);
}

.uvq14-crd .sc {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  outline: 0;
  scroll-behavior: auto;
  scrollbar-width: none;
  -webkit-mask: linear-gradient(transparent,#000 22%,#000 70%,transparent);
  mask: linear-gradient(transparent,#000 22%,#000 70%,transparent);
}

.uvq14-crd .sc::-webkit-scrollbar {
  display: none;
}

.uvq14-crd .sc:focus-visible {
  box-shadow: inset 0 0 0 2px var(--c1);
  border-radius: 1.2em;
}

.uvq14-crd .rl {
  padding: 4.2em 1.2em 9em;
  text-align: center;
}

.uvq14-crd .kc {
  margin: 0;
  font-size: .62em;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: rgba(236,235,230,.6);
}

.uvq14-crd h3 {
  margin: .35em 0 1.6em;
  font: 400 2em/1.05 "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  letter-spacing: .02em;
  color: var(--c1);
  text-wrap: balance;
}

.uvq14-crd .hd {
  margin: 1.6em 0 .6em;
  font-size: .6em;
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--c1);
}

.uvq14-crd .ln {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9em;
  margin: 0 0 .45em;
  font-size: .82em;
  line-height: 1.3;
}

.uvq14-crd .r {
  text-align: right;
  font-size: .78em;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(236,235,230,.55);
  padding-top: .15em;
}

.uvq14-crd .n {
  text-align: left;
  font-family: "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  font-size: 1.05em;
}

.uvq14-crd .fin {
  margin: 2.4em 0 0;
  font: italic 400 1.6em/1 "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  color: var(--c1);
}

.uvq14-crd .gr {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(rgba(255,255,255,.05) .5px,transparent .9px) 0 0/3px 3px,radial-gradient(ellipse at center,transparent 55%,rgba(0,0,0,.55));
  animation: uvq14-crd-g calc(0.4s / var(--k)) steps(3) infinite;
}

.uvq14-crd .pl {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  right: .8em;
  bottom: .8em;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .45em .8em .45em .6em;
  border-radius: 2em;
  font-size: .68em;
  font-weight: 700;
  color: var(--c2);
  background: var(--c1);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1),opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-crd .pl:hover {
  transform: translateY(-2px);
}

.uvq14-crd .pl:active {
  transform: scale(.94);
}

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

.uvq14-crd .pl svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq14-crd .pl[aria-pressed=true] svg:nth-of-type(2),.uvq14-crd .pl[aria-pressed=false] svg:first-of-type {
  display: none;
}

@keyframes uvq14-crd-g {
  33% {
    background-position: 1px 2px,0 0;
  }
  66% {
    background-position: 2px 1px,0 0;
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq14-crd").forEach(el => {
  const sc=el.querySelector(".sc"),pl=el.querySelector(".pl");const k=parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1;const rm=matchMedia("(prefers-reduced-motion: reduce)").matches;let on=!rm,hold=false,vis=false,raf=0,last=0,pos=0,wait=0;
pl.setAttribute("aria-pressed",String(on));
let mine=false;const to=y=>{mine=true;sc.scrollTo({top:y,behavior:"instant"})};sc.addEventListener("scroll",()=>{if(mine)mine=false;else pos=sc.scrollTop},{passive:true});
const loop=t=>{const dt=last?Math.min(64,t-last):16;last=t;if(on&&!hold){const m=sc.scrollHeight-sc.clientHeight;if(pos>=m-1){wait+=dt;if(wait>2400){wait=0;pos=0;to(0)}}else{pos=Math.min(m,pos+dt*.024*k);if(Math.round(pos)!==Math.round(sc.scrollTop))to(Math.round(pos))}}raf=vis&&on?requestAnimationFrame(loop):0};
const run=()=>{if(!raf&&vis&&on){last=0;pos=sc.scrollTop;raf=requestAnimationFrame(loop)}};
pl.addEventListener("click",()=>{on=!on;pl.setAttribute("aria-pressed",String(on));run()});
el.addEventListener("pointerenter",()=>hold=true);el.addEventListener("pointerleave",()=>hold=false);
sc.addEventListener("focus",()=>hold=true);sc.addEventListener("blur",()=>hold=false);
const io=new IntersectionObserver(es=>{vis=es[0].isIntersecting;run()});io.observe(el);
return()=>{io.disconnect();cancelAnimationFrame(raf)}
});
```

### 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 = `
.uvq14-crd {
  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: 22em;
  height: 17em;
  border-radius: 1.2em;
  overflow: hidden;
  color: #ecebe6;
  background: radial-gradient(120% 90% at 50% 40%,color-mix(in srgb,var(--c2) 80%,#2a2620),var(--c2));
  box-shadow: 0 0 0 1px rgba(255,255,255,.07),0 1.6em 2.8em -1.4em rgba(0,0,0,.6);
}

.uvq14-crd .sc {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  outline: 0;
  scroll-behavior: auto;
  scrollbar-width: none;
  -webkit-mask: linear-gradient(transparent,#000 22%,#000 70%,transparent);
  mask: linear-gradient(transparent,#000 22%,#000 70%,transparent);
}

.uvq14-crd .sc::-webkit-scrollbar {
  display: none;
}

.uvq14-crd .sc:focus-visible {
  box-shadow: inset 0 0 0 2px var(--c1);
  border-radius: 1.2em;
}

.uvq14-crd .rl {
  padding: 4.2em 1.2em 9em;
  text-align: center;
}

.uvq14-crd .kc {
  margin: 0;
  font-size: .62em;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: rgba(236,235,230,.6);
}

.uvq14-crd h3 {
  margin: .35em 0 1.6em;
  font: 400 2em/1.05 "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  letter-spacing: .02em;
  color: var(--c1);
  text-wrap: balance;
}

.uvq14-crd .hd {
  margin: 1.6em 0 .6em;
  font-size: .6em;
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--c1);
}

.uvq14-crd .ln {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9em;
  margin: 0 0 .45em;
  font-size: .82em;
  line-height: 1.3;
}

.uvq14-crd .r {
  text-align: right;
  font-size: .78em;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(236,235,230,.55);
  padding-top: .15em;
}

.uvq14-crd .n {
  text-align: left;
  font-family: "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  font-size: 1.05em;
}

.uvq14-crd .fin {
  margin: 2.4em 0 0;
  font: italic 400 1.6em/1 "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  color: var(--c1);
}

.uvq14-crd .gr {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(rgba(255,255,255,.05) .5px,transparent .9px) 0 0/3px 3px,radial-gradient(ellipse at center,transparent 55%,rgba(0,0,0,.55));
  animation: uvq14-crd-g calc(0.4s / var(--k)) steps(3) infinite;
}

.uvq14-crd .pl {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  right: .8em;
  bottom: .8em;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .45em .8em .45em .6em;
  border-radius: 2em;
  font-size: .68em;
  font-weight: 700;
  color: var(--c2);
  background: var(--c1);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1),opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-crd .pl:hover {
  transform: translateY(-2px);
}

.uvq14-crd .pl:active {
  transform: scale(.94);
}

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

.uvq14-crd .pl svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq14-crd .pl[aria-pressed=true] svg:nth-of-type(2),.uvq14-crd .pl[aria-pressed=false] svg:first-of-type {
  display: none;
}

@keyframes uvq14-crd-g {
  33% {
    background-position: 1px 2px,0 0;
  }
  66% {
    background-position: 2px 1px,0 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq14-crd,.uvq14-crd *,.uvq14-crd *::before,.uvq14-crd *::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 sc=el.querySelector(".sc"),pl=el.querySelector(".pl");const k=parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1;const rm=matchMedia("(prefers-reduced-motion: reduce)").matches;let on=!rm,hold=false,vis=false,raf=0,last=0,pos=0,wait=0;
pl.setAttribute("aria-pressed",String(on));
let mine=false;const to=y=>{mine=true;sc.scrollTo({top:y,behavior:"instant"})};sc.addEventListener("scroll",()=>{if(mine)mine=false;else pos=sc.scrollTop},{passive:true});
const loop=t=>{const dt=last?Math.min(64,t-last):16;last=t;if(on&&!hold){const m=sc.scrollHeight-sc.clientHeight;if(pos>=m-1){wait+=dt;if(wait>2400){wait=0;pos=0;to(0)}}else{pos=Math.min(m,pos+dt*.024*k);if(Math.round(pos)!==Math.round(sc.scrollTop))to(Math.round(pos))}}raf=vis&&on?requestAnimationFrame(loop):0};
const run=()=>{if(!raf&&vis&&on){last=0;pos=sc.scrollTop;raf=requestAnimationFrame(loop)}};
pl.addEventListener("click",()=>{on=!on;pl.setAttribute("aria-pressed",String(on));run()});
el.addEventListener("pointerenter",()=>hold=true);el.addEventListener("pointerleave",()=>hold=false);
sc.addEventListener("focus",()=>hold=true);sc.addEventListener("blur",()=>hold=false);
const io=new IntersectionObserver(es=>{vis=es[0].isIntersecting;run()});io.observe(el);
return()=>{io.disconnect();cancelAnimationFrame(raf)}
}

export default function TxEndCredits() {
  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": "#f5d28a",
          "--c2": "#0b0b0d",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq14-crd"><div className="sc" tabIndex={0} aria-label="Credits"><div className="rl"><p className="kc">A film by Estudio Aurora</p><h3>The last show</h3><p className="ln"><span className="r">Director</span><span className="n">Lucía Ferrer</span></p><p className="ln"><span className="r">Screenplay</span><span className="n">Marcos Ibáñez</span></p><p className="ln"><span className="r">Cinematography</span><span className="n">Ana Beltrán</span></p><p className="ln"><span className="r">Editing</span><span className="n">Tomás Rey</span></p><p className="ln"><span className="r">Music</span><span className="n">Orquesta del Puerto</span></p><p className="hd">Cast</p><p className="ln"><span className="r">Elena</span><span className="n">Carmen Soler</span></p><p className="ln"><span className="r">The usher</span><span className="n">Diego Lara</span></p><p className="ln"><span className="r">The box office clerk</span><span className="n">Nuria Vidal</span></p><p className="hd">Filmed in Valencia and Teruel</p><p className="fin">The End</p></div></div><i className="gr" aria-hidden="true"></i><button type="button" className="pl" aria-pressed="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M9 6v12M15 6v12" /></svg><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M8 5.5v13l10.5-6.5z" fill="currentColor" /></svg><span>Roll credits</span></button></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 “Rolling film end credits” block (Text & scroll) from AIMRAN Library to my project.

## What it is
A film's end credits drift up the dark cinema screen on their own; they stop under the pointer and can be scrolled by hand.

## Chosen settings
- Main color: #f5d28a
- Secondary color: #0b0b0d
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "La última función"

## 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 = `
.uvq14-crd {
  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: 22em;
  height: 17em;
  border-radius: 1.2em;
  overflow: hidden;
  color: #ecebe6;
  background: radial-gradient(120% 90% at 50% 40%,color-mix(in srgb,var(--c2) 80%,#2a2620),var(--c2));
  box-shadow: 0 0 0 1px rgba(255,255,255,.07),0 1.6em 2.8em -1.4em rgba(0,0,0,.6);
}

.uvq14-crd .sc {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  outline: 0;
  scroll-behavior: auto;
  scrollbar-width: none;
  -webkit-mask: linear-gradient(transparent,#000 22%,#000 70%,transparent);
  mask: linear-gradient(transparent,#000 22%,#000 70%,transparent);
}

.uvq14-crd .sc::-webkit-scrollbar {
  display: none;
}

.uvq14-crd .sc:focus-visible {
  box-shadow: inset 0 0 0 2px var(--c1);
  border-radius: 1.2em;
}

.uvq14-crd .rl {
  padding: 4.2em 1.2em 9em;
  text-align: center;
}

.uvq14-crd .kc {
  margin: 0;
  font-size: .62em;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: rgba(236,235,230,.6);
}

.uvq14-crd h3 {
  margin: .35em 0 1.6em;
  font: 400 2em/1.05 "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  letter-spacing: .02em;
  color: var(--c1);
  text-wrap: balance;
}

.uvq14-crd .hd {
  margin: 1.6em 0 .6em;
  font-size: .6em;
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--c1);
}

.uvq14-crd .ln {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9em;
  margin: 0 0 .45em;
  font-size: .82em;
  line-height: 1.3;
}

.uvq14-crd .r {
  text-align: right;
  font-size: .78em;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(236,235,230,.55);
  padding-top: .15em;
}

.uvq14-crd .n {
  text-align: left;
  font-family: "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  font-size: 1.05em;
}

.uvq14-crd .fin {
  margin: 2.4em 0 0;
  font: italic 400 1.6em/1 "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  color: var(--c1);
}

.uvq14-crd .gr {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(rgba(255,255,255,.05) .5px,transparent .9px) 0 0/3px 3px,radial-gradient(ellipse at center,transparent 55%,rgba(0,0,0,.55));
  animation: uvq14-crd-g calc(0.4s / var(--k)) steps(3) infinite;
}

.uvq14-crd .pl {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: absolute;
  right: .8em;
  bottom: .8em;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .45em .8em .45em .6em;
  border-radius: 2em;
  font-size: .68em;
  font-weight: 700;
  color: var(--c2);
  background: var(--c1);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1),opacity calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-crd .pl:hover {
  transform: translateY(-2px);
}

.uvq14-crd .pl:active {
  transform: scale(.94);
}

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

.uvq14-crd .pl svg {
  width: 1.15em;
  height: 1.15em;
}

.uvq14-crd .pl[aria-pressed=true] svg:nth-of-type(2),.uvq14-crd .pl[aria-pressed=false] svg:first-of-type {
  display: none;
}

@keyframes uvq14-crd-g {
  33% {
    background-position: 1px 2px,0 0;
  }
  66% {
    background-position: 2px 1px,0 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq14-crd,.uvq14-crd *,.uvq14-crd *::before,.uvq14-crd *::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 sc=el.querySelector(".sc"),pl=el.querySelector(".pl");const k=parseFloat(getComputedStyle(el).getPropertyValue("--k"))||1;const rm=matchMedia("(prefers-reduced-motion: reduce)").matches;let on=!rm,hold=false,vis=false,raf=0,last=0,pos=0,wait=0;
pl.setAttribute("aria-pressed",String(on));
let mine=false;const to=y=>{mine=true;sc.scrollTo({top:y,behavior:"instant"})};sc.addEventListener("scroll",()=>{if(mine)mine=false;else pos=sc.scrollTop},{passive:true});
const loop=t=>{const dt=last?Math.min(64,t-last):16;last=t;if(on&&!hold){const m=sc.scrollHeight-sc.clientHeight;if(pos>=m-1){wait+=dt;if(wait>2400){wait=0;pos=0;to(0)}}else{pos=Math.min(m,pos+dt*.024*k);if(Math.round(pos)!==Math.round(sc.scrollTop))to(Math.round(pos))}}raf=vis&&on?requestAnimationFrame(loop):0};
const run=()=>{if(!raf&&vis&&on){last=0;pos=sc.scrollTop;raf=requestAnimationFrame(loop)}};
pl.addEventListener("click",()=>{on=!on;pl.setAttribute("aria-pressed",String(on));run()});
el.addEventListener("pointerenter",()=>hold=true);el.addEventListener("pointerleave",()=>hold=false);
sc.addEventListener("focus",()=>hold=true);sc.addEventListener("blur",()=>hold=false);
const io=new IntersectionObserver(es=>{vis=es[0].isIntersecting;run()});io.observe(el);
return()=>{io.disconnect();cancelAnimationFrame(raf)}
}

export default function TxEndCredits() {
  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": "#f5d28a",
          "--c2": "#0b0b0d",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq14-crd"><div className="sc" tabIndex={0} aria-label="Credits"><div className="rl"><p className="kc">A film by Estudio Aurora</p><h3>The last show</h3><p className="ln"><span className="r">Director</span><span className="n">Lucía Ferrer</span></p><p className="ln"><span className="r">Screenplay</span><span className="n">Marcos Ibáñez</span></p><p className="ln"><span className="r">Cinematography</span><span className="n">Ana Beltrán</span></p><p className="ln"><span className="r">Editing</span><span className="n">Tomás Rey</span></p><p className="ln"><span className="r">Music</span><span className="n">Orquesta del Puerto</span></p><p className="hd">Cast</p><p className="ln"><span className="r">Elena</span><span className="n">Carmen Soler</span></p><p className="ln"><span className="r">The usher</span><span className="n">Diego Lara</span></p><p className="ln"><span className="r">The box office clerk</span><span className="n">Nuria Vidal</span></p><p className="hd">Filmed in Valencia and Teruel</p><p className="fin">The End</p></div></div><i className="gr" aria-hidden="true"></i><button type="button" className="pl" aria-pressed="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M9 6v12M15 6v12" /></svg><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M8 5.5v13l10.5-6.5z" fill="currentColor" /></svg><span>Roll credits</span></button></div>
      </div>
    </>
  );
}
```

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