# Chalkboard text area

> A text area on a framed green board: the writing looks like chalk, colors sit on the ledge and an eraser sweeps it clean.

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

## Where to use it

A text area set on a slate board with a wooden frame and ledge. A small SVG turbulence filter roughens the letters so they look like chalk, faint smudges sit on the slate, and the sticks on the ledge are real radio buttons that change the chalk color. The felt eraser sweeps across the board and leaves a cloud that fades.

Use the two colors for the yellow and pink chalk sticks and keep the white one as the default. It fits café menus, classroom apps, daily specials and to-do boards, and three or four short lines read best in that handwriting.

## Code

### HTML

```html
<div class="uvq06-ch"><svg class="fx" aria-hidden="true" width="0" height="0"><filter id="uvq06-ch-f"><feTurbulence type="fractalNoise" baseFrequency="1.1" numOctaves="2" result="n"/><feDisplacementMap in="SourceGraphic" in2="n" scale="2"/></filter></svg><div class="bd"><label class="sl"><span class="sr">Write on the board</span><textarea rows="4" spellcheck="false" placeholder="Write on the board"></textarea></label><span class="er" aria-hidden="true"></span></div><div class="lg"><div class="ck" role="radiogroup" aria-label="Chalk color"><label style="--k:#f4f1e8"><input type="radio" name="uvq06-ch-k"><span class="sr">White</span></label><label style="--k:var(--c1)"><input type="radio" name="uvq06-ch-k"><span class="sr">Main color</span></label><label style="--k:var(--c2)"><input type="radio" name="uvq06-ch-k"><span class="sr">Secondary color</span></label></div><button type="button" class="rb"><span>Clear</span></button></div></div>
```

### CSS

