# Risograph print button

> Two-ink print with slightly off registration: under the cursor the halftone dots swell until they become solid ink.

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

## Where to use it

Risograph printing, with its fluorescent pink, bright blue and imperfect registration, is a favorite of zines and indie studios. This button imitates it on cream paper: a pink halftone under blue type, a pink copy of the label slightly out of register, and where the pointer goes the dots grow into solid ink thanks to a contrast filter trick. Good for posters, zines and festivals.

The main color is the halftone ink and the secondary color is the type and border, so classic riso pairs like yellow and teal or orange and violet are easy. Moving the pointer also shifts the misregistered copy a little, which feels like a hand-fed print run.

## Code

### HTML

```html
<button class="uvq01-rso" type="button"><span class="ht" aria-hidden="true"></span><span class="t2" aria-hidden="true">Print</span><span class="t">Print</span></button>
```

### CSS

```css
.uvq01-rso {
  --c1: #ff48b0;
  --c2: #0078bf;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

@property --uvq01-rr {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

.uvq01-rso {
  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;
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.005em;
  white-space: nowrap;
  user-select: none;
  display: inline-grid;
  padding: 1.05em 2.3em;
  border-radius: .3em;
  overflow: hidden;
  isolation: isolate;
  font-weight: 900;
  font-size: calc(var(--s) * 1.08);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c2);
  background: radial-gradient(rgba(60,50,30,.09) .6px,transparent 1px) 0 0/4px 4px,#f4efe3;
  box-shadow: inset 0 0 0 .12em var(--c2),0 10px 20px -14px rgba(40,30,10,.5);
  --uvq01-rr: 0px;
  transition: --uvq01-rr calc(0.6s / var(--k)) cubic-bezier(.22,1,.36,1),transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-rso .ht {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c1);
  mix-blend-mode: multiply;
  isolation: isolate;
}

.uvq01-rso .ht::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side,#777,#fff) 0 0/.32em .32em,radial-gradient(circle at var(--mx,50%) var(--my,50%),#000 0,#fff var(--uvq01-rr),#fff);
  background-blend-mode: multiply;
  filter: contrast(16);
  mix-blend-mode: screen;
}

.uvq01-rso .t,.uvq01-rso .t2 {
  grid-area: 1/1;
  mix-blend-mode: multiply;
}

.uvq01-rso .t2 {
  color: var(--c1);
  translate: calc(.07em + var(--ox,0) * .14em) calc(.05em + var(--oy,0) * .1em);
  transition: translate calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-rso:hover,.uvq01-rso:focus-visible {
  --uvq01-rr: 4.2em;
}

.uvq01-rso:active {
  transform: translate(1px,1px);
}

.uvq01-rso:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

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

### JavaScript

```js
document.querySelectorAll(".uvq01-rso").forEach(el => {
  el.addEventListener("pointermove",e=>{const r=el.getBoundingClientRect();const x=(e.clientX-r.left)/r.width,y=(e.clientY-r.top)/r.height;el.style.setProperty("--mx",(x*100).toFixed(1)+"%");el.style.setProperty("--my",(y*100).toFixed(1)+"%");el.style.setProperty("--ox",((x-.5)*2).toFixed(2));el.style.setProperty("--oy",((y-.5)*2).toFixed(2))});
el.addEventListener("pointerleave",()=>{el.style.setProperty("--ox",0);el.style.setProperty("--oy",0)})
});
```

### 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 --uvq01-rr {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

.uvq01-rso {
  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;
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.005em;
  white-space: nowrap;
  user-select: none;
  display: inline-grid;
  padding: 1.05em 2.3em;
  border-radius: .3em;
  overflow: hidden;
  isolation: isolate;
  font-weight: 900;
  font-size: calc(var(--s) * 1.08);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c2);
  background: radial-gradient(rgba(60,50,30,.09) .6px,transparent 1px) 0 0/4px 4px,#f4efe3;
  box-shadow: inset 0 0 0 .12em var(--c2),0 10px 20px -14px rgba(40,30,10,.5);
  --uvq01-rr: 0px;
  transition: --uvq01-rr calc(0.6s / var(--k)) cubic-bezier(.22,1,.36,1),transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-rso .ht {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c1);
  mix-blend-mode: multiply;
  isolation: isolate;
}

.uvq01-rso .ht::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side,#777,#fff) 0 0/.32em .32em,radial-gradient(circle at var(--mx,50%) var(--my,50%),#000 0,#fff var(--uvq01-rr),#fff);
  background-blend-mode: multiply;
  filter: contrast(16);
  mix-blend-mode: screen;
}

.uvq01-rso .t,.uvq01-rso .t2 {
  grid-area: 1/1;
  mix-blend-mode: multiply;
}

.uvq01-rso .t2 {
  color: var(--c1);
  translate: calc(.07em + var(--ox,0) * .14em) calc(.05em + var(--oy,0) * .1em);
  transition: translate calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-rso:hover,.uvq01-rso:focus-visible {
  --uvq01-rr: 4.2em;
}

.uvq01-rso:active {
  transform: translate(1px,1px);
}

.uvq01-rso:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq01-rso,.uvq01-rso *,.uvq01-rso *::before,.uvq01-rso *::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) {
  el.addEventListener("pointermove",e=>{const r=el.getBoundingClientRect();const x=(e.clientX-r.left)/r.width,y=(e.clientY-r.top)/r.height;el.style.setProperty("--mx",(x*100).toFixed(1)+"%");el.style.setProperty("--my",(y*100).toFixed(1)+"%");el.style.setProperty("--ox",((x-.5)*2).toFixed(2));el.style.setProperty("--oy",((y-.5)*2).toFixed(2))});
el.addEventListener("pointerleave",()=>{el.style.setProperty("--ox",0);el.style.setProperty("--oy",0)})
}

export default function BtnRiso() {
  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": "#ff48b0",
          "--c2": "#0078bf",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <button className="uvq01-rso" type="button"><span className="ht" aria-hidden="true"></span><span className="t2" aria-hidden="true">Print</span><span className="t">Print</span></button>
      </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 “Risograph print button” block (Buttons) from AIMRAN Library to my project.

## What it is
Two-ink print with slightly off registration: under the cursor the halftone dots swell until they become solid ink.

## Chosen settings
- Main color: #ff48b0
- Secondary color: #0078bf
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Imprimir"

## 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 --uvq01-rr {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

.uvq01-rso {
  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;
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.005em;
  white-space: nowrap;
  user-select: none;
  display: inline-grid;
  padding: 1.05em 2.3em;
  border-radius: .3em;
  overflow: hidden;
  isolation: isolate;
  font-weight: 900;
  font-size: calc(var(--s) * 1.08);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c2);
  background: radial-gradient(rgba(60,50,30,.09) .6px,transparent 1px) 0 0/4px 4px,#f4efe3;
  box-shadow: inset 0 0 0 .12em var(--c2),0 10px 20px -14px rgba(40,30,10,.5);
  --uvq01-rr: 0px;
  transition: --uvq01-rr calc(0.6s / var(--k)) cubic-bezier(.22,1,.36,1),transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-rso .ht {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--c1);
  mix-blend-mode: multiply;
  isolation: isolate;
}

.uvq01-rso .ht::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(closest-side,#777,#fff) 0 0/.32em .32em,radial-gradient(circle at var(--mx,50%) var(--my,50%),#000 0,#fff var(--uvq01-rr),#fff);
  background-blend-mode: multiply;
  filter: contrast(16);
  mix-blend-mode: screen;
}

.uvq01-rso .t,.uvq01-rso .t2 {
  grid-area: 1/1;
  mix-blend-mode: multiply;
}

.uvq01-rso .t2 {
  color: var(--c1);
  translate: calc(.07em + var(--ox,0) * .14em) calc(.05em + var(--oy,0) * .1em);
  transition: translate calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-rso:hover,.uvq01-rso:focus-visible {
  --uvq01-rr: 4.2em;
}

.uvq01-rso:active {
  transform: translate(1px,1px);
}

.uvq01-rso:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq01-rso,.uvq01-rso *,.uvq01-rso *::before,.uvq01-rso *::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) {
  el.addEventListener("pointermove",e=>{const r=el.getBoundingClientRect();const x=(e.clientX-r.left)/r.width,y=(e.clientY-r.top)/r.height;el.style.setProperty("--mx",(x*100).toFixed(1)+"%");el.style.setProperty("--my",(y*100).toFixed(1)+"%");el.style.setProperty("--ox",((x-.5)*2).toFixed(2));el.style.setProperty("--oy",((y-.5)*2).toFixed(2))});
el.addEventListener("pointerleave",()=>{el.style.setProperty("--ox",0);el.style.setProperty("--oy",0)})
}

export default function BtnRiso() {
  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": "#ff48b0",
          "--c2": "#0078bf",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <button className="uvq01-rso" type="button"><span className="ht" aria-hidden="true"></span><span className="t2" aria-hidden="true">Print</span><span className="t">Print</span></button>
      </div>
    </>
  );
}
```

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