# Raked zen garden

> Raked sand with grooves that circle three stones; the sun slowly moves the shadows and the pointer parts the lines, on canvas.

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

## Where to use it

A karesansui dry garden seen from above. Parallel rake lines cover the sand and give way to rings around three mossy stones, using a clipping path so the two patterns never overlap. Every groove is drawn twice, a dark stroke and a light one, offset by the angle of the sun, which swings slowly and moves the cast shadows of the stones.

The first color is the sand, the second the stone and the third the moss. Density sets the spacing of the grooves. Hover the garden and the lines bend gently around the pointer like sand around a new stone. Calm choice for wellness, tea, spa and meditation apps.

## Code

### HTML

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

### CSS

```css
.pt-uvq16-zen-garden {
  --c1: #e6dcc8;
  --c2: #5d6166;
  --c3: #6f8f3d;
  --k: 1;
  /* velocidad */
  --d: 1;
  /* densidad / escala */
  --o: 1;
  /* opacidad */
  --bg: #05060a;
  --fg: #ffffff;
  --blend: screen;
  min-height: 100vh;
}

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

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

.pt-uvq16-zen-garden 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 ST=[[.26,.3,.085],[.72,.6,.115],[.38,.8,.06]],BL=ST.map((s,q)=>Array.from({length:24},(_,i)=>1+.12*Math.sin(i/24*6.2832*3+q*2)+.06*Math.sin(i/24*6.2832*5+q)));
let t=0,px=-1e4,py=-1e4,pa=0;
const loop=()=>{const v=V(),bg=rgb(v.bg),dk=lum(bg)<.4,sand=mix(rgb(v.c1),bg,dk?.58:.08),gs=css(mix(sand,[0,0,0],dk?.55:.26)),gl=css(mix(sand,[255,255,255],dk?.3:.5)),g=Math.max(5,Math.round(10/v.d)),U=Math.min(W,H);t+=.004*v.k;
const sa=-2.3+Math.sin(t)*.9,ox=Math.cos(sa)*.9,oy=Math.sin(sa)*.9;
pa+=((m.on?1:0)-pa)*.06;if(m.on){if(px<-9e3){px=m.x;py=m.y}px+=(m.x-px)*.15;py+=(m.y-py)*.15}
x.fillStyle=css(sand);x.fillRect(0,0,W,H);
const Z=ST.map(s=>[s[0]*W,s[1]*H,s[2]*U,s[2]*U*1.3+6*g]);
const two=()=>{x.lineWidth=1.6;x.strokeStyle=gs;x.save();x.translate(-ox,-oy);x.stroke();x.restore();x.lineWidth=1;x.strokeStyle=gl;x.save();x.translate(ox*.7,oy*.7);x.stroke();x.restore()};
x.save();x.beginPath();x.rect(0,0,W,H);Z.forEach(z=>{x.moveTo(z[0]+z[3],z[1]);x.arc(z[0],z[1],z[3],0,6.2832)});x.clip("evenodd");
x.beginPath();for(let y0=g/2;y0<H+g;y0+=g){for(let X=-8;X<=W+8;X+=6){let y=y0;if(pa>.01){const dx=X-px,dy=y0-py,f=Math.exp(-(dx*dx+dy*dy)/5200)*pa;y+=dy/(Math.abs(dy)+10)*f*34}X<-7?x.moveTo(X,y):x.lineTo(X,y)}}two();x.restore();
Z.forEach(z=>{x.beginPath();for(let r=1;r<=6;r++){const R=z[2]*1.3+r*g-g/2;x.moveTo(z[0]+R,z[1]);x.arc(z[0],z[1],R,0,6.2832)}two()});
const st=rgb(v.c2),mo=rgb(v.c3);
Z.forEach((z,q)=>{const r=z[2],b=BL[q],shape=(cx,cy,s)=>{x.beginPath();b.forEach((f,i)=>{const a=i/24*6.2832,X=cx+Math.cos(a)*r*f*s,Y=cy+Math.sin(a)*r*f*s*.82;i?x.lineTo(X,Y):x.moveTo(X,Y)});x.closePath()};
x.save();x.shadowColor="rgba(0,0,0,"+(dk?.6:.35)+")";x.shadowBlur=r*.35;x.shadowOffsetX=-ox*r*.4;x.shadowOffsetY=-oy*r*.4;
const gr=x.createRadialGradient(z[0]+ox*r*.4,z[1]+oy*r*.35,r*.1,z[0],z[1],r*1.15);gr.addColorStop(0,css(mix(st,[255,255,255],.35)));gr.addColorStop(.55,css(st));gr.addColorStop(1,css(mix(st,[0,0,0],.5)));shape(z[0],z[1],1);x.fillStyle=gr;x.fill();x.restore();
shape(z[0]-r*.12,z[1]-r*.16,.55);x.fillStyle=css(mo,.8);x.fill();x.fillStyle=css(mix(mo,[255,255,255],.3),.7);for(let d=0;d<10;d++){const a=d*2.4+q,rr=r*.32*((d*.37)%1);x.fillRect(z[0]-r*.12+Math.cos(a)*rr,z[1]-r*.16+Math.sin(a)*rr*.8,1.4,1.4)}});
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-zen-garden"));
```

