# Letterpress business card

> A cotton business card with debossed inked letters: a raking light follows the cursor and shifts the shadows of the relief.

- Category: [Cards](https://library.aimran.es/components/cards)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-card-letterpress
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Letterpress is printing you can feel, with letters pressed into thick cotton stock. This card fakes the relief with paired text shadows driven by two registered custom properties, so the highlight and shadow sides move with the light. When idle the light circles slowly; on hover it follows the pointer. A blind monogram and a copy email button complete it.

The main color is the ink, the second the paper. Change name, role and contact lines, and keep the uppercase serif heading short so the deboss stays crisp.

## Code

### HTML

```html
<article class="uvq07-lp"><span class="mg" aria-hidden="true">AR</span><div class="tx"><h3>Alba Rivas</h3><p class="rl">Bookbinding and typography</p></div><ul><li><button type="button" class="em" data-ok="Copied">alba@rivas.studio</button><span class="ok" aria-live="polite"></span></li><li>+34 622 418 905</li><li>Libreros 7, Salamanca</li></ul></article>
```

### CSS

```css
.uvq07-lp {
  --c1: #1f3a5f;
  --c2: #f2ede2;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

@property --uvq07-lx {
  syntax: "<number>";
  inherits: true;
  initial-value: -.6;
}

@property --uvq07-ly {
  syntax: "<number>";
  inherits: true;
  initial-value: -.8;
}

.uvq07-lp {
  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: 18em;
  height: 10.6em;
  box-sizing: border-box;
  padding: 1.3em 1.4em;
  overflow: hidden;
  border-radius: .35em;
  color: var(--c1);
  background: radial-gradient(rgba(120,100,70,.1) .5px,transparent 1px) 0 0/3px 3px,radial-gradient(rgba(255,255,255,.5) .5px,transparent 1px) 1px 2px/5px 5px,var(--c2);
  box-shadow: 0 .15em .3em rgba(0,0,0,.12),0 1.4em 2.4em -1.3em rgba(0,0,0,.5);
  animation: uvq07-lp calc(9s / var(--k)) linear infinite;
}

.uvq07-lp.is-p {
  animation: none;
}

.uvq07-lp::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(70% 90% at calc(50% + var(--uvq07-lx) * 45%) calc(50% + var(--uvq07-ly) * 45%),rgba(255,255,255,.5),transparent 65%);
}

.uvq07-lp .mg {
  position: absolute;
  right: .2em;
  bottom: -.18em;
  font: 700 6.2em/1 "Didot","Bodoni 72","Bodoni MT","Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  letter-spacing: -.06em;
  color: color-mix(in srgb,var(--c2) 95%,#000);
  text-shadow: calc(var(--uvq07-lx) * .02em) calc(var(--uvq07-ly) * .02em) 0 rgba(0,0,0,.2),calc(var(--uvq07-lx) * -.02em) calc(var(--uvq07-ly) * -.02em) 0 rgba(255,255,255,.95);
}

.uvq07-lp .tx,.uvq07-lp ul {
  position: relative;
}

.uvq07-lp h3 {
  margin: 0;
  font: 600 1.1em/1.15 "Didot","Bodoni 72","Bodoni MT","Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: calc(var(--uvq07-lx) * .05em) calc(var(--uvq07-ly) * .05em) 0 rgba(0,0,0,.22),calc(var(--uvq07-lx) * -.05em) calc(var(--uvq07-ly) * -.05em) .02em rgba(255,255,255,.9);
}

.uvq07-lp .rl {
  margin: .4em 0 0;
  font: italic .74em "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  opacity: .85;
}

.uvq07-lp ul {
  list-style: none;
  margin: 1.5em 0 0;
  padding: 0;
  display: grid;
  gap: .3em;
  font-size: .68em;
  letter-spacing: .04em;
  text-shadow: calc(var(--uvq07-lx) * .06em) calc(var(--uvq07-ly) * .06em) 0 rgba(0,0,0,.18),calc(var(--uvq07-lx) * -.06em) calc(var(--uvq07-ly) * -.06em) 0 rgba(255,255,255,.9);
}

.uvq07-lp li {
  display: flex;
  align-items: center;
}

.uvq07-lp .em {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
  letter-spacing: inherit;
  text-shadow: inherit;
  border-radius: .2em;
}

.uvq07-lp .em:hover {
  text-decoration-thickness: 2px;
}

.uvq07-lp .em:active {
  opacity: .7;
}

.uvq07-lp .em:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq07-lp .ok {
  margin-left: .6em;
  padding: .15em .45em;
  border-radius: .3em;
  font-size: .9em;
  font-weight: 700;
  text-shadow: none;
  color: var(--c2);
  background: var(--c1);
  opacity: 0;
  transition: opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-lp .ok.on {
  opacity: 1;
}

@keyframes uvq07-lp {
  0%,100% {
    --uvq07-lx: -.9;
    --uvq07-ly: -.6;
  }
  25% {
    --uvq07-lx: 0;
    --uvq07-ly: -1;
  }
  50% {
    --uvq07-lx: .9;
    --uvq07-ly: -.5;
  }
  75% {
    --uvq07-lx: .2;
    --uvq07-ly: .7;
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq07-lp").forEach(el => {
  const b=el.querySelector(".em"),ok=el.querySelector(".ok");let t=0;
el.addEventListener("pointermove",e=>{const r=el.getBoundingClientRect();el.classList.add("is-p");el.style.setProperty("--uvq07-lx",(((e.clientX-r.left)/r.width-.5)*2).toFixed(2));el.style.setProperty("--uvq07-ly",(((e.clientY-r.top)/r.height-.5)*2).toFixed(2))});
el.addEventListener("pointerleave",()=>{el.classList.remove("is-p");el.style.removeProperty("--uvq07-lx");el.style.removeProperty("--uvq07-ly")});
b.addEventListener("click",()=>{if(navigator.clipboard)navigator.clipboard.writeText(b.textContent.trim()).catch(()=>{});ok.textContent=b.dataset.ok;ok.classList.add("on");clearTimeout(t);t=setTimeout(()=>ok.classList.remove("on"),1600)});
return()=>clearTimeout(t)
});
```

### 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 --uvq07-lx {
  syntax: "<number>";
  inherits: true;
  initial-value: -.6;
}

