# Redacted typewritten report

> A typewritten case file with black censor bars that pull away one by one when pressed, or all at once.

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

## Where to use it

Black redaction bars make any text feel like a secret worth reading. In this report each bar is a real button over the hidden words, so keyboards and screen readers reach them, and a clip path gives the marker strokes uneven edges. Use it for mystery campaigns, case studies, product reveals or a playful about page.

Swap the hidden phrases for your own and change the stamp color with the main color and the bars with the secondary one. The declassify button reveals everything in sequence and can hide it again, while each bar keeps its own pressed state.

## Code

### HTML

```html
<article class="uvq14-red"><header><span class="cl">Confidential</span><span>File 27/B</span></header><h3>Field report</h3><p>On the 14th the team reached <button type="button" class="rd" aria-pressed="false">Valdeluz</button> at <button type="button" class="rd" aria-pressed="false">06:40</button>. The contact, known as <button type="button" class="rd" aria-pressed="false">the Librarian</button>, handed over <button type="button" class="rd" aria-pressed="false">three sealed envelopes</button> and drove off in a <button type="button" class="rd" aria-pressed="false">blue Seat 600</button>.</p><footer><button type="button" class="all" aria-pressed="false">Declassify all</button><span class="sg">Signature: illegible</span></footer></article>
```

### CSS

