# Synth patch card with knobs

> A synth preset card with three knobs you turn by dragging or with the arrow keys, redrawing the waveform as you go.

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

## Where to use it

Inspired by small aluminium synths, this patch card pairs a brushed panel, an OLED-style screen and rubber preset pads. The knobs are accessible sliders drawn with a conic gradient, and moving them reshapes the wave on screen: shape pushes a sine towards a square, brightness adds harmonics, level sets the height. Great for music tools, audio plugins and creative portfolios.

The main color lights the wave, the knob arcs and the preset LEDs, the second color is the panel. Store your own presets in the script as three values each.

## Code

### HTML

```html
<article class="uvq07-syn"><header><span class="id">P07</span><h3>Glass bass</h3><span class="bpm">120 BPM</span></header><div class="sc" aria-hidden="true"><svg viewBox="0 0 100 40" preserveAspectRatio="none"><line class="ax" x1="0" x2="100" y1="20" y2="20"/><polyline class="wv" points="0.0,20.00 0.8,14.90 1.7,10.84 2.5,8.27 3.3,7.14 4.2,7.15 5.0,7.93 5.8,9.13 6.7,10.40 7.5,11.44 8.3,12.11 9.2,12.37 10.0,12.30 10.8,12.05 11.7,11.81 12.5,11.72 13.3,11.81 14.2,12.05 15.0,12.30 15.8,12.37 16.7,12.11 17.5,11.44 18.3,10.40 19.2,9.13 20.0,7.93 20.8,7.15 21.7,7.14 22.5,8.27 23.3,10.84 24.2,14.90 25.0,20.00 25.8,25.10 26.7,29.16 27.5,31.73 28.3,32.86 29.2,32.85 30.0,32.07 30.8,30.87 31.7,29.60 32.5,28.56 33.3,27.89 34.2,27.63 35.0,27.70 35.8,27.95 36.7,28.19 37.5,28.28 38.3,28.19 39.2,27.95 40.0,27.70 40.8,27.63 41.7,27.89 42.5,28.56 43.3,29.60 44.2,30.87 45.0,32.07 45.8,32.85 46.7,32.86 47.5,31.73 48.3,29.16 49.2,25.10 50.0,20.00 50.8,14.90 51.7,10.84 52.5,8.27 53.3,7.14 54.2,7.15 55.0,7.93 55.8,9.13 56.7,10.40 57.5,11.44 58.3,12.11 59.2,12.37 60.0,12.30 60.8,12.05 61.7,11.81 62.5,11.72 63.3,11.81 64.2,12.05 65.0,12.30 65.8,12.37 66.7,12.11 67.5,11.44 68.3,10.40 69.2,9.13 70.0,7.93 70.8,7.15 71.7,7.14 72.5,8.27 73.3,10.84 74.2,14.90 75.0,20.00 75.8,25.10 76.7,29.16 77.5,31.73 78.3,32.86 79.2,32.85 80.0,32.07 80.8,30.87 81.7,29.60 82.5,28.56 83.3,27.89 84.2,27.63 85.0,27.70 85.8,27.95 86.7,28.19 87.5,28.28 88.3,28.19 89.2,27.95 90.0,27.70 90.8,27.63 91.7,27.89 92.5,28.56 93.3,29.60 94.2,30.87 95.0,32.07 95.8,32.85 96.7,32.86 97.5,31.73 98.3,29.16 99.2,25.10 100.0,20.00"/></svg></div><div class="kn"><div class="kw"><div class="k" role="slider" tabindex="0" aria-label="Shape" aria-valuemin="0" aria-valuemax="100" aria-valuenow="20" style="--v:20"><i></i></div><span class="lb">Shape</span><b>20</b></div><div class="kw"><div class="k" role="slider" tabindex="0" aria-label="Brightness" aria-valuemin="0" aria-valuemax="100" aria-valuenow="60" style="--v:60"><i></i></div><span class="lb">Brightness</span><b>60</b></div><div class="kw"><div class="k" role="slider" tabindex="0" aria-label="Level" aria-valuemin="0" aria-valuemax="100" aria-valuenow="80" style="--v:80"><i></i></div><span class="lb">Level</span><b>80</b></div></div><div class="pd" role="radiogroup" aria-label="Presets"><button type="button" role="radio" aria-checked="true">A</button><button type="button" role="radio" aria-checked="false" tabindex="-1">B</button><button type="button" role="radio" aria-checked="false" tabindex="-1">C</button><button type="button" role="radio" aria-checked="false" tabindex="-1">D</button></div></article>
```

