text: +function(t){"use strict";function e(t,e,s){for(var i=n.getCss;t=t.offsetParent;)if(i(t,e)===s)return!0;return!1}function s(t,e){n.createCanvas(this,s,t,e)}function i(t){var e=this,s=e.set;s.num>0&&s.range>0&&(t="pause"===t?"off":"on",o[t](s.eventElem,"mousemove",e.moveHandler),o[t](s.eventElem,"touchmove",e.moveHandler))}var n=t.util,o=t.event,h=Math.random,r=Math.abs,a=2*Math.PI;s.defaultConfig={num:.12,maxR:2.4,minR:.6,maxSpeed:1,minSpeed:0,distance:130,lineWidth:.2,range:160,eventElem:null};var l=s.prototype={version:"1.1.0",init:function(){this.set.num>0&&(this.set.range>0&&(n.isElem(this.set.eventElem)||this.set.eventElem===document||(this.set.eventElem=this.c),this.posX=h()*this.cw,this.posY=h()*this.ch,this.event()),this.createDots(),this.draw(),this.resize())},createDots:function(){for(var t,e=this.cw,s=this.ch,i=this.set,o=this.color,h=n.limitRandom,r=n.calcSpeed,a=i.maxSpeed,l=i.minSpeed,c=i.maxR,f=i.minR,m=n.pInt(n.scaleValue(i.num,e)),u=[];m--;)t=h(c,f),u.push({x:h(e-t,t),y:h(s-t,t),r:t,vx:r(a,l),vy:r(a,l),color:o()});this.dots=u},draw:function(){var t=this.set;if(!(t.num<=0)){var e=this.cw,s=this.ch,i=this.cxt,n=this.paused;i.clearRect(0,0,e,s),i.lineWidth=t.lineWidth,i.globalAlpha=t.opacity,this.dots.forEach(function(t){var o=t.r;if(i.save(),i.beginPath(),i.arc(t.x,t.y,o,0,a),i.fillStyle=t.color,i.fill(),i.restore(),!n){t.x+=t.vx,t.y+=t.vy;var h=t.x,r=t.y;(h+o>=e||h-o<=0)&&(t.vx*=-1),(r+o>=s||r-o<=0)&&(t.vy*=-1)}}),t.range>0&&this.connectDots(),this.requestAnimationFrame()}},connectDots:function(){var t=this.cxt,e=this.set,s=e.distance,i=this.posX,n=this.posY,o=e.range,h=this.dots,a=h.length;h.forEach(function(e,l){for(var c=e.x,f=e.y,m=e.color;++l<a;){var u=h[l],v=u.x,p=u.y;r(c-v)<=s&&r(f-p)<=s&&(r(c-i)<=o&&r(f-n)<=o||r(v-i)<=o&&r(p-n)<=o)&&(t.save(),t.beginPath(),t.moveTo(c,f),t.lineTo(v,p),t.strokeStyle=m,t.stroke(),t.restore())}})},getElemOffset:function(){return this.elemOffset=this.elemOffset?n.offset(this.set.eventElem):null},event:function(){this.set.eventElem!==document&&(this.elemOffset=!0),this.moveHandler=function(t){this.posX=t.pageX,this.posY=t.pageY,this.getElemOffset()&&(e(this.set.eventElem,"position","fixed")&&(this.posX=t.clientX,this.posY=t.clientY),this.posX-=this.elemOffset.left,this.posY-=this.elemOffset.top)}.bind(this),i.call(this)}};t.extend(l),n.modifyPrototype(l,"pause, open",i),n.modifyPrototype(l,"resize",function(t,e){this.set.num>0&&this.set.range>0&&(this.posX*=t,this.posY*=e,this.getElemOffset())}),t.particle=l.constructor=s}(Particleground);