@property --uvq07-ly {
  syntax: "<number>";
  inherits: true;
  initial-value: -.8;
}

.uvq07-lp {
  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: 18em;
  height: 10.6em;
  box-sizing: border-box;
  padding: 1.3em 1.4em;
  overflow: hidden;
  border-radius: .35em;
  color: var(--c1);
  background: radial-gradient(rgba(120,100,70,.1) .5px,transparent 1px) 0 0/3px 3px,radial-gradient(rgba(255,255,255,.5) .5px,transparent 1px) 1px 2px/5px 5px,var(--c2);
  box-shadow: 0 .15em .3em rgba(0,0,0,.12),0 1.4em 2.4em -1.3em rgba(0,0,0,.5);
  animation: uvq07-lp calc(9s / var(--k)) linear infinite;
}

.uvq07-lp.is-p {
  animation: none;
}

.uvq07-lp::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(70% 90% at calc(50% + var(--uvq07-lx) * 45%) calc(50% + var(--uvq07-ly) * 45%),rgba(255,255,255,.5),transparent 65%);
}

.uvq07-lp .mg {
  position: absolute;
  right: .2em;
  bottom: -.18em;
  font: 700 6.2em/1 "Didot","Bodoni 72","Bodoni MT","Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  letter-spacing: -.06em;
  color: color-mix(in srgb,var(--c2) 95%,#000);
  text-shadow: calc(var(--uvq07-lx) * .02em) calc(var(--uvq07-ly) * .02em) 0 rgba(0,0,0,.2),calc(var(--uvq07-lx) * -.02em) calc(var(--uvq07-ly) * -.02em) 0 rgba(255,255,255,.95);
}

.uvq07-lp .tx,.uvq07-lp ul {
  position: relative;
}

.uvq07-lp h3 {
  margin: 0;
  font: 600 1.1em/1.15 "Didot","Bodoni 72","Bodoni MT","Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: calc(var(--uvq07-lx) * .05em) calc(var(--uvq07-ly) * .05em) 0 rgba(0,0,0,.22),calc(var(--uvq07-lx) * -.05em) calc(var(--uvq07-ly) * -.05em) .02em rgba(255,255,255,.9);
}

.uvq07-lp .rl {
  margin: .4em 0 0;
  font: italic .74em "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  opacity: .85;
}

.uvq07-lp ul {
  list-style: none;
  margin: 1.5em 0 0;
  padding: 0;
  display: grid;
  gap: .3em;
  font-size: .68em;
  letter-spacing: .04em;
  text-shadow: calc(var(--uvq07-lx) * .06em) calc(var(--uvq07-ly) * .06em) 0 rgba(0,0,0,.18),calc(var(--uvq07-lx) * -.06em) calc(var(--uvq07-ly) * -.06em) 0 rgba(255,255,255,.9);
}

.uvq07-lp li {
  display: flex;
  align-items: center;
}

.uvq07-lp .em {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
  letter-spacing: inherit;
  text-shadow: inherit;
  border-radius: .2em;
}

.uvq07-lp .em:hover {
  text-decoration-thickness: 2px;
}

.uvq07-lp .em:active {
  opacity: .7;
}

.uvq07-lp .em:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq07-lp .ok {
  margin-left: .6em;
  padding: .15em .45em;
  border-radius: .3em;
  font-size: .9em;
  font-weight: 700;
  text-shadow: none;
  color: var(--c2);
  background: var(--c1);
  opacity: 0;
  transition: opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-lp .ok.on {
  opacity: 1;
}

@keyframes uvq07-lp {
  0%,100% {
    --uvq07-lx: -.9;
    --uvq07-ly: -.6;
  }
  25% {
    --uvq07-lx: 0;
    --uvq07-ly: -1;
  }
  50% {
    --uvq07-lx: .9;
    --uvq07-ly: -.5;
  }
  75% {
    --uvq07-lx: .2;
    --uvq07-ly: .7;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq07-lp,.uvq07-lp *,.uvq07-lp *::before,.uvq07-lp *::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 b=el.querySelector(".em"),ok=el.querySelector(".ok");let t=0;
el.addEventListener("pointermove",e=>{const r=el.getBoundingClientRect();el.classList.add("is-p");el.style.setProperty("--uvq07-lx",(((e.clientX-r.left)/r.width-.5)*2).toFixed(2));el.style.setProperty("--uvq07-ly",(((e.clientY-r.top)/r.height-.5)*2).toFixed(2))});
el.addEventListener("pointerleave",()=>{el.classList.remove("is-p");el.style.removeProperty("--uvq07-lx");el.style.removeProperty("--uvq07-ly")});
b.addEventListener("click",()=>{if(navigator.clipboard)navigator.clipboard.writeText(b.textContent.trim()).catch(()=>{});ok.textContent=b.dataset.ok;ok.classList.add("on");clearTimeout(t);t=setTimeout(()=>ok.classList.remove("on"),1600)});
return()=>clearTimeout(t)
}

export default function CardLetterpress() {
  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": "#1f3a5f",
          "--c2": "#f2ede2",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <article className="uvq07-lp"><span className="mg" aria-hidden="true">AR</span><div className="tx"><h3>Alba Rivas</h3><p className="rl">Bookbinding and typography</p></div><ul><li><button type="button" className="em" data-ok="Copied">alba@rivas.studio</button><span className="ok" aria-live="polite"></span></li><li>+34 622 418 905</li><li>Libreros 7, Salamanca</li></ul></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 “Letterpress business card” block (Cards) from AIMRAN Library to my project.

## What it is
A cotton business card with debossed inked letters: a raking light follows the cursor and shifts the shadows of the relief.

## Chosen settings
- Main color: #1f3a5f
- Secondary color: #f2ede2
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Alba Rivas"

## 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 --uvq07-lx {
  syntax: "<number>";
  inherits: true;
  initial-value: -.6;
}

@property --uvq07-ly {
  syntax: "<number>";
  inherits: true;
  initial-value: -.8;
}

.uvq07-lp {
  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: 18em;
  height: 10.6em;
  box-sizing: border-box;
  padding: 1.3em 1.4em;
  overflow: hidden;
  border-radius: .35em;
  color: var(--c1);
  background: radial-gradient(rgba(120,100,70,.1) .5px,transparent 1px) 0 0/3px 3px,radial-gradient(rgba(255,255,255,.5) .5px,transparent 1px) 1px 2px/5px 5px,var(--c2);
  box-shadow: 0 .15em .3em rgba(0,0,0,.12),0 1.4em 2.4em -1.3em rgba(0,0,0,.5);
  animation: uvq07-lp calc(9s / var(--k)) linear infinite;
}

.uvq07-lp.is-p {
  animation: none;
}

.uvq07-lp::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(70% 90% at calc(50% + var(--uvq07-lx) * 45%) calc(50% + var(--uvq07-ly) * 45%),rgba(255,255,255,.5),transparent 65%);
}

.uvq07-lp .mg {
  position: absolute;
  right: .2em;
  bottom: -.18em;
  font: 700 6.2em/1 "Didot","Bodoni 72","Bodoni MT","Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  letter-spacing: -.06em;
  color: color-mix(in srgb,var(--c2) 95%,#000);
  text-shadow: calc(var(--uvq07-lx) * .02em) calc(var(--uvq07-ly) * .02em) 0 rgba(0,0,0,.2),calc(var(--uvq07-lx) * -.02em) calc(var(--uvq07-ly) * -.02em) 0 rgba(255,255,255,.95);
}

.uvq07-lp .tx,.uvq07-lp ul {
  position: relative;
}

.uvq07-lp h3 {
  margin: 0;
  font: 600 1.1em/1.15 "Didot","Bodoni 72","Bodoni MT","Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: calc(var(--uvq07-lx) * .05em) calc(var(--uvq07-ly) * .05em) 0 rgba(0,0,0,.22),calc(var(--uvq07-lx) * -.05em) calc(var(--uvq07-ly) * -.05em) .02em rgba(255,255,255,.9);
}

.uvq07-lp .rl {
  margin: .4em 0 0;
  font: italic .74em "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  opacity: .85;
}

.uvq07-lp ul {
  list-style: none;
  margin: 1.5em 0 0;
  padding: 0;
  display: grid;
  gap: .3em;
  font-size: .68em;
  letter-spacing: .04em;
  text-shadow: calc(var(--uvq07-lx) * .06em) calc(var(--uvq07-ly) * .06em) 0 rgba(0,0,0,.18),calc(var(--uvq07-lx) * -.06em) calc(var(--uvq07-ly) * -.06em) 0 rgba(255,255,255,.9);
}

.uvq07-lp li {
  display: flex;
  align-items: center;
}

.uvq07-lp .em {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
  letter-spacing: inherit;
  text-shadow: inherit;
  border-radius: .2em;
}

.uvq07-lp .em:hover {
  text-decoration-thickness: 2px;
}

.uvq07-lp .em:active {
  opacity: .7;
}

.uvq07-lp .em:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq07-lp .ok {
  margin-left: .6em;
  padding: .15em .45em;
  border-radius: .3em;
  font-size: .9em;
  font-weight: 700;
  text-shadow: none;
  color: var(--c2);
  background: var(--c1);
  opacity: 0;
  transition: opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-lp .ok.on {
  opacity: 1;
}

@keyframes uvq07-lp {
  0%,100% {
    --uvq07-lx: -.9;
    --uvq07-ly: -.6;
  }
  25% {
    --uvq07-lx: 0;
    --uvq07-ly: -1;
  }
  50% {
    --uvq07-lx: .9;
    --uvq07-ly: -.5;
  }
  75% {
    --uvq07-lx: .2;
    --uvq07-ly: .7;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq07-lp,.uvq07-lp *,.uvq07-lp *::before,.uvq07-lp *::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 b=el.querySelector(".em"),ok=el.querySelector(".ok");let t=0;
el.addEventListener("pointermove",e=>{const r=el.getBoundingClientRect();el.classList.add("is-p");el.style.setProperty("--uvq07-lx",(((e.clientX-r.left)/r.width-.5)*2).toFixed(2));el.style.setProperty("--uvq07-ly",(((e.clientY-r.top)/r.height-.5)*2).toFixed(2))});
el.addEventListener("pointerleave",()=>{el.classList.remove("is-p");el.style.removeProperty("--uvq07-lx");el.style.removeProperty("--uvq07-ly")});
b.addEventListener("click",()=>{if(navigator.clipboard)navigator.clipboard.writeText(b.textContent.trim()).catch(()=>{});ok.textContent=b.dataset.ok;ok.classList.add("on");clearTimeout(t);t=setTimeout(()=>ok.classList.remove("on"),1600)});
return()=>clearTimeout(t)
}

export default function CardLetterpress() {
  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": "#1f3a5f",
          "--c2": "#f2ede2",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <article className="uvq07-lp"><span className="mg" aria-hidden="true">AR</span><div className="tx"><h3>Alba Rivas</h3><p className="rl">Bookbinding and typography</p></div><ul><li><button type="button" className="em" data-ok="Copied">alba@rivas.studio</button><span className="ok" aria-live="polite"></span></li><li>+34 622 418 905</li><li>Libreros 7, Salamanca</li></ul></article>
      </div>
    </>
  );
}
```

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