### CSS

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

.uvq07-syn {
  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;
  width: 17em;
  padding: 1.1em;
  border-radius: 1em;
  color: #1b1b1b;
  background: repeating-linear-gradient(90deg,rgba(255,255,255,.18) 0 1px,transparent 1px 3px),linear-gradient(180deg,color-mix(in srgb,var(--c2) 70%,#fff),var(--c2));
  box-shadow: 0 1.2em 2.2em -1.2em rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.7),inset 0 -2px 0 rgba(0,0,0,.08);
}

.uvq07-syn header {
  display: flex;
  align-items: center;
  gap: .5em;
}

.uvq07-syn .id {
  padding: .2em .45em;
  border-radius: .25em;
  font: 700 .66em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: #fff;
  background: #1b1b1b;
}

.uvq07-syn h3 {
  flex: 1;
  margin: 0;
  font-size: .95em;
  font-weight: 800;
  letter-spacing: -.01em;
}

.uvq07-syn .bpm {
  font: 600 .66em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  opacity: .6;
}

.uvq07-syn .sc {
  height: 4.6em;
  margin: .8em 0 1em;
  padding: .45em;
  border-radius: .45em;
  background: #0d0f0e;
  box-shadow: inset 0 .15em .4em rgba(0,0,0,.8),0 1px 0 rgba(255,255,255,.6);
}

.uvq07-syn .sc svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.uvq07-syn .wv {
  fill: none;
  stroke: var(--c1);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 2px var(--c1));
}

.uvq07-syn .ax {
  stroke: rgba(255,255,255,.14);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 2 3;
}

.uvq07-syn .kn {
  display: flex;
  justify-content: space-around;
}

.uvq07-syn .kw {
  display: grid;
  justify-items: center;
  gap: .3em;
}

.uvq07-syn .k {
  position: relative;
  width: 3.4em;
  height: 3.4em;
  border-radius: 50%;
  cursor: ns-resize;
  touch-action: none;
  outline: 0;
  background: conic-gradient(from -135deg,var(--c1) calc(var(--v) * 2.7deg),rgba(0,0,0,.15) 0 270deg,transparent 0);
}

.uvq07-syn .k::before {
  content: "";
  position: absolute;
  inset: .32em;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%,#4a4a4c,#151516 70%);
  box-shadow: 0 .25em .4em rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.2);
}

.uvq07-syn .k i {
  position: absolute;
  inset: .32em;
  border-radius: 50%;
  transform: rotate(calc(var(--v) * 2.7deg - 135deg));
}

.uvq07-syn .k i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: .28em;
  width: .18em;
  height: .8em;
  margin-left: -.09em;
  border-radius: 1em;
  background: #fff;
}

.uvq07-syn .k:active i::after {
  background: var(--c1);
}

.uvq07-syn .k:focus-visible {
  outline: 2px solid #1b1b1b;
  outline-offset: 3px;
}

