File: /home/adventp/www/wp-content/themes/brooklyn/js/noise/pipeline.min.js
!function(t){"use strict";let{PI:i,cos:s,sin:e,abs:a,sqrt:h,pow:n,round:c,random:r,atan2:p}=Math,o=.5*i,d=2*i,l=t=>t*r(),P=45*(i/180);window.UT_Pipeline_Effect=class{constructor(i,s){this.container=i,this.config=JSON.parse(this.container.dataset.effectConfig),this.canvas="",this.ctx="",this.center=[],this.tick=0,this.simplex="",this.pipeProps=[],t(this.container).css("mix-blend-mode",this.config.blend_mode),this.createCanvas(),this.resize(),this.initPipes(),this.draw(),s&&"function"==typeof s&&s(this)}initPipes(){this.pipeProps=new Float32Array(240);let t;for(t=0;t<240;t+=8)this.initPipe(t)}initPipe(t){let i,s,e,a,h,n,r,p;i=l(this.canvas.a.width),s=this.center[1],e=c(l(1))?o:d-o,a=.5+l(1),h=0,n=100+l(300),r=2+l(4),p=this.config.hue.H+l(this.config.rangeHue),this.pipeProps.set([i,s,e,a,0,n,r,p],t)}updatePipes(){this.tick++;let t;for(t=0;t<240;t+=8)this.updatePipe(t)}updatePipe(t){let i,a,h,n,r,p,o,d,b,v,x=1+t,g=2+t,f=3+t,u=4+t,w=5+t,m=6+t,C=7+t;i=this.pipeProps[t],a=this.pipeProps[x],h=this.pipeProps[g],n=this.pipeProps[f],r=this.pipeProps[u],p=this.pipeProps[w],o=this.pipeProps[m],d=this.pipeProps[C],this.drawPipe(i,a,r,p,o,d),r++,i+=s(h)*n,a+=e(h)*n,b=!(this.tick%c(l(58))||c(i)%6&&c(a)%6),v=c(l(1))?-1:1,h+=b?P*v:0,this.pipeProps[t]=i,this.pipeProps[x]=a,this.pipeProps[g]=h,this.pipeProps[u]=r,r>p&&this.initPipe(t)}drawPipe(t,i,s,e,h,n){this.ctx.a.save(),this.ctx.a.strokeStyle=`hsla(${n},${this.config.hue.S}%,${this.config.hue.L}%,${.125*((t,i)=>{let s=.5*i;return a((t+s)%i-s)/s})(s,e)})`,this.ctx.a.beginPath(),this.ctx.a.arc(t,i,h,0,d),this.ctx.a.stroke(),this.ctx.a.closePath(),this.ctx.a.restore()}createCanvas(){this.canvas={a:document.createElement("canvas"),b:document.createElement("canvas")},this.canvas.b.style="\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n ",this.container.appendChild(this.canvas.b),this.ctx={a:this.canvas.a.getContext("2d"),b:this.canvas.b.getContext("2d")}}resize(){const{clientWidth:t,clientHeight:i}=this.container;this.canvas.a.width=t,this.canvas.a.height=i,this.ctx.a.drawImage(this.canvas.b,0,0),this.canvas.b.width=t,this.canvas.b.height=i,this.ctx.b.drawImage(this.canvas.a,0,0),this.center[0]=.5*this.canvas.a.width,this.center[1]=.5*this.canvas.a.height}render(){this.ctx.b.save(),this.ctx.b.fillStyle=this.config.backgroundColor,this.ctx.b.fillRect(0,0,this.canvas.b.width,this.canvas.b.height),this.ctx.b.restore(),this.ctx.b.save(),this.ctx.b.filter="blur(12px)",this.ctx.b.drawImage(this.canvas.a,0,0),this.ctx.b.restore(),this.ctx.b.save(),this.ctx.b.drawImage(this.canvas.a,0,0),this.ctx.b.restore()}draw(){this.updatePipes(),this.render()}}}(jQuery);