# Ink blot toggle

> On ruled letter paper, a drop of ink spills and soaks the track with ragged edges and a few splatters.

- Category: [Toggles](https://library.aimran.es/components/toggles)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-tg-ink-blot
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

This switch sits on a strip of ruled paper with a red margin line. When it turns on, the drop knob slides across and a pool of ink spreads behind it with rough, bleeding edges and a few small splatters. The edges come from an SVG turbulence filter applied to plain circles. It fits signature steps, journaling apps, stationery shops and writing tools.

The main color is the ink and the second one is the paper. Iron gall black, sepia or a bright fountain pen turquoise all work, and the filter seed in the SVG changes the shape of the blot.

## Code

### HTML

```html
<label class="uvq03-ink"><input type="checkbox" role="switch"><span class="pp"><svg width="0" height="0" aria-hidden="true"><filter id="uvq03-ink-f"><feTurbulence type="fractalNoise" baseFrequency="0.07" numOctaves="2" seed="4"/><feDisplacementMap in="SourceGraphic" scale="10"/></filter></svg><span class="bl"><i class="a"></i><i class="b"></i><i class="c"></i><i class="d"></i></span><span class="kn"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3c3 4 6 7.5 6 11a6 6 0 0 1-12 0c0-3.5 3-7 6-11z"/></svg></span></span>Sign in ink</label>
```

### CSS

```css
.uvq03-ink {
  --c1: #26338f;
  --c2: #f4eedd;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq03-ink {
  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;
  display: inline-flex;
  align-items: center;
  gap: .8em;
  cursor: pointer;
  user-select: none;
  font-weight: 550;
}

.uvq03-ink input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq03-ink .pp {
  position: relative;
  display: block;
  flex: none;
  width: 4.8em;
  height: 2.2em;
  border-radius: .4em;
  overflow: hidden;
  background: linear-gradient(transparent 1.6em,rgba(80,110,170,.28) 1.6em 1.66em,transparent 1.66em),linear-gradient(90deg,transparent .5em,rgba(210,70,70,.3) .5em .55em,transparent .55em),var(--c2);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08),0 .45em .8em -.45em rgba(0,0,0,.45);
}

.uvq03-ink .pp > svg {
  position: absolute;
}

.uvq03-ink .bl {
  position: absolute;
  inset: 0;
  filter: url(#uvq03-ink-f);
}

.uvq03-ink .bl i {
  position: absolute;
  border-radius: 50%;
  background: var(--c1);
  opacity: 0;
  transform: scale(0);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1),opacity calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq03-ink .a {
  right: -.9em;
  top: -1.2em;
  width: 4.6em;
  height: 4.6em;
  transform-origin: 62% 50%;
}

.uvq03-ink .b {
  left: .55em;
  top: .35em;
  width: .45em;
  height: .45em;
}

.uvq03-ink .c {
  left: .95em;
  top: 1.45em;
  width: .32em;
  height: .32em;
}

.uvq03-ink .d {
  left: .2em;
  top: 1.2em;
  width: .2em;
  height: .2em;
}

.uvq03-ink .kn {
  position: absolute;
  left: .25em;
  top: .25em;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  color: var(--c1);
  background: #fffdf6;
  box-shadow: 0 .12em .3em rgba(0,0,0,.28);
  transition: left calc(0.5s / var(--k)) cubic-bezier(.22,1,.36,1),transform calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq03-ink .kn svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  transition: transform calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq03-ink:hover .kn svg {
  transform: translateY(-.08em);
}

.uvq03-ink:active .kn {
  transform: scale(.92);
}

.uvq03-ink input:checked + .pp .bl i {
  opacity: 1;
  transform: scale(1);
  transition: transform calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1) calc(0.45s / var(--k)),opacity calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.45s / var(--k));
}

.uvq03-ink input:checked + .pp .a {
  transition: transform calc(1s / var(--k)) cubic-bezier(.2,.9,.3,1) calc(0.15s / var(--k)),opacity calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.15s / var(--k));
}

.uvq03-ink input:checked + .pp .kn {
  left: calc(100% - 1.95em);
}

.uvq03-ink input:checked + .pp .kn svg {
  transform: scale(.8) translateY(.12em);
}

.uvq03-ink input:focus-visible + .pp {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

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

### React

```tsx
import type { CSSProperties } from "react";

const css = `
.uvq03-ink {
  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;
  display: inline-flex;
  align-items: center;
  gap: .8em;
  cursor: pointer;
  user-select: none;
  font-weight: 550;
}

.uvq03-ink input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq03-ink .pp {
  position: relative;
  display: block;
  flex: none;
  width: 4.8em;
  height: 2.2em;
  border-radius: .4em;
  overflow: hidden;
  background: linear-gradient(transparent 1.6em,rgba(80,110,170,.28) 1.6em 1.66em,transparent 1.66em),linear-gradient(90deg,transparent .5em,rgba(210,70,70,.3) .5em .55em,transparent .55em),var(--c2);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08),0 .45em .8em -.45em rgba(0,0,0,.45);
}

.uvq03-ink .pp > svg {
  position: absolute;
}

.uvq03-ink .bl {
  position: absolute;
  inset: 0;
  filter: url(#uvq03-ink-f);
}

.uvq03-ink .bl i {
  position: absolute;
  border-radius: 50%;
  background: var(--c1);
  opacity: 0;
  transform: scale(0);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1),opacity calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq03-ink .a {
  right: -.9em;
  top: -1.2em;
  width: 4.6em;
  height: 4.6em;
  transform-origin: 62% 50%;
}

.uvq03-ink .b {
  left: .55em;
  top: .35em;
  width: .45em;
  height: .45em;
}

.uvq03-ink .c {
  left: .95em;
  top: 1.45em;
  width: .32em;
  height: .32em;
}

.uvq03-ink .d {
  left: .2em;
  top: 1.2em;
  width: .2em;
  height: .2em;
}

.uvq03-ink .kn {
  position: absolute;
  left: .25em;
  top: .25em;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  color: var(--c1);
  background: #fffdf6;
  box-shadow: 0 .12em .3em rgba(0,0,0,.28);
  transition: left calc(0.5s / var(--k)) cubic-bezier(.22,1,.36,1),transform calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq03-ink .kn svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  transition: transform calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq03-ink:hover .kn svg {
  transform: translateY(-.08em);
}

.uvq03-ink:active .kn {
  transform: scale(.92);
}

.uvq03-ink input:checked + .pp .bl i {
  opacity: 1;
  transform: scale(1);
  transition: transform calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1) calc(0.45s / var(--k)),opacity calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.45s / var(--k));
}

.uvq03-ink input:checked + .pp .a {
  transition: transform calc(1s / var(--k)) cubic-bezier(.2,.9,.3,1) calc(0.15s / var(--k)),opacity calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.15s / var(--k));
}

.uvq03-ink input:checked + .pp .kn {
  left: calc(100% - 1.95em);
}

.uvq03-ink input:checked + .pp .kn svg {
  transform: scale(.8) translateY(.12em);
}

.uvq03-ink input:focus-visible + .pp {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

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

export default function TgInkBlot() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#26338f",
          "--c2": "#f4eedd",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq03-ink"><input type="checkbox" role="switch" /><span className="pp"><svg width="0" height="0" aria-hidden="true"><filter id="uvq03-ink-f"><feTurbulence type="fractalNoise" baseFrequency="0.07" numOctaves="2" seed="4" /><feDisplacementMap in="SourceGraphic" scale="10" /></filter></svg><span className="bl"><i className="a"></i><i className="b"></i><i className="c"></i><i className="d"></i></span><span className="kn"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3c3 4 6 7.5 6 11a6 6 0 0 1-12 0c0-3.5 3-7 6-11z" /></svg></span></span>Sign in ink</label>
      </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 “Ink blot toggle” block (Toggles) from AIMRAN Library to my project.

## What it is
On ruled letter paper, a drop of ink spills and soaks the track with ragged edges and a few splatters.

## Chosen settings
- Main color: #26338f
- Secondary color: #f4eedd
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Firmar con tinta"

## 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
import type { CSSProperties } from "react";

const css = `
.uvq03-ink {
  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;
  display: inline-flex;
  align-items: center;
  gap: .8em;
  cursor: pointer;
  user-select: none;
  font-weight: 550;
}

.uvq03-ink input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq03-ink .pp {
  position: relative;
  display: block;
  flex: none;
  width: 4.8em;
  height: 2.2em;
  border-radius: .4em;
  overflow: hidden;
  background: linear-gradient(transparent 1.6em,rgba(80,110,170,.28) 1.6em 1.66em,transparent 1.66em),linear-gradient(90deg,transparent .5em,rgba(210,70,70,.3) .5em .55em,transparent .55em),var(--c2);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08),0 .45em .8em -.45em rgba(0,0,0,.45);
}

