# Harp strings

> The strings of a harp vibrate with real wave physics when the pointer crosses them and glow brighter the harder they ring, on canvas.

- Category: [Backgrounds](https://library.aimran.es/components/patterns)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/pt-uvq16-harp
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A concert harp you can play with the pointer. Every string is a small one dimensional wave simulation with fixed ends, so crossing it plucks a triangle shape that splits into travelling waves and slowly dies away. Shorter strings vibrate faster, just like higher notes, and the curved neck and base frame the whole instrument. When nobody plays, a breeze plucks a string now and then.

The first and second colors run across the strings from gold to copper, and the third is the glow of a ringing string. Density sets how many strings there are. Lovely for music schools, concert halls, sound design and calm portfolio intros.

## Code

### HTML

```html
<div class="pt-uvq16-harp"><canvas></canvas></div>
```

### CSS

```css
.pt-uvq16-harp {
  --c1: #d4a020;
  --c2: #9a4f1c;
  --c3: #ffcf6e;
  --k: 1;
  /* velocidad */
  --d: 1;
  /* densidad / escala */
  --o: 1;
  /* opacidad */
  --bg: #05060a;
  --fg: #ffffff;
  --blend: screen;
  min-height: 100vh;
}

.pt-uvq16-harp {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

.pt-uvq16-harp>* {
  opacity: var(--o);
}

.pt-uvq16-harp canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
```

### JavaScript

```js
(function (el) {
const cv=el.querySelector("canvas"),x=cv.getContext("2d");let W=0,H=0,raf=0,LF=null,pend=null,vis=true,dead=false,RF=0;
const RM=matchMedia("(prefers-reduced-motion: reduce)").matches;
const fit=()=>{const r=Math.min(window.devicePixelRatio||1,2),w=el.clientWidth,h=el.clientHeight;if(w===W&&h===H&&cv.width===Math.round(w*r))return;W=w;H=h;cv.width=Math.round(w*r);cv.height=Math.round(h*r);x.setTransform(r,0,0,r,0,0);if(RM&&LF){RF=0;LF()}};
const ro=new ResizeObserver(fit);ro.observe(el);fit();
const io=new IntersectionObserver(e=>{vis=e[e.length-1].isIntersecting;if(vis&&pend&&!dead){const f=pend;pend=null;raf=window.requestAnimationFrame(f)}});io.observe(el);
const requestAnimationFrame=f=>{LF=f;if(dead)return 0;if(RM){if(++RF<90)f();return 0}if(!vis){pend=f;return 0}return window.requestAnimationFrame(f)};
const V=()=>{const s=getComputedStyle(el),g=n=>s.getPropertyValue(n).trim();return{c1:g("--c1"),c2:g("--c2"),c3:g("--c3"),bg:g("--bg")||"#05060a",k:+g("--k")||1,d:+g("--d")||1}};
const pc=document.createElement("canvas").getContext("2d"),CC={};
const rgb=c=>{if(CC[c])return CC[c];pc.fillStyle="#000";pc.fillStyle=c;const s=pc.fillStyle;return CC[c]=s[0]==="#"?[1,3,5].map(i=>parseInt(s.slice(i,i+2),16)):s.slice(s.indexOf("(")+1).split(",").slice(0,3).map(parseFloat)};
const mix=(a,b,p)=>[a[0]+(b[0]-a[0])*p,a[1]+(b[1]-a[1])*p,a[2]+(b[2]-a[2])*p];
const css=(a,o)=>o===undefined?"rgb("+(a[0]|0)+","+(a[1]|0)+","+(a[2]|0)+")":"rgba("+(a[0]|0)+","+(a[1]|0)+","+(a[2]|0)+","+o+")";
const lum=a=>(a[0]*.299+a[1]*.587+a[2]*.114)/255;const m={x:-1e4,y:-1e4,vx:0,vy:0,on:false};const mv=e=>{const r=el.getBoundingClientRect();if(!r.width)return;const nx=(e.clientX-r.left)*W/r.width,ny=(e.clientY-r.top)*H/r.height;if(m.on){m.vx=nx-m.x;m.vy=ny-m.y}m.x=nx;m.y=ny;m.on=true};const lv=()=>{m.on=false;m.x=m.y=-1e4;m.vx=m.vy=0};el.addEventListener("pointermove",mv);el.addEventListener("pointerdown",mv);el.addEventListener("pointerleave",lv);el.addEventListener("pointercancel",lv);
const N=56;let S=[],ns=0,lx=null,idle=0;
const loop=()=>{const v=V(),n=Math.max(8,Math.min(48,Math.round(22*v.d)));if(n!==ns){ns=n;S=Array.from({length:n},()=>({y:new Float32Array(N),u:new Float32Array(N),e:0}))}
const bg=rgb(v.bg),A=rgb(v.c1),Bc=rgb(v.c2),Gl=rgb(v.c3),gap=W/(n+1),bot=H*.92,top=i=>H*(.08+.34*Math.pow(i/(n-1),1.3)+.04*Math.sin(i/(n-1)*3.1416));
const pl=(i,yy,amp)=>{const s=S[i],T0=top(i),j=Math.min(N-2,Math.max(1,Math.round((yy-T0)/(bot-T0)*(N-1))));for(let q=1;q<N-1;q++)s.y[q]+=amp*(q<=j?q/j:(N-1-q)/(N-1-j))};
if(m.on){if(lx!==null){for(let i=0;i<n;i++){const sx=gap*(i+1);if((lx-sx)*(m.x-sx)<0&&m.y>top(i)&&m.y<bot)pl(i,m.y,Math.max(-24,Math.min(24,(m.x-lx)*1.4))+(m.x>lx?6:-6))}}lx=m.x;idle=0}
else{lx=null;if(++idle>60&&Math.random()<.035*v.k)pl(Math.random()*n|0,H*(.45+Math.random()*.4),(Math.random()<.5?-1:1)*(8+Math.random()*12))}
const sub=Math.max(1,Math.min(8,Math.round(3*v.k)));
for(let i=0;i<n;i++){const s=S[i],c=.12+.3*(i/(n-1));for(let r=0;r<sub;r++){for(let q=1;q<N-1;q++)s.u[q]=(s.u[q]+c*(s.y[q-1]+s.y[q+1]-2*s.y[q]))*.9986;for(let q=1;q<N-1;q++)s.y[q]+=s.u[q]}let e=0;for(let q=1;q<N-1;q++)e+=Math.abs(s.y[q]);s.e=e/N}
const gr=x.createLinearGradient(0,0,0,H);gr.addColorStop(0,css(bg));gr.addColorStop(1,css(mix(bg,Bc,.16)));x.fillStyle=gr;x.fillRect(0,0,W,H);
x.lineCap="round";x.lineJoin="round";
for(let i=0;i<n;i++){const s=S[i],sx=gap*(i+1),T0=top(i),col=mix(A,Bc,i/(n-1));x.beginPath();for(let q=0;q<N;q++){const X=sx+s.y[q],Y=T0+(bot-T0)*q/(N-1);q?x.lineTo(X,Y):x.moveTo(X,Y)}
if(s.e>.15){x.strokeStyle=css(Gl,Math.min(.7,s.e/5));x.lineWidth=5;x.stroke()}x.strokeStyle=css(s.e>.15?mix(col,Gl,Math.min(.6,s.e/6)):col);x.lineWidth=1+1.2*(1-i/(n-1));x.stroke()}
x.strokeStyle=css(Bc);x.lineWidth=Math.max(5,W*.012);x.beginPath();for(let i=-1;i<=n;i++){const X=gap*(i+1),Y=top(Math.max(0,Math.min(n-1,i)))-6;i<0?x.moveTo(X,Y):x.lineTo(X,Y)}x.stroke();
x.fillStyle=css(Bc);x.fillRect(0,bot,W,H-bot);x.fillStyle=css(Gl);for(let i=0;i<n;i++){x.beginPath();x.arc(gap*(i+1),top(i),2.2,0,6.2832);x.fill()}
raf=requestAnimationFrame(loop)};loop();
return()=>{dead=true;cancelAnimationFrame(raf);ro.disconnect();io.disconnect();el.removeEventListener("pointermove",mv);el.removeEventListener("pointerdown",mv);el.removeEventListener("pointerleave",lv);el.removeEventListener("pointercancel",lv)};
})(document.querySelector(".pt-uvq16-harp"));
```

### React

```tsx
// @ts-nocheck
import { useEffect, useRef } from "react";

const css = `
.pt-uvq16-harp {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

.pt-uvq16-harp>* {
  opacity: var(--o);
}

.pt-uvq16-harp canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

`;

export default function PatternUvq16Harp() {
  const ref = useRef(null);
  useEffect(() => {
    const el = ref.current;
    if (!el) return;
const cv=el.querySelector("canvas"),x=cv.getContext("2d");let W=0,H=0,raf=0,LF=null,pend=null,vis=true,dead=false,RF=0;
const RM=matchMedia("(prefers-reduced-motion: reduce)").matches;
const fit=()=>{const r=Math.min(window.devicePixelRatio||1,2),w=el.clientWidth,h=el.clientHeight;if(w===W&&h===H&&cv.width===Math.round(w*r))return;W=w;H=h;cv.width=Math.round(w*r);cv.height=Math.round(h*r);x.setTransform(r,0,0,r,0,0);if(RM&&LF){RF=0;LF()}};
const ro=new ResizeObserver(fit);ro.observe(el);fit();
const io=new IntersectionObserver(e=>{vis=e[e.length-1].isIntersecting;if(vis&&pend&&!dead){const f=pend;pend=null;raf=window.requestAnimationFrame(f)}});io.observe(el);
const requestAnimationFrame=f=>{LF=f;if(dead)return 0;if(RM){if(++RF<90)f();return 0}if(!vis){pend=f;return 0}return window.requestAnimationFrame(f)};
const V=()=>{const s=getComputedStyle(el),g=n=>s.getPropertyValue(n).trim();return{c1:g("--c1"),c2:g("--c2"),c3:g("--c3"),bg:g("--bg")||"#05060a",k:+g("--k")||1,d:+g("--d")||1}};
const pc=document.createElement("canvas").getContext("2d"),CC={};
const rgb=c=>{if(CC[c])return CC[c];pc.fillStyle="#000";pc.fillStyle=c;const s=pc.fillStyle;return CC[c]=s[0]==="#"?[1,3,5].map(i=>parseInt(s.slice(i,i+2),16)):s.slice(s.indexOf("(")+1).split(",").slice(0,3).map(parseFloat)};
const mix=(a,b,p)=>[a[0]+(b[0]-a[0])*p,a[1]+(b[1]-a[1])*p,a[2]+(b[2]-a[2])*p];
const css=(a,o)=>o===undefined?"rgb("+(a[0]|0)+","+(a[1]|0)+","+(a[2]|0)+")":"rgba("+(a[0]|0)+","+(a[1]|0)+","+(a[2]|0)+","+o+")";
const lum=a=>(a[0]*.299+a[1]*.587+a[2]*.114)/255;const m={x:-1e4,y:-1e4,vx:0,vy:0,on:false};const mv=e=>{const r=el.getBoundingClientRect();if(!r.width)return;const nx=(e.clientX-r.left)*W/r.width,ny=(e.clientY-r.top)*H/r.height;if(m.on){m.vx=nx-m.x;m.vy=ny-m.y}m.x=nx;m.y=ny;m.on=true};const lv=()=>{m.on=false;m.x=m.y=-1e4;m.vx=m.vy=0};el.addEventListener("pointermove",mv);el.addEventListener("pointerdown",mv);el.addEventListener("pointerleave",lv);el.addEventListener("pointercancel",lv);
const N=56;let S=[],ns=0,lx=null,idle=0;
const loop=()=>{const v=V(),n=Math.max(8,Math.min(48,Math.round(22*v.d)));if(n!==ns){ns=n;S=Array.from({length:n},()=>({y:new Float32Array(N),u:new Float32Array(N),e:0}))}
const bg=rgb(v.bg),A=rgb(v.c1),Bc=rgb(v.c2),Gl=rgb(v.c3),gap=W/(n+1),bot=H*.92,top=i=>H*(.08+.34*Math.pow(i/(n-1),1.3)+.04*Math.sin(i/(n-1)*3.1416));
const pl=(i,yy,amp)=>{const s=S[i],T0=top(i),j=Math.min(N-2,Math.max(1,Math.round((yy-T0)/(bot-T0)*(N-1))));for(let q=1;q<N-1;q++)s.y[q]+=amp*(q<=j?q/j:(N-1-q)/(N-1-j))};
if(m.on){if(lx!==null){for(let i=0;i<n;i++){const sx=gap*(i+1);if((lx-sx)*(m.x-sx)<0&&m.y>top(i)&&m.y<bot)pl(i,m.y,Math.max(-24,Math.min(24,(m.x-lx)*1.4))+(m.x>lx?6:-6))}}lx=m.x;idle=0}
else{lx=null;if(++idle>60&&Math.random()<.035*v.k)pl(Math.random()*n|0,H*(.45+Math.random()*.4),(Math.random()<.5?-1:1)*(8+Math.random()*12))}
const sub=Math.max(1,Math.min(8,Math.round(3*v.k)));
for(let i=0;i<n;i++){const s=S[i],c=.12+.3*(i/(n-1));for(let r=0;r<sub;r++){for(let q=1;q<N-1;q++)s.u[q]=(s.u[q]+c*(s.y[q-1]+s.y[q+1]-2*s.y[q]))*.9986;for(let q=1;q<N-1;q++)s.y[q]+=s.u[q]}let e=0;for(let q=1;q<N-1;q++)e+=Math.abs(s.y[q]);s.e=e/N}
const gr=x.createLinearGradient(0,0,0,H);gr.addColorStop(0,css(bg));gr.addColorStop(1,css(mix(bg,Bc,.16)));x.fillStyle=gr;x.fillRect(0,0,W,H);
x.lineCap="round";x.lineJoin="round";
for(let i=0;i<n;i++){const s=S[i],sx=gap*(i+1),T0=top(i),col=mix(A,Bc,i/(n-1));x.beginPath();for(let q=0;q<N;q++){const X=sx+s.y[q],Y=T0+(bot-T0)*q/(N-1);q?x.lineTo(X,Y):x.moveTo(X,Y)}
if(s.e>.15){x.strokeStyle=css(Gl,Math.min(.7,s.e/5));x.lineWidth=5;x.stroke()}x.strokeStyle=css(s.e>.15?mix(col,Gl,Math.min(.6,s.e/6)):col);x.lineWidth=1+1.2*(1-i/(n-1));x.stroke()}
x.strokeStyle=css(Bc);x.lineWidth=Math.max(5,W*.012);x.beginPath();for(let i=-1;i<=n;i++){const X=gap*(i+1),Y=top(Math.max(0,Math.min(n-1,i)))-6;i<0?x.moveTo(X,Y):x.lineTo(X,Y)}x.stroke();
x.fillStyle=css(Bc);x.fillRect(0,bot,W,H-bot);x.fillStyle=css(Gl);for(let i=0;i<n;i++){x.beginPath();x.arc(gap*(i+1),top(i),2.2,0,6.2832);x.fill()}
raf=requestAnimationFrame(loop)};loop();
return()=>{dead=true;cancelAnimationFrame(raf);ro.disconnect();io.disconnect();el.removeEventListener("pointermove",mv);el.removeEventListener("pointerdown",mv);el.removeEventListener("pointerleave",lv);el.removeEventListener("pointercancel",lv)};
  }, []);
  return (
    <>
      <style>{css}</style>
      <div
        ref={ref}
        className="pt-uvq16-harp"
        style={{
          "--c1": "#d4a020",
          "--c2": "#9a4f1c",
          "--c3": "#ffcf6e",
          "--k": 1,
          "--d": 1,
          "--o": 1,
          "--bg": "#05060a",
          "--fg": "#ffffff",
          "--blend": "screen",
          minHeight: "100vh",
        }}
      >
        <canvas></canvas>
      </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 “Harp strings” block (Backgrounds) from AIMRAN Library to my project.

## What it is
The strings of a harp vibrate with real wave physics when the pointer crosses them and glow brighter the harder they ring, on canvas.

## Chosen settings
- Color 1: #d4a020
- Color 2: #9a4f1c
- Color 3: #ffcf6e
- Speed: 1x (from 0.2 to 3x)
- Density / scale: 1x (from 0.5 to 2x)
- Opacity: 1 (from 0.2 to 1)

## 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
import { useEffect, useRef } from "react";

const css = `
.pt-uvq16-harp {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

.pt-uvq16-harp>* {
  opacity: var(--o);
}

.pt-uvq16-harp canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

`;

export default function PatternUvq16Harp() {
  const ref = useRef(null);
  useEffect(() => {
    const el = ref.current;
    if (!el) return;
const cv=el.querySelector("canvas"),x=cv.getContext("2d");let W=0,H=0,raf=0,LF=null,pend=null,vis=true,dead=false,RF=0;
const RM=matchMedia("(prefers-reduced-motion: reduce)").matches;
const fit=()=>{const r=Math.min(window.devicePixelRatio||1,2),w=el.clientWidth,h=el.clientHeight;if(w===W&&h===H&&cv.width===Math.round(w*r))return;W=w;H=h;cv.width=Math.round(w*r);cv.height=Math.round(h*r);x.setTransform(r,0,0,r,0,0);if(RM&&LF){RF=0;LF()}};
const ro=new ResizeObserver(fit);ro.observe(el);fit();
const io=new IntersectionObserver(e=>{vis=e[e.length-1].isIntersecting;if(vis&&pend&&!dead){const f=pend;pend=null;raf=window.requestAnimationFrame(f)}});io.observe(el);
const requestAnimationFrame=f=>{LF=f;if(dead)return 0;if(RM){if(++RF<90)f();return 0}if(!vis){pend=f;return 0}return window.requestAnimationFrame(f)};
const V=()=>{const s=getComputedStyle(el),g=n=>s.getPropertyValue(n).trim();return{c1:g("--c1"),c2:g("--c2"),c3:g("--c3"),bg:g("--bg")||"#05060a",k:+g("--k")||1,d:+g("--d")||1}};
const pc=document.createElement("canvas").getContext("2d"),CC={};
const rgb=c=>{if(CC[c])return CC[c];pc.fillStyle="#000";pc.fillStyle=c;const s=pc.fillStyle;return CC[c]=s[0]==="#"?[1,3,5].map(i=>parseInt(s.slice(i,i+2),16)):s.slice(s.indexOf("(")+1).split(",").slice(0,3).map(parseFloat)};
const mix=(a,b,p)=>[a[0]+(b[0]-a[0])*p,a[1]+(b[1]-a[1])*p,a[2]+(b[2]-a[2])*p];
const css=(a,o)=>o===undefined?"rgb("+(a[0]|0)+","+(a[1]|0)+","+(a[2]|0)+")":"rgba("+(a[0]|0)+","+(a[1]|0)+","+(a[2]|0)+","+o+")";
const lum=a=>(a[0]*.299+a[1]*.587+a[2]*.114)/255;const m={x:-1e4,y:-1e4,vx:0,vy:0,on:false};const mv=e=>{const r=el.getBoundingClientRect();if(!r.width)return;const nx=(e.clientX-r.left)*W/r.width,ny=(e.clientY-r.top)*H/r.height;if(m.on){m.vx=nx-m.x;m.vy=ny-m.y}m.x=nx;m.y=ny;m.on=true};const lv=()=>{m.on=false;m.x=m.y=-1e4;m.vx=m.vy=0};el.addEventListener("pointermove",mv);el.addEventListener("pointerdown",mv);el.addEventListener("pointerleave",lv);el.addEventListener("pointercancel",lv);
const N=56;let S=[],ns=0,lx=null,idle=0;
const loop=()=>{const v=V(),n=Math.max(8,Math.min(48,Math.round(22*v.d)));if(n!==ns){ns=n;S=Array.from({length:n},()=>({y:new Float32Array(N),u:new Float32Array(N),e:0}))}
const bg=rgb(v.bg),A=rgb(v.c1),Bc=rgb(v.c2),Gl=rgb(v.c3),gap=W/(n+1),bot=H*.92,top=i=>H*(.08+.34*Math.pow(i/(n-1),1.3)+.04*Math.sin(i/(n-1)*3.1416));
const pl=(i,yy,amp)=>{const s=S[i],T0=top(i),j=Math.min(N-2,Math.max(1,Math.round((yy-T0)/(bot-T0)*(N-1))));for(let q=1;q<N-1;q++)s.y[q]+=amp*(q<=j?q/j:(N-1-q)/(N-1-j))};
if(m.on){if(lx!==null){for(let i=0;i<n;i++){const sx=gap*(i+1);if((lx-sx)*(m.x-sx)<0&&m.y>top(i)&&m.y<bot)pl(i,m.y,Math.max(-24,Math.min(24,(m.x-lx)*1.4))+(m.x>lx?6:-6))}}lx=m.x;idle=0}
else{lx=null;if(++idle>60&&Math.random()<.035*v.k)pl(Math.random()*n|0,H*(.45+Math.random()*.4),(Math.random()<.5?-1:1)*(8+Math.random()*12))}
const sub=Math.max(1,Math.min(8,Math.round(3*v.k)));
for(let i=0;i<n;i++){const s=S[i],c=.12+.3*(i/(n-1));for(let r=0;r<sub;r++){for(let q=1;q<N-1;q++)s.u[q]=(s.u[q]+c*(s.y[q-1]+s.y[q+1]-2*s.y[q]))*.9986;for(let q=1;q<N-1;q++)s.y[q]+=s.u[q]}let e=0;for(let q=1;q<N-1;q++)e+=Math.abs(s.y[q]);s.e=e/N}
const gr=x.createLinearGradient(0,0,0,H);gr.addColorStop(0,css(bg));gr.addColorStop(1,css(mix(bg,Bc,.16)));x.fillStyle=gr;x.fillRect(0,0,W,H);
x.lineCap="round";x.lineJoin="round";
for(let i=0;i<n;i++){const s=S[i],sx=gap*(i+1),T0=top(i),col=mix(A,Bc,i/(n-1));x.beginPath();for(let q=0;q<N;q++){const X=sx+s.y[q],Y=T0+(bot-T0)*q/(N-1);q?x.lineTo(X,Y):x.moveTo(X,Y)}
if(s.e>.15){x.strokeStyle=css(Gl,Math.min(.7,s.e/5));x.lineWidth=5;x.stroke()}x.strokeStyle=css(s.e>.15?mix(col,Gl,Math.min(.6,s.e/6)):col);x.lineWidth=1+1.2*(1-i/(n-1));x.stroke()}
x.strokeStyle=css(Bc);x.lineWidth=Math.max(5,W*.012);x.beginPath();for(let i=-1;i<=n;i++){const X=gap*(i+1),Y=top(Math.max(0,Math.min(n-1,i)))-6;i<0?x.moveTo(X,Y):x.lineTo(X,Y)}x.stroke();
x.fillStyle=css(Bc);x.fillRect(0,bot,W,H-bot);x.fillStyle=css(Gl);for(let i=0;i<n;i++){x.beginPath();x.arc(gap*(i+1),top(i),2.2,0,6.2832);x.fill()}
raf=requestAnimationFrame(loop)};loop();
return()=>{dead=true;cancelAnimationFrame(raf);ro.disconnect();io.disconnect();el.removeEventListener("pointermove",mv);el.removeEventListener("pointerdown",mv);el.removeEventListener("pointerleave",lv);el.removeEventListener("pointercancel",lv)};
  }, []);
  return (
    <>
      <style>{css}</style>
      <div
        ref={ref}
        className="pt-uvq16-harp"
        style={{
          "--c1": "#d4a020",
          "--c2": "#9a4f1c",
          "--c3": "#ffcf6e",
          "--k": 1,
          "--d": 1,
          "--o": 1,
          "--bg": "#05060a",
          "--fg": "#ffffff",
          "--blend": "screen",
          minHeight: "100vh",
        }}
      >
        <canvas></canvas>
      </div>
    </>
  );
}
```

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