```css
.uvq14-red {
  --c1: #dc2626;
  --c2: #16161a;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq14-red {
  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: 19em;
  padding: 1.2em 1.3em 1.1em;
  border-radius: .3em;
  color: #222;
  background: linear-gradient(rgba(120,90,40,.05),transparent 30%),repeating-linear-gradient(0deg,rgba(0,0,0,.018) 0 2px,transparent 2px 4px),#f4f0e6;
  box-shadow: 0 .1em .2em rgba(0,0,0,.12),0 1.2em 2em -1.2em rgba(0,0,0,.35);
  font-family: ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  rotate: -.6deg;
}

.uvq14-red header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .66em;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #555;
}

.uvq14-red .cl {
  padding: .25em .55em;
  border: 2px solid var(--c1);
  border-radius: .2em;
  color: var(--c1);
  rotate: -6deg;
  letter-spacing: .18em;
  mix-blend-mode: multiply;
}

.uvq14-red h3 {
  margin: .9em 0 .5em;
  font-size: 1.05em;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.uvq14-red p {
  margin: 0;
  font-size: .82em;
  line-height: 1.85;
}

.uvq14-red .rd {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  padding: 0 .15em;
  border-radius: .1em;
  font-weight: 700;
  color: inherit;
  transition: background calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-red .rd::before {
  content: "";
  position: absolute;
  inset: .12em -.12em;
  border-radius: .08em;
  background: var(--c2);
  transform-origin: 100% 50%;
  clip-path: polygon(0 8%,30% 0,62% 6%,100% 0,99% 92%,70% 100%,35% 94%,1% 100%);
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.22,1,.36,1) calc(var(--d,0) * calc(0.09s / var(--k))),translate calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-red .rd:hover::before {
  translate: 0 -2px;
}

.uvq14-red .rd:active::before {
  translate: 0 1px;
}

.uvq14-red .rd[aria-pressed=true] {
  background: color-mix(in srgb,var(--c1) 16%,transparent);
}

.uvq14-red .rd[aria-pressed=true]::before {
  transform: scaleX(0);
}

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

.uvq14-red footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1em;
}

.uvq14-red .all {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .45em .8em;
  border: 1.5px solid #222;
  border-radius: .2em;
  font-size: .7em;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq14-red .all:hover {
  color: #f4f0e6;
  background: #222;
}

.uvq14-red .all:active {
  transform: scale(.95);
}

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

.uvq14-red .sg {
  font-size: .66em;
  font-style: italic;
  color: #777;
}

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

### JavaScript

```js
document.querySelectorAll(".uvq14-red").forEach(el => {
  const rs=[...el.querySelectorAll(".rd")],all=el.querySelector(".all");const sync=()=>all.setAttribute("aria-pressed",String(rs.every(r=>r.getAttribute("aria-pressed")==="true")));
rs.forEach(r=>r.addEventListener("click",()=>{r.style.setProperty("--d","0");r.setAttribute("aria-pressed",String(r.getAttribute("aria-pressed")!=="true"));sync()}));
all.addEventListener("click",()=>{const on=all.getAttribute("aria-pressed")!=="true";rs.forEach((r,i)=>{r.style.setProperty("--d",String(i));r.setAttribute("aria-pressed",String(on))});sync()})
});
```

### 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-red {
  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: 19em;
  padding: 1.2em 1.3em 1.1em;
  border-radius: .3em;
  color: #222;
  background: linear-gradient(rgba(120,90,40,.05),transparent 30%),repeating-linear-gradient(0deg,rgba(0,0,0,.018) 0 2px,transparent 2px 4px),#f4f0e6;
  box-shadow: 0 .1em .2em rgba(0,0,0,.12),0 1.2em 2em -1.2em rgba(0,0,0,.35);
  font-family: ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  rotate: -.6deg;
}

.uvq14-red header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .66em;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #555;
}

.uvq14-red .cl {
  padding: .25em .55em;
  border: 2px solid var(--c1);
  border-radius: .2em;
  color: var(--c1);
  rotate: -6deg;
  letter-spacing: .18em;
  mix-blend-mode: multiply;
}

.uvq14-red h3 {
  margin: .9em 0 .5em;
  font-size: 1.05em;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.uvq14-red p {
  margin: 0;
  font-size: .82em;
  line-height: 1.85;
}

.uvq14-red .rd {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  padding: 0 .15em;
  border-radius: .1em;
  font-weight: 700;
  color: inherit;
  transition: background calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-red .rd::before {
  content: "";
  position: absolute;
  inset: .12em -.12em;
  border-radius: .08em;
  background: var(--c2);
  transform-origin: 100% 50%;
  clip-path: polygon(0 8%,30% 0,62% 6%,100% 0,99% 92%,70% 100%,35% 94%,1% 100%);
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.22,1,.36,1) calc(var(--d,0) * calc(0.09s / var(--k))),translate calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-red .rd:hover::before {
  translate: 0 -2px;
}

.uvq14-red .rd:active::before {
  translate: 0 1px;
}

.uvq14-red .rd[aria-pressed=true] {
  background: color-mix(in srgb,var(--c1) 16%,transparent);
}

.uvq14-red .rd[aria-pressed=true]::before {
  transform: scaleX(0);
}

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

.uvq14-red footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1em;
}

.uvq14-red .all {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .45em .8em;
  border: 1.5px solid #222;
  border-radius: .2em;
  font-size: .7em;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq14-red .all:hover {
  color: #f4f0e6;
  background: #222;
}

.uvq14-red .all:active {
  transform: scale(.95);
}

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

.uvq14-red .sg {
  font-size: .66em;
  font-style: italic;
  color: #777;
}

@media (prefers-reduced-motion:reduce) {
  .uvq14-red,.uvq14-red *,.uvq14-red *::before,.uvq14-red *::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 rs=[...el.querySelectorAll(".rd")],all=el.querySelector(".all");const sync=()=>all.setAttribute("aria-pressed",String(rs.every(r=>r.getAttribute("aria-pressed")==="true")));
rs.forEach(r=>r.addEventListener("click",()=>{r.style.setProperty("--d","0");r.setAttribute("aria-pressed",String(r.getAttribute("aria-pressed")!=="true"));sync()}));
all.addEventListener("click",()=>{const on=all.getAttribute("aria-pressed")!=="true";rs.forEach((r,i)=>{r.style.setProperty("--d",String(i));r.setAttribute("aria-pressed",String(on))});sync()})
}

export default function TxRedacted() {
  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": "#dc2626",
          "--c2": "#16161a",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <article className="uvq14-red"><header><span className="cl">Confidential</span><span>File 27/B</span></header><h3>Field report</h3><p>On the 14th the team reached <button type="button" className="rd" aria-pressed="false">Valdeluz</button> at <button type="button" className="rd" aria-pressed="false">06:40</button>. The contact, known as <button type="button" className="rd" aria-pressed="false">the Librarian</button>, handed over <button type="button" className="rd" aria-pressed="false">three sealed envelopes</button> and drove off in a <button type="button" className="rd" aria-pressed="false">blue Seat 600</button>.</p><footer><button type="button" className="all" aria-pressed="false">Declassify all</button><span className="sg">Signature: illegible</span></footer></article>
      </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 “Redacted typewritten report” block (Text & scroll) from AIMRAN Library to my project.

## What it is
A typewritten case file with black censor bars that pull away one by one when pressed, or all at once.

## Chosen settings
- Main color: #dc2626
- Secondary color: #16161a
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Informe de campo"

## 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-red {
  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: 19em;
  padding: 1.2em 1.3em 1.1em;
  border-radius: .3em;
  color: #222;
  background: linear-gradient(rgba(120,90,40,.05),transparent 30%),repeating-linear-gradient(0deg,rgba(0,0,0,.018) 0 2px,transparent 2px 4px),#f4f0e6;
  box-shadow: 0 .1em .2em rgba(0,0,0,.12),0 1.2em 2em -1.2em rgba(0,0,0,.35);
  font-family: ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  rotate: -.6deg;
}

.uvq14-red header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .66em;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #555;
}

.uvq14-red .cl {
  padding: .25em .55em;
  border: 2px solid var(--c1);
  border-radius: .2em;
  color: var(--c1);
  rotate: -6deg;
  letter-spacing: .18em;
  mix-blend-mode: multiply;
}

.uvq14-red h3 {
  margin: .9em 0 .5em;
  font-size: 1.05em;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.uvq14-red p {
  margin: 0;
  font-size: .82em;
  line-height: 1.85;
}

.uvq14-red .rd {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  padding: 0 .15em;
  border-radius: .1em;
  font-weight: 700;
  color: inherit;
  transition: background calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-red .rd::before {
  content: "";
  position: absolute;
  inset: .12em -.12em;
  border-radius: .08em;
  background: var(--c2);
  transform-origin: 100% 50%;
  clip-path: polygon(0 8%,30% 0,62% 6%,100% 0,99% 92%,70% 100%,35% 94%,1% 100%);
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.22,1,.36,1) calc(var(--d,0) * calc(0.09s / var(--k))),translate calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq14-red .rd:hover::before {
  translate: 0 -2px;
}

.uvq14-red .rd:active::before {
  translate: 0 1px;
}

.uvq14-red .rd[aria-pressed=true] {
  background: color-mix(in srgb,var(--c1) 16%,transparent);
}

.uvq14-red .rd[aria-pressed=true]::before {
  transform: scaleX(0);
}

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

.uvq14-red footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1em;
}

.uvq14-red .all {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: .45em .8em;
  border: 1.5px solid #222;
  border-radius: .2em;
  font-size: .7em;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),color calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq14-red .all:hover {
  color: #f4f0e6;
  background: #222;
}

.uvq14-red .all:active {
  transform: scale(.95);
}

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

.uvq14-red .sg {
  font-size: .66em;
  font-style: italic;
  color: #777;
}

@media (prefers-reduced-motion:reduce) {
  .uvq14-red,.uvq14-red *,.uvq14-red *::before,.uvq14-red *::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 rs=[...el.querySelectorAll(".rd")],all=el.querySelector(".all");const sync=()=>all.setAttribute("aria-pressed",String(rs.every(r=>r.getAttribute("aria-pressed")==="true")));
rs.forEach(r=>r.addEventListener("click",()=>{r.style.setProperty("--d","0");r.setAttribute("aria-pressed",String(r.getAttribute("aria-pressed")!=="true"));sync()}));
all.addEventListener("click",()=>{const on=all.getAttribute("aria-pressed")!=="true";rs.forEach((r,i)=>{r.style.setProperty("--d",String(i));r.setAttribute("aria-pressed",String(on))});sync()})
}

export default function TxRedacted() {
  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": "#dc2626",
          "--c2": "#16161a",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <article className="uvq14-red"><header><span className="cl">Confidential</span><span>File 27/B</span></header><h3>Field report</h3><p>On the 14th the team reached <button type="button" className="rd" aria-pressed="false">Valdeluz</button> at <button type="button" className="rd" aria-pressed="false">06:40</button>. The contact, known as <button type="button" className="rd" aria-pressed="false">the Librarian</button>, handed over <button type="button" className="rd" aria-pressed="false">three sealed envelopes</button> and drove off in a <button type="button" className="rd" aria-pressed="false">blue Seat 600</button>.</p><footer><button type="button" className="all" aria-pressed="false">Declassify all</button><span className="sg">Signature: illegible</span></footer></article>
      </div>
    </>
  );
}
```

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