```css
.uvq06-ch {
  --c1: #fde047;
  --c2: #f9a8d4;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq06-ch {
  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: 20em;
  --ink: #f4f1e8;
}

.uvq06-ch .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.uvq06-ch .fx {
  position: absolute;
  width: 0;
  height: 0;
}

.uvq06-ch .bd {
  position: relative;
  padding: .55em;
  border-radius: .6em;
  background: linear-gradient(90deg,#7a4b26,#a06a3a 20%,#8a5a30 50%,#a36d3d 80%,#7a4b26);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.2),0 1em 1.6em -.9em rgba(0,0,0,.55);
}

.uvq06-ch .bd:focus-within {
  outline: 2px solid color-mix(in srgb,var(--c1) 45%,var(--fg));
  outline-offset: 3px;
}

.uvq06-ch .sl {
  position: relative;
  display: block;
  border-radius: .25em;
  overflow: hidden;
  background: radial-gradient(40% 50% at 25% 30%,rgba(255,255,255,.07),transparent 70%),radial-gradient(35% 40% at 75% 70%,rgba(255,255,255,.05),transparent 70%),linear-gradient(160deg,#2f4a3b,#223629);
  box-shadow: inset 0 0 1.5em rgba(0,0,0,.45);
}

.uvq06-ch .sl::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg,transparent 5%,rgba(255,255,255,.12) 30%,rgba(255,255,255,.07) 60%,transparent 90%);
  opacity: 0;
  transition: opacity calc(1.8s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-ch.wipe .sl::after {
  opacity: 1;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-ch textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 6.2em;
  margin: 0;
  padding: .5em .75em;
  border: 0;
  outline: 0;
  resize: none;
  background: none;
  font: 400 1.15em/1.45 "Chalkboard SE","Chalkduster","Marker Felt","Comic Sans MS","Segoe Print",cursive;
  color: var(--ink);
  caret-color: var(--ink);
  text-shadow: 0 0 1px var(--ink),0 0 .25em color-mix(in srgb,var(--ink) 35%,transparent);
  filter: url(#uvq06-ch-f);
  opacity: .93;
  scrollbar-width: none;
  transition: color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-ch textarea::placeholder {
  color: var(--ink);
  opacity: .45;
}

.uvq06-ch.wipe textarea {
  animation: uvq06-ch-t calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1) forwards;
}

.uvq06-ch .er {
  position: absolute;
  left: .4em;
  top: .9em;
  width: 3.2em;
  height: 1.5em;
  border-radius: .3em;
  background: linear-gradient(#c79a5e 55%,#55565b 55%);
  box-shadow: 0 .3em .5em rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
}

.uvq06-ch.wipe .er {
  animation: uvq06-ch calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1) forwards;
}

.uvq06-ch .lg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 .35em;
  padding: .4em .6em;
  border-radius: 0 0 .5em .5em;
  background: linear-gradient(#8a5a30,#6b4220);
  box-shadow: 0 .5em .8em -.4em rgba(0,0,0,.5);
}

.uvq06-ch .ck {
  display: flex;
  gap: .6em;
}

.uvq06-ch .ck label {
  position: relative;
  display: block;
  width: 2.1em;
  height: .55em;
  border-radius: .25em;
  background: var(--k);
  box-shadow: inset 0 -.12em 0 rgba(0,0,0,.18);
  cursor: pointer;
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq06-ch .ck input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq06-ch .ck label:hover {
  transform: translateY(-.15em);
}

.uvq06-ch .ck label:has(:checked) {
  transform: translateY(-.3em) rotate(-6deg);
}

.uvq06-ch .ck label:has(:focus-visible) {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.uvq06-ch .rb {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 3.6em;
  height: 1.6em;
  padding-top: .18em;
  border-radius: .3em;
  background: linear-gradient(#c79a5e 58%,#55565b 58%);
  box-shadow: 0 .2em .3em rgba(0,0,0,.4);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq06-ch .rb span {
  font-size: .55em;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #3b2a17;
}

.uvq06-ch .rb:hover {
  transform: rotate(-5deg);
}

.uvq06-ch .rb:active {
  transform: scale(.92);
}

.uvq06-ch .rb:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@keyframes uvq06-ch {
  0% {
    opacity: 1;
    transform: translate(0,0) rotate(-8deg);
  }
  25% {
    transform: translate(14em,.8em) rotate(6deg);
  }
  50% {
    transform: translate(1em,2.4em) rotate(-6deg);
  }
  75% {
    opacity: 1;
    transform: translate(14em,3.6em) rotate(6deg);
  }
  100% {
    opacity: 0;
    transform: translate(8em,2em);
  }
}

@keyframes uvq06-ch-t {
  to {
    opacity: 0;
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq06-ch").forEach(el => {
  const ta=el.querySelector("textarea"),rs=[...el.querySelectorAll("[type=radio]")],er=el.querySelector(".er");
ta.value=["Today's menu","Tomato soup · 4 €","Cheesecake · 3 €"].join("\n");
rs.forEach(r=>r.addEventListener("change",()=>el.style.setProperty("--ink",r.parentElement.style.getPropertyValue("--k"))));rs[0].checked=true;
el.querySelector(".rb").addEventListener("click",()=>el.classList.add("wipe"));
er.addEventListener("animationend",()=>{ta.value="";el.classList.remove("wipe");ta.focus()})
});
```

### 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 = `
.uvq06-ch {
  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: 20em;
  --ink: #f4f1e8;
}

.uvq06-ch .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.uvq06-ch .fx {
  position: absolute;
  width: 0;
  height: 0;
}