.uvq07-syn .lb {
  font-size: .62em;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.uvq07-syn .kw b {
  font: 700 .62em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  opacity: .6;
  font-variant-numeric: tabular-nums;
}

.uvq07-syn .pd {
  display: flex;
  gap: .45em;
  margin-top: 1em;
}

.uvq07-syn .pd button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex: 1;
  padding: .5em 0 .4em;
  border-radius: .35em;
  font: 700 .72em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: #e9e9e9;
  background: linear-gradient(180deg,#3a3a3c,#232325);
  box-shadow: 0 .22em 0 #0e0e0f,inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-syn .pd button::before {
  content: "";
  display: block;
  width: .55em;
  height: .55em;
  margin: 0 auto .35em;
  border-radius: 50%;
  background: #555;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-syn .pd button[aria-checked="true"]::before {
  background: var(--c1);
  box-shadow: 0 0 .5em var(--c1);
}

.uvq07-syn .pd button:active {
  transform: translateY(.17em);
  box-shadow: 0 .05em 0 #0e0e0f;
}

.uvq07-syn .pd button:focus-visible {
  outline: 2px solid #1b1b1b;
  outline-offset: 2px;
}

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

### JavaScript

```js
document.querySelectorAll(".uvq07-syn").forEach(el => {
  const ks=[...el.querySelectorAll(".k")],wv=el.querySelector(".wv"),pads=[...el.querySelectorAll(".pd button")],P=[[20,60,80],[90,25,70],[50,90,55],[5,10,95]];let raf=0;
const val=k=>+k.getAttribute("aria-valuenow");
const draw=()=>{const [f,b,l]=ks.map(val),d=1+f/100*12,h=b/100*.8,a=17*l/100,pts=[];for(let i=0;i<=120;i++){const x=i/120,ph=x*Math.PI*4,s=Math.sin(ph);let y=Math.tanh(d*s)/Math.tanh(d)+h*(Math.sin(ph*3)/1.5+Math.sin(ph*5)/2.5);y/=1+h*.9;pts.push((x*100).toFixed(1)+","+(20-y*a).toFixed(2))}wv.setAttribute("points",pts.join(" "))};
const set=(k,v)=>{v=Math.max(0,Math.min(100,Math.round(v)));k.setAttribute("aria-valuenow",String(v));k.style.setProperty("--v",String(v));k.parentElement.querySelector("b").textContent=String(v);draw()};
ks.forEach(k=>{let y0=0,v0=0,on=false;
k.addEventListener("pointerdown",e=>{on=true;y0=e.clientY;v0=val(k);k.setPointerCapture(e.pointerId)});
k.addEventListener("pointermove",e=>{if(!on)return;const sc=k.getBoundingClientRect().height/k.offsetHeight||1;set(k,v0+(y0-e.clientY)/sc*1.1)});
k.addEventListener("pointerup",()=>{on=false});
k.addEventListener("keydown",e=>{const m={ArrowUp:5,ArrowRight:5,ArrowDown:-5,ArrowLeft:-5,PageUp:20,PageDown:-20}[e.key];if(m){e.preventDefault();set(k,val(k)+m)}if(e.key==="Home"){e.preventDefault();set(k,0)}if(e.key==="End"){e.preventDefault();set(k,100)}})});
const pick=i=>{pads.forEach((p,j)=>{p.setAttribute("aria-checked",String(i===j));p.tabIndex=i===j?0:-1});const from=ks.map(val),to=P[i],t0=performance.now();cancelAnimationFrame(raf);
const f=now=>{const p=Math.min(1,(now-t0)/260),e=1-Math.pow(1-p,3);ks.forEach((k,j)=>set(k,from[j]+(to[j]-from[j])*e));if(p<1)raf=requestAnimationFrame(f)};raf=requestAnimationFrame(f)};
pads.forEach((p,i)=>{p.addEventListener("click",()=>pick(i));p.addEventListener("keydown",e=>{const d=e.key==="ArrowRight"||e.key==="ArrowDown"?1:e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:0;if(d){e.preventDefault();const n=(i+d+pads.length)%pads.length;pads[n].focus();pick(n)}})});
draw();return()=>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 = `
.uvq07-syn {
  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;
  width: 17em;
  padding: 1.1em;
  border-radius: 1em;
  color: #1b1b1b;
  background: repeating-linear-gradient(90deg,rgba(255,255,255,.18) 0 1px,transparent 1px 3px),linear-gradient(180deg,color-mix(in srgb,var(--c2) 70%,#fff),var(--c2));
  box-shadow: 0 1.2em 2.2em -1.2em rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.7),inset 0 -2px 0 rgba(0,0,0,.08);
}

.uvq07-syn header {
  display: flex;
  align-items: center;
  gap: .5em;
}

.uvq07-syn .id {
  padding: .2em .45em;
  border-radius: .25em;
  font: 700 .66em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: #fff;
  background: #1b1b1b;
}

.uvq07-syn h3 {
  flex: 1;
  margin: 0;
  font-size: .95em;
  font-weight: 800;
  letter-spacing: -.01em;
}

.uvq07-syn .bpm {
  font: 600 .66em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  opacity: .6;
}

.uvq07-syn .sc {
  height: 4.6em;
  margin: .8em 0 1em;
  padding: .45em;
  border-radius: .45em;
  background: #0d0f0e;
  box-shadow: inset 0 .15em .4em rgba(0,0,0,.8),0 1px 0 rgba(255,255,255,.6);
}

.uvq07-syn .sc svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.uvq07-syn .wv {
  fill: none;
  stroke: var(--c1);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 2px var(--c1));
}

.uvq07-syn .ax {
  stroke: rgba(255,255,255,.14);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 2 3;
}

.uvq07-syn .kn {
  display: flex;
  justify-content: space-around;
}

.uvq07-syn .kw {
  display: grid;
  justify-items: center;
  gap: .3em;
}

.uvq07-syn .k {
  position: relative;
  width: 3.4em;
  height: 3.4em;
  border-radius: 50%;
  cursor: ns-resize;
  touch-action: none;
  outline: 0;
  background: conic-gradient(from -135deg,var(--c1) calc(var(--v) * 2.7deg),rgba(0,0,0,.15) 0 270deg,transparent 0);
}

.uvq07-syn .k::before {
  content: "";
  position: absolute;
  inset: .32em;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%,#4a4a4c,#151516 70%);
  box-shadow: 0 .25em .4em rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.2);
}

