import{_ as V,u as x}from"./index-M_JNBppB.js";import{u as I}from"./useOnEvent-Cta5e-FG.js";import{r as p,c as g,j as z,S as _,B as j,z as B,D as s,W as o,u as r}from"./vue-BJk78QHK.js";import"./element-3_pOinej.js";import"./utils-YI6ye1sf.js";import"./threejs-BafxXW5-.js";import"./vxe-Dx3zSILm.js";const C={style:{position:"relative !important"}},D=Object.assign({name:"Decoration22"},{__name:"Decoration22",props:{propValue:{type:Object,default:()=>({})},element:{type:Object,default:()=>({})},linkage:{type:Object,default:()=>({})}},setup(a){const e=a,{getImgUrl:l}=x(),f=p(null);let c=[];p(-10),g(()=>e.element.style.width/60);const y=g(()=>{const n=e.element.style.width,i=e.element.style.height;return{width:n,height:i}});let h=null;I(g(()=>e.linkage),p(e.element)),z(()=>{w()}),_(()=>{h&&cancelAnimationFrame(h)});function w(){const n=f.value,i=n.getContext("2d"),m=y.value.width,d=y.value.height;n.width=m,n.height=d;function v(t,u){return Math.random()*(u-t)+t}function b(){}b.prototype={init(){this.x=v(0,m),this.y=d,this.color="hsl(180, 100%, 50%)",this.vy=v(1,3),this.hit=0,this.size=e.propValue.waterWith},draw(){if(this.y>this.hit){const t=i.createLinearGradient(this.x,this.y,this.x,this.y+this.size*30);t.addColorStop(0,e.propValue.toprderColor),t.addColorStop(1,e.propValue.botColor),i.fillStyle=t,i.fillRect(this.x,this.y,this.size,this.size*50)}this.update()},update(){this.y>this.hit?this.y-=this.vy:this.init()}},c=[];for(let t=0;t<15;t++)setTimeout(()=>{const u=new b;u.init(),c.push(u)},t*300);function k(){i.clearRect(0,0,m,d);for(let t=0;t<c.length;t++)c[t].draw();h=requestAnimationFrame(k)}k()}return(n,i)=>(B(),j("div",C,[s("canvas",{ref_key:"canvasRef",ref:f,class:"crain"},null,512),s("div",{class:"cicle1",style:o({backgroundImage:`url(${r(l)(a.propValue.img1)})`})},null,4),s("div",{class:"cicle2",style:o({backgroundImage:`url(${r(l)(a.propValue.img2)})`})},null,4),s("div",{class:"cicle3",style:o({backgroundImage:`url(${r(l)(a.propValue.img3)})`})},null,4),s("div",{class:"cicle4",style:o({backgroundImage:`url(${r(l)(a.propValue.img4)})`})},null,4),s("div",{class:"cicle5",style:o({backgroundImage:`url(${r(l)(a.propValue.img5)})`})},null,4)]))}}),A=V(D,[["__scopeId","data-v-1f3b9648"]]);export{A as default};