### React

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

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

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

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

`;

export default function PatternUvq16ZenGarden() {
  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 ST=[[.26,.3,.085],[.72,.6,.115],[.38,.8,.06]],BL=ST.map((s,q)=>Array.from({length:24},(_,i)=>1+.12*Math.sin(i/24*6.2832*3+q*2)+.06*Math.sin(i/24*6.2832*5+q)));
let t=0,px=-1e4,py=-1e4,pa=0;
const loop=()=>{const v=V(),bg=rgb(v.bg),dk=lum(bg)<.4,sand=mix(rgb(v.c1),bg,dk?.58:.08),gs=css(mix(sand,[0,0,0],dk?.55:.26)),gl=css(mix(sand,[255,255,255],dk?.3:.5)),g=Math.max(5,Math.round(10/v.d)),U=Math.min(W,H);t+=.004*v.k;
const sa=-2.3+Math.sin(t)*.9,ox=Math.cos(sa)*.9,oy=Math.sin(sa)*.9;
pa+=((m.on?1:0)-pa)*.06;if(m.on){if(px<-9e3){px=m.x;py=m.y}px+=(m.x-px)*.15;py+=(m.y-py)*.15}
x.fillStyle=css(sand);x.fillRect(0,0,W,H);
const Z=ST.map(s=>[s[0]*W,s[1]*H,s[2]*U,s[2]*U*1.3+6*g]);
const two=()=>{x.lineWidth=1.6;x.strokeStyle=gs;x.save();x.translate(-ox,-oy);x.stroke();x.restore();x.lineWidth=1;x.strokeStyle=gl;x.save();x.translate(ox*.7,oy*.7);x.stroke();x.restore()};
x.save();x.beginPath();x.rect(0,0,W,H);Z.forEach(z=>{x.moveTo(z[0]+z[3],z[1]);x.arc(z[0],z[1],z[3],0,6.2832)});x.clip("evenodd");
x.beginPath();for(let y0=g/2;y0<H+g;y0+=g){for(let X=-8;X<=W+8;X+=6){let y=y0;if(pa>.01){const dx=X-px,dy=y0-py,f=Math.exp(-(dx*dx+dy*dy)/5200)*pa;y+=dy/(Math.abs(dy)+10)*f*34}X<-7?x.moveTo(X,y):x.lineTo(X,y)}}two();x.restore();
Z.forEach(z=>{x.beginPath();for(let r=1;r<=6;r++){const R=z[2]*1.3+r*g-g/2;x.moveTo(z[0]+R,z[1]);x.arc(z[0],z[1],R,0,6.2832)}two()});
const st=rgb(v.c2),mo=rgb(v.c3);
Z.forEach((z,q)=>{const r=z[2],b=BL[q],shape=(cx,cy,s)=>{x.beginPath();b.forEach((f,i)=>{const a=i/24*6.2832,X=cx+Math.cos(a)*r*f*s,Y=cy+Math.sin(a)*r*f*s*.82;i?x.lineTo(X,Y):x.moveTo(X,Y)});x.closePath()};
x.save();x.shadowColor="rgba(0,0,0,"+(dk?.6:.35)+")";x.shadowBlur=r*.35;x.shadowOffsetX=-ox*r*.4;x.shadowOffsetY=-oy*r*.4;
const gr=x.createRadialGradient(z[0]+ox*r*.4,z[1]+oy*r*.35,r*.1,z[0],z[1],r*1.15);gr.addColorStop(0,css(mix(st,[255,255,255],.35)));gr.addColorStop(.55,css(st));gr.addColorStop(1,css(mix(st,[0,0,0],.5)));shape(z[0],z[1],1);x.fillStyle=gr;x.fill();x.restore();
shape(z[0]-r*.12,z[1]-r*.16,.55);x.fillStyle=css(mo,.8);x.fill();x.fillStyle=css(mix(mo,[255,255,255],.3),.7);for(let d=0;d<10;d++){const a=d*2.4+q,rr=r*.32*((d*.37)%1);x.fillRect(z[0]-r*.12+Math.cos(a)*rr,z[1]-r*.16+Math.sin(a)*rr*.8,1.4,1.4)}});
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-zen-garden"
        style={{
          "--c1": "#e6dcc8",
          "--c2": "#5d6166",
          "--c3": "#6f8f3d",
          "--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 “Raked zen garden” block (Backgrounds) from AIMRAN Library to my project.

## What it is
Raked sand with grooves that circle three stones; the sun slowly moves the shadows and the pointer parts the lines, on canvas.

## Chosen settings
- Color 1: #e6dcc8
- Color 2: #5d6166
- Color 3: #6f8f3d
- 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-zen-garden {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  container-type: size;
  isolation: isolate;
}

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

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

`;

