import{a4 as t,a5 as e,C as o,d as a,a6 as s,q as n,r,o as i,c,w as l,a as d}from"./vendor.6afcf1a6.js";const p=new t,f=[],u=new e,h=new o("#ae3b4a");var m=a({props:{count:{type:Number,default:2e3},columns:{type:Number,default:20}},data:()=>({rotation:[0,0,0],color:"#ffffff",colors:null}),mounted(){this.colors=s({values:["#ae3b4a","#9e809a","#2895d6","#efdd7c","#a0e0ff","#e1eaf1"]}).start((t=>this.color=t)),this.colors.stop();const t=this.$refs.mesh.$el.instance,e=this.columns;for(let o=0;o<this.count;o++){const a=o%e-.5*e,s=.5*Math.floor(o/e),r=2*-s,i={coords:[a,s],position:[a,s,r],rotation:new n,rotationSpeed:{x:.1*Math.random()-.05,y:.1*Math.random()-.05},scale:.5};f.push(i),p.position.set(a,s,r),p.updateMatrix(),t.setMatrixAt(o,p.matrix),t.setColorAt(o,h)}t.instanceColor&&(t.instanceColor.needsUpdate=!0),t.instanceMatrix.needsUpdate=!0,this.update()},methods:{update(){if(requestAnimationFrame(this.update),!this.$refs.mesh)return;const t=this.$refs.mesh.$el.instance;if(!t)return;const e=-.005*Date.now();for(let o=0;o<f.length;o++){const a=f[o],{coords:s}=a,n=.5*u.noise2D(.1*(s[0]+e),.2*(s[1]+e))+.5,r=.5*n+.01;p.position.set.apply(p.position,a.position),p.rotation.x=a.rotation.x=a.rotation.x+a.rotationSpeed.x,p.rotation.y=a.rotation.y=a.rotation.y+a.rotationSpeed.y,p.scale.setScalar(r),p.updateMatrix(),t.setMatrixAt(o,p.matrix),this.colors.seek(n),h.set(this.color),t.setColorAt(o,h)}t.instanceMatrix.needsUpdate=!0,t.instanceColor&&(t.instanceColor.needsUpdate=!0)}}});m.render=function(t,e,o,a,s,n){const p=r("boxGeometry"),f=r("meshBasicMaterial"),u=r("instancedMesh");return i(),c(u,{args:[null,null,t.count],scale:.3,ref:"mesh"},{default:l((()=>[d(p),d(f,{color:"black"})])),_:1},8,["args","scale"])};export{m as _};