.uvq07-syn .k i {
  position: absolute;
  inset: .32em;
  border-radius: 50%;
  transform: rotate(calc(var(--v) * 2.7deg - 135deg));
}

.uvq07-syn .k i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: .28em;
  width: .18em;
  height: .8em;
  margin-left: -.09em;
  border-radius: 1em;
  background: #fff;
}

.uvq07-syn .k:active i::after {
  background: var(--c1);
}

.uvq07-syn .k:focus-visible {
  outline: 2px solid #1b1b1b;
  outline-offset: 3px;
}

.uvq07-syn .lb {
  font-size: .62em;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.uvq07-syn .kw b {
  font: 700 .62em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  opacity: .6;
  font-variant-numeric: tabular-nums;
}

.uvq07-syn .pd {
  display: flex;
  gap: .45em;
  margin-top: 1em;
}

.uvq07-syn .pd button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex: 1;
  padding: .5em 0 .4em;
  border-radius: .35em;
  font: 700 .72em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: #e9e9e9;
  background: linear-gradient(180deg,#3a3a3c,#232325);
  box-shadow: 0 .22em 0 #0e0e0f,inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-syn .pd button::before {
  content: "";
  display: block;
  width: .55em;
  height: .55em;
  margin: 0 auto .35em;
  border-radius: 50%;
  background: #555;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-syn .pd button[aria-checked="true"]::before {
  background: var(--c1);
  box-shadow: 0 0 .5em var(--c1);
}

.uvq07-syn .pd button:active {
  transform: translateY(.17em);
  box-shadow: 0 .05em 0 #0e0e0f;
}

.uvq07-syn .pd button:focus-visible {
  outline: 2px solid #1b1b1b;
  outline-offset: 2px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq07-syn,.uvq07-syn *,.uvq07-syn *::before,.uvq07-syn *::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 ks=[...el.querySelectorAll(".k")],wv=el.querySelector(".wv"),pads=[...el.querySelectorAll(".pd button")],P=[[20,60,80],[90,25,70],[50,90,55],[5,10,95]];let raf=0;
const val=k=>+k.getAttribute("aria-valuenow");
const draw=()=>{const [f,b,l]=ks.map(val),d=1+f/100*12,h=b/100*.8,a=17*l/100,pts=[];for(let i=0;i<=120;i++){const x=i/120,ph=x*Math.PI*4,s=Math.sin(ph);let y=Math.tanh(d*s)/Math.tanh(d)+h*(Math.sin(ph*3)/1.5+Math.sin(ph*5)/2.5);y/=1+h*.9;pts.push((x*100).toFixed(1)+","+(20-y*a).toFixed(2))}wv.setAttribute("points",pts.join(" "))};
const set=(k,v)=>{v=Math.max(0,Math.min(100,Math.round(v)));k.setAttribute("aria-valuenow",String(v));k.style.setProperty("--v",String(v));k.parentElement.querySelector("b").textContent=String(v);draw()};
ks.forEach(k=>{let y0=0,v0=0,on=false;
k.addEventListener("pointerdown",e=>{on=true;y0=e.clientY;v0=val(k);k.setPointerCapture(e.pointerId)});
k.addEventListener("pointermove",e=>{if(!on)return;const sc=k.getBoundingClientRect().height/k.offsetHeight||1;set(k,v0+(y0-e.clientY)/sc*1.1)});
k.addEventListener("pointerup",()=>{on=false});
k.addEventListener("keydown",e=>{const m={ArrowUp:5,ArrowRight:5,ArrowDown:-5,ArrowLeft:-5,PageUp:20,PageDown:-20}[e.key];if(m){e.preventDefault();set(k,val(k)+m)}if(e.key==="Home"){e.preventDefault();set(k,0)}if(e.key==="End"){e.preventDefault();set(k,100)}})});
const pick=i=>{pads.forEach((p,j)=>{p.setAttribute("aria-checked",String(i===j));p.tabIndex=i===j?0:-1});const from=ks.map(val),to=P[i],t0=performance.now();cancelAnimationFrame(raf);
const f=now=>{const p=Math.min(1,(now-t0)/260),e=1-Math.pow(1-p,3);ks.forEach((k,j)=>set(k,from[j]+(to[j]-from[j])*e));if(p<1)raf=requestAnimationFrame(f)};raf=requestAnimationFrame(f)};
pads.forEach((p,i)=>{p.addEventListener("click",()=>pick(i));p.addEventListener("keydown",e=>{const d=e.key==="ArrowRight"||e.key==="ArrowDown"?1:e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:0;if(d){e.preventDefault();const n=(i+d+pads.length)%pads.length;pads[n].focus();pick(n)}})});
draw();return()=>cancelAnimationFrame(raf)
}

export default function CardSynthPatch() {
  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": "#ff5f1f",
          "--c2": "#d6d3cc",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <article className="uvq07-syn"><header><span className="id">P07</span><h3>Glass bass</h3><span className="bpm">120 BPM</span></header><div className="sc" aria-hidden="true"><svg viewBox="0 0 100 40" preserveAspectRatio="none"><line className="ax" x1="0" x2="100" y1="20" y2="20" /><polyline className="wv" points="0.0,20.00 0.8,14.90 1.7,10.84 2.5,8.27 3.3,7.14 4.2,7.15 5.0,7.93 5.8,9.13 6.7,10.40 7.5,11.44 8.3,12.11 9.2,12.37 10.0,12.30 10.8,12.05 11.7,11.81 12.5,11.72 13.3,11.81 14.2,12.05 15.0,12.30 15.8,12.37 16.7,12.11 17.5,11.44 18.3,10.40 19.2,9.13 20.0,7.93 20.8,7.15 21.7,7.14 22.5,8.27 23.3,10.84 24.2,14.90 25.0,20.00 25.8,25.10 26.7,29.16 27.5,31.73 28.3,32.86 29.2,32.85 30.0,32.07 30.8,30.87 31.7,29.60 32.5,28.56 33.3,27.89 34.2,27.63 35.0,27.70 35.8,27.95 36.7,28.19 37.5,28.28 38.3,28.19 39.2,27.95 40.0,27.70 40.8,27.63 41.7,27.89 42.5,28.56 43.3,29.60 44.2,30.87 45.0,32.07 45.8,32.85 46.7,32.86 47.5,31.73 48.3,29.16 49.2,25.10 50.0,20.00 50.8,14.90 51.7,10.84 52.5,8.27 53.3,7.14 54.2,7.15 55.0,7.93 55.8,9.13 56.7,10.40 57.5,11.44 58.3,12.11 59.2,12.37 60.0,12.30 60.8,12.05 61.7,11.81 62.5,11.72 63.3,11.81 64.2,12.05 65.0,12.30 65.8,12.37 66.7,12.11 67.5,11.44 68.3,10.40 69.2,9.13 70.0,7.93 70.8,7.15 71.7,7.14 72.5,8.27 73.3,10.84 74.2,14.90 75.0,20.00 75.8,25.10 76.7,29.16 77.5,31.73 78.3,32.86 79.2,32.85 80.0,32.07 80.8,30.87 81.7,29.60 82.5,28.56 83.3,27.89 84.2,27.63 85.0,27.70 85.8,27.95 86.7,28.19 87.5,28.28 88.3,28.19 89.2,27.95 90.0,27.70 90.8,27.63 91.7,27.89 92.5,28.56 93.3,29.60 94.2,30.87 95.0,32.07 95.8,32.85 96.7,32.86 97.5,31.73 98.3,29.16 99.2,25.10 100.0,20.00" /></svg></div><div className="kn"><div className="kw"><div className="k" role="slider" tabIndex={0} aria-label="Shape" aria-valuemin="0" aria-valuemax="100" aria-valuenow="20" style={{ "--v": "20" } as CSSProperties}><i></i></div><span className="lb">Shape</span><b>20</b></div><div className="kw"><div className="k" role="slider" tabIndex={0} aria-label="Brightness" aria-valuemin="0" aria-valuemax="100" aria-valuenow="60" style={{ "--v": "60" } as CSSProperties}><i></i></div><span className="lb">Brightness</span><b>60</b></div><div className="kw"><div className="k" role="slider" tabIndex={0} aria-label="Level" aria-valuemin="0" aria-valuemax="100" aria-valuenow="80" style={{ "--v": "80" } as CSSProperties}><i></i></div><span className="lb">Level</span><b>80</b></div></div><div className="pd" role="radiogroup" aria-label="Presets"><button type="button" role="radio" aria-checked="true">A</button><button type="button" role="radio" aria-checked="false" tabIndex={-1}>B</button><button type="button" role="radio" aria-checked="false" tabIndex={-1}>C</button><button type="button" role="radio" aria-checked="false" tabIndex={-1}>D</button></div></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 “Synth patch card with knobs” block (Cards) from AIMRAN Library to my project.

## What it is
A synth preset card with three knobs you turn by dragging or with the arrow keys, redrawing the waveform as you go.

## Chosen settings
- Main color: #ff5f1f
- Secondary color: #d6d3cc
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Bajo de cristal"

## 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 = `
.uvq07-syn {
  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;
  width: 17em;
  padding: 1.1em;
  border-radius: 1em;
  color: #1b1b1b;
  background: repeating-linear-gradient(90deg,rgba(255,255,255,.18) 0 1px,transparent 1px 3px),linear-gradient(180deg,color-mix(in srgb,var(--c2) 70%,#fff),var(--c2));
  box-shadow: 0 1.2em 2.2em -1.2em rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.7),inset 0 -2px 0 rgba(0,0,0,.08);
}

.uvq07-syn header {
  display: flex;
  align-items: center;
  gap: .5em;
}

.uvq07-syn .id {
  padding: .2em .45em;
  border-radius: .25em;
  font: 700 .66em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: #fff;
  background: #1b1b1b;
}

.uvq07-syn h3 {
  flex: 1;
  margin: 0;
  font-size: .95em;
  font-weight: 800;
  letter-spacing: -.01em;
}

.uvq07-syn .bpm {
  font: 600 .66em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  opacity: .6;
}

.uvq07-syn .sc {
  height: 4.6em;
  margin: .8em 0 1em;
  padding: .45em;
  border-radius: .45em;
  background: #0d0f0e;
  box-shadow: inset 0 .15em .4em rgba(0,0,0,.8),0 1px 0 rgba(255,255,255,.6);
}

.uvq07-syn .sc svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.uvq07-syn .wv {
  fill: none;
  stroke: var(--c1);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 2px var(--c1));
}

.uvq07-syn .ax {
  stroke: rgba(255,255,255,.14);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 2 3;
}

.uvq07-syn .kn {
  display: flex;
  justify-content: space-around;
}

.uvq07-syn .kw {
  display: grid;
  justify-items: center;
  gap: .3em;
}

.uvq07-syn .k {
  position: relative;
  width: 3.4em;
  height: 3.4em;
  border-radius: 50%;
  cursor: ns-resize;
  touch-action: none;
  outline: 0;
  background: conic-gradient(from -135deg,var(--c1) calc(var(--v) * 2.7deg),rgba(0,0,0,.15) 0 270deg,transparent 0);
}

.uvq07-syn .k::before {
  content: "";
  position: absolute;
  inset: .32em;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%,#4a4a4c,#151516 70%);
  box-shadow: 0 .25em .4em rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.2);
}

.uvq07-syn .k i {
  position: absolute;
  inset: .32em;
  border-radius: 50%;
  transform: rotate(calc(var(--v) * 2.7deg - 135deg));
}

.uvq07-syn .k i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: .28em;
  width: .18em;
  height: .8em;
  margin-left: -.09em;
  border-radius: 1em;
  background: #fff;
}