.uvq03-ink .pp > svg {
  position: absolute;
}

.uvq03-ink .bl {
  position: absolute;
  inset: 0;
  filter: url(#uvq03-ink-f);
}

.uvq03-ink .bl i {
  position: absolute;
  border-radius: 50%;
  background: var(--c1);
  opacity: 0;
  transform: scale(0);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1),opacity calc(0.35s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq03-ink .a {
  right: -.9em;
  top: -1.2em;
  width: 4.6em;
  height: 4.6em;
  transform-origin: 62% 50%;
}

.uvq03-ink .b {
  left: .55em;
  top: .35em;
  width: .45em;
  height: .45em;
}

.uvq03-ink .c {
  left: .95em;
  top: 1.45em;
  width: .32em;
  height: .32em;
}

.uvq03-ink .d {
  left: .2em;
  top: 1.2em;
  width: .2em;
  height: .2em;
}

.uvq03-ink .kn {
  position: absolute;
  left: .25em;
  top: .25em;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  color: var(--c1);
  background: #fffdf6;
  box-shadow: 0 .12em .3em rgba(0,0,0,.28);
  transition: left calc(0.5s / var(--k)) cubic-bezier(.22,1,.36,1),transform calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq03-ink .kn svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
  transition: transform calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq03-ink:hover .kn svg {
  transform: translateY(-.08em);
}

.uvq03-ink:active .kn {
  transform: scale(.92);
}

.uvq03-ink input:checked + .pp .bl i {
  opacity: 1;
  transform: scale(1);
  transition: transform calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1) calc(0.45s / var(--k)),opacity calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.45s / var(--k));
}

.uvq03-ink input:checked + .pp .a {
  transition: transform calc(1s / var(--k)) cubic-bezier(.2,.9,.3,1) calc(0.15s / var(--k)),opacity calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.15s / var(--k));
}

.uvq03-ink input:checked + .pp .kn {
  left: calc(100% - 1.95em);
}

.uvq03-ink input:checked + .pp .kn svg {
  transform: scale(.8) translateY(.12em);
}

.uvq03-ink input:focus-visible + .pp {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

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

export default function TgInkBlot() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#26338f",
          "--c2": "#f4eedd",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq03-ink"><input type="checkbox" role="switch" /><span className="pp"><svg width="0" height="0" aria-hidden="true"><filter id="uvq03-ink-f"><feTurbulence type="fractalNoise" baseFrequency="0.07" numOctaves="2" seed="4" /><feDisplacementMap in="SourceGraphic" scale="10" /></filter></svg><span className="bl"><i className="a"></i><i className="b"></i><i className="c"></i><i className="d"></i></span><span className="kn"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3c3 4 6 7.5 6 11a6 6 0 0 1-12 0c0-3.5 3-7 6-11z" /></svg></span></span>Sign in ink</label>
      </div>
    </>
  );
}
```

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