.uvq06-ch .bd {
  position: relative;
  padding: .55em;
  border-radius: .6em;
  background: linear-gradient(90deg,#7a4b26,#a06a3a 20%,#8a5a30 50%,#a36d3d 80%,#7a4b26);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.2),0 1em 1.6em -.9em rgba(0,0,0,.55);
}

.uvq06-ch .bd:focus-within {
  outline: 2px solid color-mix(in srgb,var(--c1) 45%,var(--fg));
  outline-offset: 3px;
}

.uvq06-ch .sl {
  position: relative;
  display: block;
  border-radius: .25em;
  overflow: hidden;
  background: radial-gradient(40% 50% at 25% 30%,rgba(255,255,255,.07),transparent 70%),radial-gradient(35% 40% at 75% 70%,rgba(255,255,255,.05),transparent 70%),linear-gradient(160deg,#2f4a3b,#223629);
  box-shadow: inset 0 0 1.5em rgba(0,0,0,.45);
}

.uvq06-ch .sl::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg,transparent 5%,rgba(255,255,255,.12) 30%,rgba(255,255,255,.07) 60%,transparent 90%);
  opacity: 0;
  transition: opacity calc(1.8s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-ch.wipe .sl::after {
  opacity: 1;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-ch textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 6.2em;
  margin: 0;
  padding: .5em .75em;
  border: 0;
  outline: 0;
  resize: none;
  background: none;
  font: 400 1.15em/1.45 "Chalkboard SE","Chalkduster","Marker Felt","Comic Sans MS","Segoe Print",cursive;
  color: var(--ink);
  caret-color: var(--ink);
  text-shadow: 0 0 1px var(--ink),0 0 .25em color-mix(in srgb,var(--ink) 35%,transparent);
  filter: url(#uvq06-ch-f);
  opacity: .93;
  scrollbar-width: none;
  transition: color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-ch textarea::placeholder {
  color: var(--ink);
  opacity: .45;
}

.uvq06-ch.wipe textarea {
  animation: uvq06-ch-t calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1) forwards;
}

.uvq06-ch .er {
  position: absolute;
  left: .4em;
  top: .9em;
  width: 3.2em;
  height: 1.5em;
  border-radius: .3em;
  background: linear-gradient(#c79a5e 55%,#55565b 55%);
  box-shadow: 0 .3em .5em rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
}

.uvq06-ch.wipe .er {
  animation: uvq06-ch calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1) forwards;
}

.uvq06-ch .lg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 .35em;
  padding: .4em .6em;
  border-radius: 0 0 .5em .5em;
  background: linear-gradient(#8a5a30,#6b4220);
  box-shadow: 0 .5em .8em -.4em rgba(0,0,0,.5);
}

.uvq06-ch .ck {
  display: flex;
  gap: .6em;
}

.uvq06-ch .ck label {
  position: relative;
  display: block;
  width: 2.1em;
  height: .55em;
  border-radius: .25em;
  background: var(--k);
  box-shadow: inset 0 -.12em 0 rgba(0,0,0,.18);
  cursor: pointer;
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq06-ch .ck input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq06-ch .ck label:hover {
  transform: translateY(-.15em);
}

.uvq06-ch .ck label:has(:checked) {
  transform: translateY(-.3em) rotate(-6deg);
}

.uvq06-ch .ck label:has(:focus-visible) {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.uvq06-ch .rb {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 3.6em;
  height: 1.6em;
  padding-top: .18em;
  border-radius: .3em;
  background: linear-gradient(#c79a5e 58%,#55565b 58%);
  box-shadow: 0 .2em .3em rgba(0,0,0,.4);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq06-ch .rb span {
  font-size: .55em;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #3b2a17;
}

.uvq06-ch .rb:hover {
  transform: rotate(-5deg);
}

.uvq06-ch .rb:active {
  transform: scale(.92);
}

.uvq06-ch .rb:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@keyframes uvq06-ch {
  0% {
    opacity: 1;
    transform: translate(0,0) rotate(-8deg);
  }
  25% {
    transform: translate(14em,.8em) rotate(6deg);
  }
  50% {
    transform: translate(1em,2.4em) rotate(-6deg);
  }
  75% {
    opacity: 1;
    transform: translate(14em,3.6em) rotate(6deg);
  }
  100% {
    opacity: 0;
    transform: translate(8em,2em);
  }
}

@keyframes uvq06-ch-t {
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq06-ch,.uvq06-ch *,.uvq06-ch *::before,.uvq06-ch *::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 ta=el.querySelector("textarea"),rs=[...el.querySelectorAll("[type=radio]")],er=el.querySelector(".er");
ta.value=["Today's menu","Tomato soup · 4 €","Cheesecake · 3 €"].join("\n");
rs.forEach(r=>r.addEventListener("change",()=>el.style.setProperty("--ink",r.parentElement.style.getPropertyValue("--k"))));rs[0].checked=true;
el.querySelector(".rb").addEventListener("click",()=>el.classList.add("wipe"));
er.addEventListener("animationend",()=>{ta.value="";el.classList.remove("wipe");ta.focus()})
}

export default function InChalkboard() {
  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": "#fde047",
          "--c2": "#f9a8d4",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq06-ch"><svg className="fx" aria-hidden="true" width="0" height="0"><filter id="uvq06-ch-f"><feTurbulence type="fractalNoise" baseFrequency="1.1" numOctaves="2" result="n" /><feDisplacementMap in="SourceGraphic" in2="n" scale="2" /></filter></svg><div className="bd"><label className="sl"><span className="sr">Write on the board</span><textarea rows={4} spellCheck="false" placeholder="Write on the board"></textarea></label><span className="er" aria-hidden="true"></span></div><div className="lg"><div className="ck" role="radiogroup" aria-label="Chalk color"><label style={{ "--k": "#f4f1e8" } as CSSProperties}><input type="radio" name="uvq06-ch-k" /><span className="sr">White</span></label><label style={{ "--k": "var(--c1)" } as CSSProperties}><input type="radio" name="uvq06-ch-k" /><span className="sr">Main color</span></label><label style={{ "--k": "var(--c2)" } as CSSProperties}><input type="radio" name="uvq06-ch-k" /><span className="sr">Secondary color</span></label></div><button type="button" className="rb"><span>Clear</span></button></div></div>
      </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 “Chalkboard text area” block (Inputs) from AIMRAN Library to my project.

## What it is
A text area on a framed green board: the writing looks like chalk, colors sit on the ledge and an eraser sweeps it clean.

## Chosen settings
- Main color: #fde047
- Secondary color: #f9a8d4
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Escribe en la pizarra"

## 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 = `
.uvq06-ch {
  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: 20em;
  --ink: #f4f1e8;
}

.uvq06-ch .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.uvq06-ch .fx {
  position: absolute;
  width: 0;
  height: 0;
}

.uvq06-ch .bd {
  position: relative;
  padding: .55em;
  border-radius: .6em;
  background: linear-gradient(90deg,#7a4b26,#a06a3a 20%,#8a5a30 50%,#a36d3d 80%,#7a4b26);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.2),0 1em 1.6em -.9em rgba(0,0,0,.55);
}

.uvq06-ch .bd:focus-within {
  outline: 2px solid color-mix(in srgb,var(--c1) 45%,var(--fg));
  outline-offset: 3px;
}

.uvq06-ch .sl {
  position: relative;
  display: block;
  border-radius: .25em;
  overflow: hidden;
  background: radial-gradient(40% 50% at 25% 30%,rgba(255,255,255,.07),transparent 70%),radial-gradient(35% 40% at 75% 70%,rgba(255,255,255,.05),transparent 70%),linear-gradient(160deg,#2f4a3b,#223629);
  box-shadow: inset 0 0 1.5em rgba(0,0,0,.45);
}

.uvq06-ch .sl::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg,transparent 5%,rgba(255,255,255,.12) 30%,rgba(255,255,255,.07) 60%,transparent 90%);
  opacity: 0;
  transition: opacity calc(1.8s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-ch.wipe .sl::after {
  opacity: 1;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-ch textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 6.2em;
  margin: 0;
  padding: .5em .75em;
  border: 0;
  outline: 0;
  resize: none;
  background: none;
  font: 400 1.15em/1.45 "Chalkboard SE","Chalkduster","Marker Felt","Comic Sans MS","Segoe Print",cursive;
  color: var(--ink);
  caret-color: var(--ink);
  text-shadow: 0 0 1px var(--ink),0 0 .25em color-mix(in srgb,var(--ink) 35%,transparent);
  filter: url(#uvq06-ch-f);
  opacity: .93;
  scrollbar-width: none;
  transition: color calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq06-ch textarea::placeholder {
  color: var(--ink);
  opacity: .45;
}

.uvq06-ch.wipe textarea {
  animation: uvq06-ch-t calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1) forwards;
}

.uvq06-ch .er {
  position: absolute;
  left: .4em;
  top: .9em;
  width: 3.2em;
  height: 1.5em;
  border-radius: .3em;
  background: linear-gradient(#c79a5e 55%,#55565b 55%);
  box-shadow: 0 .3em .5em rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
}

.uvq06-ch.wipe .er {
  animation: uvq06-ch calc(1s / var(--k)) cubic-bezier(.25,.1,.25,1) forwards;
}

.uvq06-ch .lg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 .35em;
  padding: .4em .6em;
  border-radius: 0 0 .5em .5em;
  background: linear-gradient(#8a5a30,#6b4220);
  box-shadow: 0 .5em .8em -.4em rgba(0,0,0,.5);
}

.uvq06-ch .ck {
  display: flex;
  gap: .6em;
}

.uvq06-ch .ck label {
  position: relative;
  display: block;
  width: 2.1em;
  height: .55em;
  border-radius: .25em;
  background: var(--k);
  box-shadow: inset 0 -.12em 0 rgba(0,0,0,.18);
  cursor: pointer;
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq06-ch .ck input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq06-ch .ck label:hover {
  transform: translateY(-.15em);
}

.uvq06-ch .ck label:has(:checked) {
  transform: translateY(-.3em) rotate(-6deg);
}

.uvq06-ch .ck label:has(:focus-visible) {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.uvq06-ch .rb {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 3.6em;
  height: 1.6em;
  padding-top: .18em;
  border-radius: .3em;
  background: linear-gradient(#c79a5e 58%,#55565b 58%);
  box-shadow: 0 .2em .3em rgba(0,0,0,.4);
  transition: transform calc(0.25s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq06-ch .rb span {
  font-size: .55em;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #3b2a17;
}

.uvq06-ch .rb:hover {
  transform: rotate(-5deg);
}

.uvq06-ch .rb:active {
  transform: scale(.92);
}

.uvq06-ch .rb:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@keyframes uvq06-ch {
  0% {
    opacity: 1;
    transform: translate(0,0) rotate(-8deg);
  }
  25% {
    transform: translate(14em,.8em) rotate(6deg);
  }
  50% {
    transform: translate(1em,2.4em) rotate(-6deg);
  }
  75% {
    opacity: 1;
    transform: translate(14em,3.6em) rotate(6deg);
  }
  100% {
    opacity: 0;
    transform: translate(8em,2em);
  }
}

@keyframes uvq06-ch-t {
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq06-ch,.uvq06-ch *,.uvq06-ch *::before,.uvq06-ch *::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 ta=el.querySelector("textarea"),rs=[...el.querySelectorAll("[type=radio]")],er=el.querySelector(".er");
ta.value=["Today's menu","Tomato soup · 4 €","Cheesecake · 3 €"].join("\n");
rs.forEach(r=>r.addEventListener("change",()=>el.style.setProperty("--ink",r.parentElement.style.getPropertyValue("--k"))));rs[0].checked=true;
el.querySelector(".rb").addEventListener("click",()=>el.classList.add("wipe"));
er.addEventListener("animationend",()=>{ta.value="";el.classList.remove("wipe");ta.focus()})
}

export default function InChalkboard() {
  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": "#fde047",
          "--c2": "#f9a8d4",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq06-ch"><svg className="fx" aria-hidden="true" width="0" height="0"><filter id="uvq06-ch-f"><feTurbulence type="fractalNoise" baseFrequency="1.1" numOctaves="2" result="n" /><feDisplacementMap in="SourceGraphic" in2="n" scale="2" /></filter></svg><div className="bd"><label className="sl"><span className="sr">Write on the board</span><textarea rows={4} spellCheck="false" placeholder="Write on the board"></textarea></label><span className="er" aria-hidden="true"></span></div><div className="lg"><div className="ck" role="radiogroup" aria-label="Chalk color"><label style={{ "--k": "#f4f1e8" } as CSSProperties}><input type="radio" name="uvq06-ch-k" /><span className="sr">White</span></label><label style={{ "--k": "var(--c1)" } as CSSProperties}><input type="radio" name="uvq06-ch-k" /><span className="sr">Main color</span></label><label style={{ "--k": "var(--c2)" } as CSSProperties}><input type="radio" name="uvq06-ch-k" /><span className="sr">Secondary color</span></label></div><button type="button" className="rb"><span>Clear</span></button></div></div>
      </div>
    </>
  );
}
```

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