export default function PatternUvq16ZenGarden() {
  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 ST=[[.26,.3,.085],[.72,.6,.115],[.38,.8,.06]],BL=ST.map((s,q)=>Array.from({length:24},(_,i)=>1+.12*Math.sin(i/24*6.2832*3+q*2)+.06*Math.sin(i/24*6.2832*5+q)));
let t=0,px=-1e4,py=-1e4,pa=0;
const loop=()=>{const v=V(),bg=rgb(v.bg),dk=lum(bg)<.4,sand=mix(rgb(v.c1),bg,dk?.58:.08),gs=css(mix(sand,[0,0,0],dk?.55:.26)),gl=css(mix(sand,[255,255,255],dk?.3:.5)),g=Math.max(5,Math.round(10/v.d)),U=Math.min(W,H);t+=.004*v.k;
const sa=-2.3+Math.sin(t)*.9,ox=Math.cos(sa)*.9,oy=Math.sin(sa)*.9;
pa+=((m.on?1:0)-pa)*.06;if(m.on){if(px<-9e3){px=m.x;py=m.y}px+=(m.x-px)*.15;py+=(m.y-py)*.15}
x.fillStyle=css(sand);x.fillRect(0,0,W,H);
const Z=ST.map(s=>[s[0]*W,s[1]*H,s[2]*U,s[2]*U*1.3+6*g]);
const two=()=>{x.lineWidth=1.6;x.strokeStyle=gs;x.save();x.translate(-ox,-oy);x.stroke();x.restore();x.lineWidth=1;x.strokeStyle=gl;x.save();x.translate(ox*.7,oy*.7);x.stroke();x.restore()};
x.save();x.beginPath();x.rect(0,0,W,H);Z.forEach(z=>{x.moveTo(z[0]+z[3],z[1]);x.arc(z[0],z[1],z[3],0,6.2832)});x.clip("evenodd");
x.beginPath();for(let y0=g/2;y0<H+g;y0+=g){for(let X=-8;X<=W+8;X+=6){let y=y0;if(pa>.01){const dx=X-px,dy=y0-py,f=Math.exp(-(dx*dx+dy*dy)/5200)*pa;y+=dy/(Math.abs(dy)+10)*f*34}X<-7?x.moveTo(X,y):x.lineTo(X,y)}}two();x.restore();
Z.forEach(z=>{x.beginPath();for(let r=1;r<=6;r++){const R=z[2]*1.3+r*g-g/2;x.moveTo(z[0]+R,z[1]);x.arc(z[0],z[1],R,0,6.2832)}two()});
const st=rgb(v.c2),mo=rgb(v.c3);
Z.forEach((z,q)=>{const r=z[2],b=BL[q],shape=(cx,cy,s)=>{x.beginPath();b.forEach((f,i)=>{const a=i/24*6.2832,X=cx+Math.cos(a)*r*f*s,Y=cy+Math.sin(a)*r*f*s*.82;i?x.lineTo(X,Y):x.moveTo(X,Y)});x.closePath()};
x.save();x.shadowColor="rgba(0,0,0,"+(dk?.6:.35)+")";x.shadowBlur=r*.35;x.shadowOffsetX=-ox*r*.4;x.shadowOffsetY=-oy*r*.4;
const gr=x.createRadialGradient(z[0]+ox*r*.4,z[1]+oy*r*.35,r*.1,z[0],z[1],r*1.15);gr.addColorStop(0,css(mix(st,[255,255,255],.35)));gr.addColorStop(.55,css(st));gr.addColorStop(1,css(mix(st,[0,0,0],.5)));shape(z[0],z[1],1);x.fillStyle=gr;x.fill();x.restore();
shape(z[0]-r*.12,z[1]-r*.16,.55);x.fillStyle=css(mo,.8);x.fill();x.fillStyle=css(mix(mo,[255,255,255],.3),.7);for(let d=0;d<10;d++){const a=d*2.4+q,rr=r*.32*((d*.37)%1);x.fillRect(z[0]-r*.12+Math.cos(a)*rr,z[1]-r*.16+Math.sin(a)*rr*.8,1.4,1.4)}});
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-zen-garden"
        style={{
          "--c1": "#e6dcc8",
          "--c2": "#5d6166",
          "--c3": "#6f8f3d",
          "--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.
````