.uvq07-syn .k:active i::after {
  background: var(--c1);
}

.uvq07-syn .k:focus-visible {
  outline: 2px solid #1b1b1b;
  outline-offset: 3px;
}

.uvq07-syn .lb {
  font-size: .62em;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.uvq07-syn .kw b {
  font: 700 .62em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  opacity: .6;
  font-variant-numeric: tabular-nums;
}

.uvq07-syn .pd {
  display: flex;
  gap: .45em;
  margin-top: 1em;
}

.uvq07-syn .pd button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex: 1;
  padding: .5em 0 .4em;
  border-radius: .35em;
  font: 700 .72em ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  color: #e9e9e9;
  background: linear-gradient(180deg,#3a3a3c,#232325);
  box-shadow: 0 .22em 0 #0e0e0f,inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-syn .pd button::before {
  content: "";
  display: block;
  width: .55em;
  height: .55em;
  margin: 0 auto .35em;
  border-radius: 50%;
  background: #555;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq07-syn .pd button[aria-checked="true"]::before {
  background: var(--c1);
  box-shadow: 0 0 .5em var(--c1);
}

.uvq07-syn .pd button:active {
  transform: translateY(.17em);
  box-shadow: 0 .05em 0 #0e0e0f;
}

.uvq07-syn .pd button:focus-visible {
  outline: 2px solid #1b1b1b;
  outline-offset: 2px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq07-syn,.uvq07-syn *,.uvq07-syn *::before,.uvq07-syn *::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 ks=[...el.querySelectorAll(".k")],wv=el.querySelector(".wv"),pads=[...el.querySelectorAll(".pd button")],P=[[20,60,80],[90,25,70],[50,90,55],[5,10,95]];let raf=0;
const val=k=>+k.getAttribute("aria-valuenow");
const draw=()=>{const [f,b,l]=ks.map(val),d=1+f/100*12,h=b/100*.8,a=17*l/100,pts=[];for(let i=0;i<=120;i++){const x=i/120,ph=x*Math.PI*4,s=Math.sin(ph);let y=Math.tanh(d*s)/Math.tanh(d)+h*(Math.sin(ph*3)/1.5+Math.sin(ph*5)/2.5);y/=1+h*.9;pts.push((x*100).toFixed(1)+","+(20-y*a).toFixed(2))}wv.setAttribute("points",pts.join(" "))};
const set=(k,v)=>{v=Math.max(0,Math.min(100,Math.round(v)));k.setAttribute("aria-valuenow",String(v));k.style.setProperty("--v",String(v));k.parentElement.querySelector("b").textContent=String(v);draw()};
ks.forEach(k=>{let y0=0,v0=0,on=false;
k.addEventListener("pointerdown",e=>{on=true;y0=e.clientY;v0=val(k);k.setPointerCapture(e.pointerId)});
k.addEventListener("pointermove",e=>{if(!on)return;const sc=k.getBoundingClientRect().height/k.offsetHeight||1;set(k,v0+(y0-e.clientY)/sc*1.1)});
k.addEventListener("pointerup",()=>{on=false});
k.addEventListener("keydown",e=>{const m={ArrowUp:5,ArrowRight:5,ArrowDown:-5,ArrowLeft:-5,PageUp:20,PageDown:-20}[e.key];if(m){e.preventDefault();set(k,val(k)+m)}if(e.key==="Home"){e.preventDefault();set(k,0)}if(e.key==="End"){e.preventDefault();set(k,100)}})});
const pick=i=>{pads.forEach((p,j)=>{p.setAttribute("aria-checked",String(i===j));p.tabIndex=i===j?0:-1});const from=ks.map(val),to=P[i],t0=performance.now();cancelAnimationFrame(raf);
const f=now=>{const p=Math.min(1,(now-t0)/260),e=1-Math.pow(1-p,3);ks.forEach((k,j)=>set(k,from[j]+(to[j]-from[j])*e));if(p<1)raf=requestAnimationFrame(f)};raf=requestAnimationFrame(f)};
pads.forEach((p,i)=>{p.addEventListener("click",()=>pick(i));p.addEventListener("keydown",e=>{const d=e.key==="ArrowRight"||e.key==="ArrowDown"?1:e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:0;if(d){e.preventDefault();const n=(i+d+pads.length)%pads.length;pads[n].focus();pick(n)}})});
draw();return()=>cancelAnimationFrame(raf)
}

export default function CardSynthPatch() {
  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": "#ff5f1f",
          "--c2": "#d6d3cc",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <article className="uvq07-syn"><header><span className="id">P07</span><h3>Glass bass</h3><span className="bpm">120 BPM</span></header><div className="sc" aria-hidden="true"><svg viewBox="0 0 100 40" preserveAspectRatio="none"><line className="ax" x1="0" x2="100" y1="20" y2="20" /><polyline className="wv" points="0.0,20.00 0.8,14.90 1.7,10.84 2.5,8.27 3.3,7.14 4.2,7.15 5.0,7.93 5.8,9.13 6.7,10.40 7.5,11.44 8.3,12.11 9.2,12.37 10.0,12.30 10.8,12.05 11.7,11.81 12.5,11.72 13.3,11.81 14.2,12.05 15.0,12.30 15.8,12.37 16.7,12.11 17.5,11.44 18.3,10.40 19.2,9.13 20.0,7.93 20.8,7.15 21.7,7.14 22.5,8.27 23.3,10.84 24.2,14.90 25.0,20.00 25.8,25.10 26.7,29.16 27.5,31.73 28.3,32.86 29.2,32.85 30.0,32.07 30.8,30.87 31.7,29.60 32.5,28.56 33.3,27.89 34.2,27.63 35.0,27.70 35.8,27.95 36.7,28.19 37.5,28.28 38.3,28.19 39.2,27.95 40.0,27.70 40.8,27.63 41.7,27.89 42.5,28.56 43.3,29.60 44.2,30.87 45.0,32.07 45.8,32.85 46.7,32.86 47.5,31.73 48.3,29.16 49.2,25.10 50.0,20.00 50.8,14.90 51.7,10.84 52.5,8.27 53.3,7.14 54.2,7.15 55.0,7.93 55.8,9.13 56.7,10.40 57.5,11.44 58.3,12.11 59.2,12.37 60.0,12.30 60.8,12.05 61.7,11.81 62.5,11.72 63.3,11.81 64.2,12.05 65.0,12.30 65.8,12.37 66.7,12.11 67.5,11.44 68.3,10.40 69.2,9.13 70.0,7.93 70.8,7.15 71.7,7.14 72.5,8.27 73.3,10.84 74.2,14.90 75.0,20.00 75.8,25.10 76.7,29.16 77.5,31.73 78.3,32.86 79.2,32.85 80.0,32.07 80.8,30.87 81.7,29.60 82.5,28.56 83.3,27.89 84.2,27.63 85.0,27.70 85.8,27.95 86.7,28.19 87.5,28.28 88.3,28.19 89.2,27.95 90.0,27.70 90.8,27.63 91.7,27.89 92.5,28.56 93.3,29.60 94.2,30.87 95.0,32.07 95.8,32.85 96.7,32.86 97.5,31.73 98.3,29.16 99.2,25.10 100.0,20.00" /></svg></div><div className="kn"><div className="kw"><div className="k" role="slider" tabIndex={0} aria-label="Shape" aria-valuemin="0" aria-valuemax="100" aria-valuenow="20" style={{ "--v": "20" } as CSSProperties}><i></i></div><span className="lb">Shape</span><b>20</b></div><div className="kw"><div className="k" role="slider" tabIndex={0} aria-label="Brightness" aria-valuemin="0" aria-valuemax="100" aria-valuenow="60" style={{ "--v": "60" } as CSSProperties}><i></i></div><span className="lb">Brightness</span><b>60</b></div><div className="kw"><div className="k" role="slider" tabIndex={0} aria-label="Level" aria-valuemin="0" aria-valuemax="100" aria-valuenow="80" style={{ "--v": "80" } as CSSProperties}><i></i></div><span className="lb">Level</span><b>80</b></div></div><div className="pd" role="radiogroup" aria-label="Presets"><button type="button" role="radio" aria-checked="true">A</button><button type="button" role="radio" aria-checked="false" tabIndex={-1}>B</button><button type="button" role="radio" aria-checked="false" tabIndex={-1}>C</button><button type="button" role="radio" aria-checked="false" tabIndex={-1}>D</button></div></article>
      </div>
    </>
  );
}
```

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