# XY mood pad filter

> A synth-style XY pad: drag the glowing dot to filter music by energy and mood at the same time.

- Category: [Filters](https://library.aimran.es/components/filters)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-f-xy-mood
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Borrowed from hardware samplers and effect units, this pad turns two filters into one gesture: horizontal position sets energy and vertical position sets mood. It is built with plain HTML and CSS, and a small script reads the pointer and the arrow keys. Use it in music, playlist or podcast apps where people browse by feeling rather than by genre.

Change the accent colour to match your brand and use the second colour to tint the pad surface. Rename the axis labels for other pairs, such as price and distance, and show the result list right under the pad so every drag updates it.

## Code

### HTML

```html
<div class="uvq05-xy"><p class="hd"><span>Music mood</span><output aria-live="polite">Energetic and happy</output></p><div class="pad" tabindex="0" role="slider" aria-label="Music mood" aria-valuemin="0" aria-valuemax="100" aria-valuenow="70"><span class="ax t">Happy</span><span class="ax b">Dark</span><span class="ax l">Calm</span><span class="ax r">Energetic</span><i class="cx" aria-hidden="true"></i><i class="cy" aria-hidden="true"></i><i class="pt" aria-hidden="true"></i></div><p class="rd"><span>Energy</span><b class="ve">70</b><span>Joy</span><b class="va">65</b></p></div>
```

### CSS

```css
.uvq05-xy {
  --c1: #ff5b14;
  --c2: #2a2a2a;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq05-xy {
  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: .9em;
  border-radius: 1.2em;
  background: linear-gradient(#ecebe6,#dcd9d1);
  color: #232323;
  box-shadow: inset 0 1px 0 #fff,0 0 0 1px rgba(0,0,0,.07),0 1.4em 2.6em -1.5em rgba(0,0,0,.55);
  --x: .7;
  --y: .65;
}

.uvq05-xy .hd {
  display: flex;
  flex-direction: column;
  gap: .25em;
  margin: 0 0 .7em;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.uvq05-xy output {
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color: var(--c1);
}

.uvq05-xy .pad {
  position: relative;
  height: 11em;
  border-radius: .8em;
  background: radial-gradient(circle,rgba(255,255,255,.16) 1px,transparent 1.6px) 0 0/1.25em 1.25em,linear-gradient(160deg,#333,var(--c2));
  box-shadow: inset 0 .2em .6em rgba(0,0,0,.6),0 1px 0 #fff;
  cursor: crosshair;
  touch-action: none;
  overflow: hidden;
  outline: 0;
}

.uvq05-xy .pad:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq05-xy .ax {
  position: absolute;
  font-size: .58em;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  pointer-events: none;
}

.uvq05-xy .ax.t {
  top: .8em;
  left: 50%;
  translate: -50% 0;
}

.uvq05-xy .ax.b {
  bottom: .8em;
  left: 50%;
  translate: -50% 0;
}

.uvq05-xy .ax.l {
  left: .9em;
  top: 50%;
  translate: 0 -50%;
}

.uvq05-xy .ax.r {
  right: .9em;
  top: 50%;
  translate: 0 -50%;
}

.uvq05-xy .cx,.uvq05-xy .cy {
  position: absolute;
  background: color-mix(in srgb,var(--c1) 55%,transparent);
  pointer-events: none;
  transition: left calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1),top calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq05-xy .cx {
  top: 0;
  bottom: 0;
  width: 1px;
  left: calc(var(--x) * 100%);
}

.uvq05-xy .cy {
  left: 0;
  right: 0;
  height: 1px;
  top: calc((1 - var(--y)) * 100%);
}

.uvq05-xy .pt {
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc((1 - var(--y)) * 100%);
  width: 1.3em;
  height: 1.3em;
  margin: -.65em;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 0 .3em color-mix(in srgb,var(--c1) 28%,transparent),0 0 1.8em .4em color-mix(in srgb,var(--c1) 55%,transparent);
  pointer-events: none;
  transition: left calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1),top calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1),transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-xy .pt::after {
  content: "";
  position: absolute;
  inset: -.3em;
  border-radius: 50%;
  border: 1.5px solid var(--c1);
  animation: uvq05-xyp calc(1.8s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite;
}

.uvq05-xy .pad.is-drag .pt,.uvq05-xy .pad.is-drag .cx,.uvq05-xy .pad.is-drag .cy {
  transition: none;
}

.uvq05-xy .pad:active .pt {
  transform: scale(.85);
}

.uvq05-xy .rd {
  display: flex;
  align-items: baseline;
  gap: .5em;
  margin: .75em 0 0;
  font: 600 .7em ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6b6862;
}

.uvq05-xy .rd b {
  min-width: 3ch;
  color: #232323;
}

@keyframes uvq05-xyp {
  from {
    transform: scale(.6);
    opacity: 1;
  }
  to {
    transform: scale(2.2);
    opacity: 0;
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq05-xy").forEach(el => {
  const p=el.querySelector(".pad"),o=el.querySelector("output"),ve=el.querySelector(".ve"),va=el.querySelector(".va");const W=[["Calm and dark","Energetic and dark"],["Calm and happy","Energetic and happy"]];let x=.7,y=.65,dn=false;
const set=()=>{x=Math.max(0,Math.min(1,x));y=Math.max(0,Math.min(1,y));el.style.setProperty("--x",x.toFixed(3));el.style.setProperty("--y",y.toFixed(3));const e=Math.round(x*100),a=Math.round(y*100);ve.textContent=e;va.textContent=a;o.textContent=W[y>=.5?1:0][x>=.5?1:0];p.setAttribute("aria-valuenow",e);p.setAttribute("aria-valuetext",e+" / "+a)};
const at=ev=>{const r=p.getBoundingClientRect();x=(ev.clientX-r.left)/r.width;y=1-(ev.clientY-r.top)/r.height;set()};
p.addEventListener("pointerdown",ev=>{dn=true;p.setPointerCapture(ev.pointerId);p.classList.remove("is-drag");at(ev)});
p.addEventListener("pointermove",ev=>{if(!dn)return;p.classList.add("is-drag");at(ev)});
const up=()=>{dn=false;p.classList.remove("is-drag")};p.addEventListener("pointerup",up);p.addEventListener("pointercancel",up);
p.addEventListener("keydown",ev=>{const s=ev.shiftKey?.2:.05,k=ev.key;if(k==="ArrowRight")x+=s;else if(k==="ArrowLeft")x-=s;else if(k==="ArrowUp")y+=s;else if(k==="ArrowDown")y-=s;else return;ev.preventDefault();set()});set()
});
```

### 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 = `
.uvq05-xy {
  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: .9em;
  border-radius: 1.2em;
  background: linear-gradient(#ecebe6,#dcd9d1);
  color: #232323;
  box-shadow: inset 0 1px 0 #fff,0 0 0 1px rgba(0,0,0,.07),0 1.4em 2.6em -1.5em rgba(0,0,0,.55);
  --x: .7;
  --y: .65;
}

.uvq05-xy .hd {
  display: flex;
  flex-direction: column;
  gap: .25em;
  margin: 0 0 .7em;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.uvq05-xy output {
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color: var(--c1);
}

.uvq05-xy .pad {
  position: relative;
  height: 11em;
  border-radius: .8em;
  background: radial-gradient(circle,rgba(255,255,255,.16) 1px,transparent 1.6px) 0 0/1.25em 1.25em,linear-gradient(160deg,#333,var(--c2));
  box-shadow: inset 0 .2em .6em rgba(0,0,0,.6),0 1px 0 #fff;
  cursor: crosshair;
  touch-action: none;
  overflow: hidden;
  outline: 0;
}

.uvq05-xy .pad:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq05-xy .ax {
  position: absolute;
  font-size: .58em;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  pointer-events: none;
}

.uvq05-xy .ax.t {
  top: .8em;
  left: 50%;
  translate: -50% 0;
}

.uvq05-xy .ax.b {
  bottom: .8em;
  left: 50%;
  translate: -50% 0;
}

.uvq05-xy .ax.l {
  left: .9em;
  top: 50%;
  translate: 0 -50%;
}

.uvq05-xy .ax.r {
  right: .9em;
  top: 50%;
  translate: 0 -50%;
}

.uvq05-xy .cx,.uvq05-xy .cy {
  position: absolute;
  background: color-mix(in srgb,var(--c1) 55%,transparent);
  pointer-events: none;
  transition: left calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1),top calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq05-xy .cx {
  top: 0;
  bottom: 0;
  width: 1px;
  left: calc(var(--x) * 100%);
}

.uvq05-xy .cy {
  left: 0;
  right: 0;
  height: 1px;
  top: calc((1 - var(--y)) * 100%);
}

.uvq05-xy .pt {
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc((1 - var(--y)) * 100%);
  width: 1.3em;
  height: 1.3em;
  margin: -.65em;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 0 .3em color-mix(in srgb,var(--c1) 28%,transparent),0 0 1.8em .4em color-mix(in srgb,var(--c1) 55%,transparent);
  pointer-events: none;
  transition: left calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1),top calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1),transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-xy .pt::after {
  content: "";
  position: absolute;
  inset: -.3em;
  border-radius: 50%;
  border: 1.5px solid var(--c1);
  animation: uvq05-xyp calc(1.8s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite;
}

.uvq05-xy .pad.is-drag .pt,.uvq05-xy .pad.is-drag .cx,.uvq05-xy .pad.is-drag .cy {
  transition: none;
}

.uvq05-xy .pad:active .pt {
  transform: scale(.85);
}

.uvq05-xy .rd {
  display: flex;
  align-items: baseline;
  gap: .5em;
  margin: .75em 0 0;
  font: 600 .7em ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6b6862;
}

.uvq05-xy .rd b {
  min-width: 3ch;
  color: #232323;
}

@keyframes uvq05-xyp {
  from {
    transform: scale(.6);
    opacity: 1;
  }
  to {
    transform: scale(2.2);
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq05-xy,.uvq05-xy *,.uvq05-xy *::before,.uvq05-xy *::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 p=el.querySelector(".pad"),o=el.querySelector("output"),ve=el.querySelector(".ve"),va=el.querySelector(".va");const W=[["Calm and dark","Energetic and dark"],["Calm and happy","Energetic and happy"]];let x=.7,y=.65,dn=false;
const set=()=>{x=Math.max(0,Math.min(1,x));y=Math.max(0,Math.min(1,y));el.style.setProperty("--x",x.toFixed(3));el.style.setProperty("--y",y.toFixed(3));const e=Math.round(x*100),a=Math.round(y*100);ve.textContent=e;va.textContent=a;o.textContent=W[y>=.5?1:0][x>=.5?1:0];p.setAttribute("aria-valuenow",e);p.setAttribute("aria-valuetext",e+" / "+a)};
const at=ev=>{const r=p.getBoundingClientRect();x=(ev.clientX-r.left)/r.width;y=1-(ev.clientY-r.top)/r.height;set()};
p.addEventListener("pointerdown",ev=>{dn=true;p.setPointerCapture(ev.pointerId);p.classList.remove("is-drag");at(ev)});
p.addEventListener("pointermove",ev=>{if(!dn)return;p.classList.add("is-drag");at(ev)});
const up=()=>{dn=false;p.classList.remove("is-drag")};p.addEventListener("pointerup",up);p.addEventListener("pointercancel",up);
p.addEventListener("keydown",ev=>{const s=ev.shiftKey?.2:.05,k=ev.key;if(k==="ArrowRight")x+=s;else if(k==="ArrowLeft")x-=s;else if(k==="ArrowUp")y+=s;else if(k==="ArrowDown")y-=s;else return;ev.preventDefault();set()});set()
}

export default function FXyMood() {
  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": "#ff5b14",
          "--c2": "#2a2a2a",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq05-xy"><p className="hd"><span>Music mood</span><output aria-live="polite">Energetic and happy</output></p><div className="pad" tabIndex={0} role="slider" aria-label="Music mood" aria-valuemin="0" aria-valuemax="100" aria-valuenow="70"><span className="ax t">Happy</span><span className="ax b">Dark</span><span className="ax l">Calm</span><span className="ax r">Energetic</span><i className="cx" aria-hidden="true"></i><i className="cy" aria-hidden="true"></i><i className="pt" aria-hidden="true"></i></div><p className="rd"><span>Energy</span><b className="ve">70</b><span>Joy</span><b className="va">65</b></p></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 “XY mood pad filter” block (Filters) from AIMRAN Library to my project.

## What it is
A synth-style XY pad: drag the glowing dot to filter music by energy and mood at the same time.

## Chosen settings
- Main color: #ff5b14
- Secondary color: #2a2a2a
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Ánimo de la música"

## 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 = `
.uvq05-xy {
  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: .9em;
  border-radius: 1.2em;
  background: linear-gradient(#ecebe6,#dcd9d1);
  color: #232323;
  box-shadow: inset 0 1px 0 #fff,0 0 0 1px rgba(0,0,0,.07),0 1.4em 2.6em -1.5em rgba(0,0,0,.55);
  --x: .7;
  --y: .65;
}

.uvq05-xy .hd {
  display: flex;
  flex-direction: column;
  gap: .25em;
  margin: 0 0 .7em;
  font-size: .72em;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.uvq05-xy output {
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color: var(--c1);
}

.uvq05-xy .pad {
  position: relative;
  height: 11em;
  border-radius: .8em;
  background: radial-gradient(circle,rgba(255,255,255,.16) 1px,transparent 1.6px) 0 0/1.25em 1.25em,linear-gradient(160deg,#333,var(--c2));
  box-shadow: inset 0 .2em .6em rgba(0,0,0,.6),0 1px 0 #fff;
  cursor: crosshair;
  touch-action: none;
  overflow: hidden;
  outline: 0;
}

.uvq05-xy .pad:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq05-xy .ax {
  position: absolute;
  font-size: .58em;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  pointer-events: none;
}

.uvq05-xy .ax.t {
  top: .8em;
  left: 50%;
  translate: -50% 0;
}

.uvq05-xy .ax.b {
  bottom: .8em;
  left: 50%;
  translate: -50% 0;
}

.uvq05-xy .ax.l {
  left: .9em;
  top: 50%;
  translate: 0 -50%;
}

.uvq05-xy .ax.r {
  right: .9em;
  top: 50%;
  translate: 0 -50%;
}

.uvq05-xy .cx,.uvq05-xy .cy {
  position: absolute;
  background: color-mix(in srgb,var(--c1) 55%,transparent);
  pointer-events: none;
  transition: left calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1),top calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq05-xy .cx {
  top: 0;
  bottom: 0;
  width: 1px;
  left: calc(var(--x) * 100%);
}

.uvq05-xy .cy {
  left: 0;
  right: 0;
  height: 1px;
  top: calc((1 - var(--y)) * 100%);
}

.uvq05-xy .pt {
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc((1 - var(--y)) * 100%);
  width: 1.3em;
  height: 1.3em;
  margin: -.65em;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 0 .3em color-mix(in srgb,var(--c1) 28%,transparent),0 0 1.8em .4em color-mix(in srgb,var(--c1) 55%,transparent);
  pointer-events: none;
  transition: left calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1),top calc(0.5s / var(--k)) cubic-bezier(.34,1.56,.64,1),transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-xy .pt::after {
  content: "";
  position: absolute;
  inset: -.3em;
  border-radius: 50%;
  border: 1.5px solid var(--c1);
  animation: uvq05-xyp calc(1.8s / var(--k)) cubic-bezier(.25,.1,.25,1) infinite;
}

.uvq05-xy .pad.is-drag .pt,.uvq05-xy .pad.is-drag .cx,.uvq05-xy .pad.is-drag .cy {
  transition: none;
}

.uvq05-xy .pad:active .pt {
  transform: scale(.85);
}

.uvq05-xy .rd {
  display: flex;
  align-items: baseline;
  gap: .5em;
  margin: .75em 0 0;
  font: 600 .7em ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6b6862;
}

.uvq05-xy .rd b {
  min-width: 3ch;
  color: #232323;
}

@keyframes uvq05-xyp {
  from {
    transform: scale(.6);
    opacity: 1;
  }
  to {
    transform: scale(2.2);
    opacity: 0;
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq05-xy,.uvq05-xy *,.uvq05-xy *::before,.uvq05-xy *::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 p=el.querySelector(".pad"),o=el.querySelector("output"),ve=el.querySelector(".ve"),va=el.querySelector(".va");const W=[["Calm and dark","Energetic and dark"],["Calm and happy","Energetic and happy"]];let x=.7,y=.65,dn=false;
const set=()=>{x=Math.max(0,Math.min(1,x));y=Math.max(0,Math.min(1,y));el.style.setProperty("--x",x.toFixed(3));el.style.setProperty("--y",y.toFixed(3));const e=Math.round(x*100),a=Math.round(y*100);ve.textContent=e;va.textContent=a;o.textContent=W[y>=.5?1:0][x>=.5?1:0];p.setAttribute("aria-valuenow",e);p.setAttribute("aria-valuetext",e+" / "+a)};
const at=ev=>{const r=p.getBoundingClientRect();x=(ev.clientX-r.left)/r.width;y=1-(ev.clientY-r.top)/r.height;set()};
p.addEventListener("pointerdown",ev=>{dn=true;p.setPointerCapture(ev.pointerId);p.classList.remove("is-drag");at(ev)});
p.addEventListener("pointermove",ev=>{if(!dn)return;p.classList.add("is-drag");at(ev)});
const up=()=>{dn=false;p.classList.remove("is-drag")};p.addEventListener("pointerup",up);p.addEventListener("pointercancel",up);
p.addEventListener("keydown",ev=>{const s=ev.shiftKey?.2:.05,k=ev.key;if(k==="ArrowRight")x+=s;else if(k==="ArrowLeft")x-=s;else if(k==="ArrowUp")y+=s;else if(k==="ArrowDown")y-=s;else return;ev.preventDefault();set()});set()
}

export default function FXyMood() {
  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": "#ff5b14",
          "--c2": "#2a2a2a",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq05-xy"><p className="hd"><span>Music mood</span><output aria-live="polite">Energetic and happy</output></p><div className="pad" tabIndex={0} role="slider" aria-label="Music mood" aria-valuemin="0" aria-valuemax="100" aria-valuenow="70"><span className="ax t">Happy</span><span className="ax b">Dark</span><span className="ax l">Calm</span><span className="ax r">Energetic</span><i className="cx" aria-hidden="true"></i><i className="cy" aria-hidden="true"></i><i className="pt" aria-hidden="true"></i></div><p className="rd"><span>Energy</span><b className="ve">70</b><span>Joy</span><b className="va">65</b></p></div>
      </div>
    </>
  );
}
```

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