689.js 22 KB

12
  1. (globalThis.webpackChunksakurairo_scripts=globalThis.webpackChunksakurairo_scripts||[]).push([[689],{689:()=>{var e=function(e,i){var s=document.querySelector("#"+e+" > .particles-js-canvas-el");this.pJS={canvas:{el:s,w:s.offsetWidth,h:s.offsetHeight},particles:{number:{value:400,density:{enable:!0,value_area:800}},color:{value:"#fff"},shape:{type:"circle",stroke:{width:0,color:"#ff0000"},polygon:{nb_sides:5},image:{src:"",width:100,height:100}},opacity:{value:1,random:!1,anim:{enable:!1,speed:2,opacity_min:0,sync:!1}},size:{value:20,random:!1,anim:{enable:!1,speed:20,size_min:0,sync:!1}},line_linked:{enable:!0,distance:100,color:"#fff",opacity:1,width:1},move:{enable:!0,speed:2,direction:"none",random:!1,straight:!1,out_mode:"out",bounce:!1,attract:{enable:!1,rotateX:3e3,rotateY:3e3}},array:[]},interactivity:{detect_on:"canvas",events:{onhover:{enable:!0,mode:"grab"},onclick:{enable:!0,mode:"push"},resize:!0},modes:{grab:{distance:100,line_linked:{opacity:1}},bubble:{distance:200,size:80,duration:.4},repulse:{distance:200,duration:.4},push:{particles_nb:4},remove:{particles_nb:2}},mouse:{}},retina_detect:!1,fn:{interact:{},modes:{},vendors:{}},tmp:{}};var n=this.pJS;i&&Object.deepExtend(n,i),n.tmp.obj={size_value:n.particles.size.value,size_anim_speed:n.particles.size.anim.speed,move_speed:n.particles.move.speed,line_linked_distance:n.particles.line_linked.distance,line_linked_width:n.particles.line_linked.width,mode_grab_distance:n.interactivity.modes.grab.distance,mode_bubble_distance:n.interactivity.modes.bubble.distance,mode_bubble_size:n.interactivity.modes.bubble.size,mode_repulse_distance:n.interactivity.modes.repulse.distance},n.fn.retinaInit=function(){n.retina_detect&&window.devicePixelRatio>1?(n.canvas.pxratio=window.devicePixelRatio,n.tmp.retina=!0):(n.canvas.pxratio=1,n.tmp.retina=!1),n.canvas.w=n.canvas.el.offsetWidth*n.canvas.pxratio,n.canvas.h=n.canvas.el.offsetHeight*n.canvas.pxratio,n.particles.size.value=n.tmp.obj.size_value*n.canvas.pxratio,n.particles.size.anim.speed=n.tmp.obj.size_anim_speed*n.canvas.pxratio,n.particles.move.speed=n.tmp.obj.move_speed*n.canvas.pxratio,n.particles.line_linked.distance=n.tmp.obj.line_linked_distance*n.canvas.pxratio,n.interactivity.modes.grab.distance=n.tmp.obj.mode_grab_distance*n.canvas.pxratio,n.interactivity.modes.bubble.distance=n.tmp.obj.mode_bubble_distance*n.canvas.pxratio,n.particles.line_linked.width=n.tmp.obj.line_linked_width*n.canvas.pxratio,n.interactivity.modes.bubble.size=n.tmp.obj.mode_bubble_size*n.canvas.pxratio,n.interactivity.modes.repulse.distance=n.tmp.obj.mode_repulse_distance*n.canvas.pxratio},n.fn.canvasInit=function(){n.canvas.ctx=n.canvas.el.getContext("2d")},n.fn.canvasSize=function(){n.canvas.el.width=n.canvas.w,n.canvas.el.height=n.canvas.h,n&&n.interactivity.events.resize&&window.addEventListener("resize",(function(){n.canvas.w=n.canvas.el.offsetWidth,n.canvas.h=n.canvas.el.offsetHeight,n.tmp.retina&&(n.canvas.w*=n.canvas.pxratio,n.canvas.h*=n.canvas.pxratio),n.canvas.el.width=n.canvas.w,n.canvas.el.height=n.canvas.h,n.particles.move.enable||(n.fn.particlesEmpty(),n.fn.particlesCreate(),n.fn.particlesDraw(),n.fn.vendors.densityAutoParticles()),n.fn.vendors.densityAutoParticles()}))},n.fn.canvasPaint=function(){n.canvas.ctx.fillRect(0,0,n.canvas.w,n.canvas.h)},n.fn.canvasClear=function(){n.canvas.ctx.clearRect(0,0,n.canvas.w,n.canvas.h)},n.fn.particle=function(e,a,i){if(this.radius=(n.particles.size.random?Math.random():1)*n.particles.size.value,n.particles.size.anim.enable&&(this.size_status=!1,this.vs=n.particles.size.anim.speed/100,n.particles.size.anim.sync||(this.vs=this.vs*Math.random())),this.x=i?i.x:Math.random()*n.canvas.w,this.y=i?i.y:Math.random()*n.canvas.h,this.x>n.canvas.w-2*this.radius?this.x=this.x-this.radius:this.x<2*this.radius&&(this.x=this.x+this.radius),this.y>n.canvas.h-2*this.radius?this.y=this.y-this.radius:this.y<2*this.radius&&(this.y=this.y+this.radius),n.particles.move.bounce&&n.fn.vendors.checkOverlap(this,i),this.color={},"object"==typeof e.value)if(e.value instanceof Array){var s=e.value[Math.floor(Math.random()*n.particles.color.value.length)];this.color.rgb=t(s)}else null!=e.value.r&&null!=e.value.g&&null!=e.value.b&&(this.color.rgb={r:e.value.r,g:e.value.g,b:e.value.b}),null!=e.value.h&&null!=e.value.s&&null!=e.value.l&&(this.color.hsl={h:e.value.h,s:e.value.s,l:e.value.l});else"random"==e.value?this.color.rgb={r:Math.floor(256*Math.random())+0,g:Math.floor(256*Math.random())+0,b:Math.floor(256*Math.random())+0}:"string"==typeof e.value&&(this.color=e,this.color.rgb=t(this.color.value));this.opacity=(n.particles.opacity.random?Math.random():1)*n.particles.opacity.value,n.particles.opacity.anim.enable&&(this.opacity_status=!1,this.vo=n.particles.opacity.anim.speed/100,n.particles.opacity.anim.sync||(this.vo=this.vo*Math.random()));var r={};switch(n.particles.move.direction){case"top":r={x:0,y:-1};break;case"top-right":r={x:.5,y:-.5};break;case"right":r={x:1,y:-0};break;case"bottom-right":r={x:.5,y:.5};break;case"bottom":r={x:0,y:1};break;case"bottom-left":r={x:-.5,y:1};break;case"left":r={x:-1,y:0};break;case"top-left":r={x:-.5,y:-.5};break;default:r={x:0,y:0}}n.particles.move.straight?(this.vx=r.x,this.vy=r.y,n.particles.move.random&&(this.vx=this.vx*Math.random(),this.vy=this.vy*Math.random())):(this.vx=r.x+Math.random()-.5,this.vy=r.y+Math.random()-.5),this.vx_i=this.vx,this.vy_i=this.vy;var c=n.particles.shape.type;if("object"==typeof c){if(c instanceof Array){var o=c[Math.floor(Math.random()*c.length)];this.shape=o}}else this.shape=c;if("image"==this.shape){var l=n.particles.shape;this.img={src:l.image.src,ratio:l.image.width/l.image.height},this.img.ratio||(this.img.ratio=1),"svg"==n.tmp.img_type&&null!=n.tmp.source_svg&&(n.fn.vendors.createSvgImg(this),n.tmp.pushing&&(this.img.loaded=!1))}},n.fn.particle.prototype.draw=function(){var e=this;if(null!=e.radius_bubble)var t=e.radius_bubble;else t=e.radius;if(null!=e.opacity_bubble)var a=e.opacity_bubble;else a=e.opacity;if(e.color.rgb)var i="rgba("+e.color.rgb.r+","+e.color.rgb.g+","+e.color.rgb.b+","+a+")";else i="hsla("+e.color.hsl.h+","+e.color.hsl.s+"%,"+e.color.hsl.l+"%,"+a+")";switch(n.canvas.ctx.fillStyle=i,n.canvas.ctx.beginPath(),e.shape){case"circle":n.canvas.ctx.arc(e.x,e.y,t,0,2*Math.PI,!1);break;case"edge":n.canvas.ctx.rect(e.x-t,e.y-t,2*t,2*t);break;case"triangle":n.fn.vendors.drawShape(n.canvas.ctx,e.x-t,e.y+t/1.66,2*t,3,2);break;case"polygon":n.fn.vendors.drawShape(n.canvas.ctx,e.x-t/(n.particles.shape.polygon.nb_sides/3.5),e.y-t/.76,2.66*t/(n.particles.shape.polygon.nb_sides/3),n.particles.shape.polygon.nb_sides,1);break;case"star":n.fn.vendors.drawShape(n.canvas.ctx,e.x-2*t/(n.particles.shape.polygon.nb_sides/4),e.y-t/1.52,2*t*2.66/(n.particles.shape.polygon.nb_sides/3),n.particles.shape.polygon.nb_sides,2);break;case"image":if("svg"==n.tmp.img_type)var s=e.img.obj;else s=n.tmp.img_obj;s&&n.canvas.ctx.drawImage(s,e.x-t,e.y-t,2*t,2*t/e.img.ratio)}n.canvas.ctx.closePath(),n.particles.shape.stroke.width>0&&(n.canvas.ctx.strokeStyle=n.particles.shape.stroke.color,n.canvas.ctx.lineWidth=n.particles.shape.stroke.width,n.canvas.ctx.stroke()),n.canvas.ctx.fill()},n.fn.particlesCreate=function(){for(var e=0;e<n.particles.number.value;e++)n.particles.array.push(new n.fn.particle(n.particles.color,n.particles.opacity.value))},n.fn.particlesUpdate=function(){for(var e=0;e<n.particles.array.length;e++){var t=n.particles.array[e];if(n.particles.move.enable){var i=n.particles.move.speed/2;t.x+=t.vx*i,t.y+=t.vy*i}if(n.particles.opacity.anim.enable&&(1==t.opacity_status?(t.opacity>=n.particles.opacity.value&&(t.opacity_status=!1),t.opacity+=t.vo):(t.opacity<=n.particles.opacity.anim.opacity_min&&(t.opacity_status=!0),t.opacity-=t.vo),t.opacity<0&&(t.opacity=0)),n.particles.size.anim.enable&&(1==t.size_status?(t.radius>=n.particles.size.value&&(t.size_status=!1),t.radius+=t.vs):(t.radius<=n.particles.size.anim.size_min&&(t.size_status=!0),t.radius-=t.vs),t.radius<0&&(t.radius=0)),"bounce"==n.particles.move.out_mode)var s={x_left:t.radius,x_right:n.canvas.w,y_top:t.radius,y_bottom:n.canvas.h};else s={x_left:-t.radius,x_right:n.canvas.w+t.radius,y_top:-t.radius,y_bottom:n.canvas.h+t.radius};if(t.x-t.radius>n.canvas.w?(t.x=s.x_left,t.y=Math.random()*n.canvas.h):t.x+t.radius<0&&(t.x=s.x_right,t.y=Math.random()*n.canvas.h),t.y-t.radius>n.canvas.h?(t.y=s.y_top,t.x=Math.random()*n.canvas.w):t.y+t.radius<0&&(t.y=s.y_bottom,t.x=Math.random()*n.canvas.w),"bounce"===n.particles.move.out_mode)(t.x+t.radius>n.canvas.w||t.x-t.radius<0)&&(t.vx=-t.vx),(t.y+t.radius>n.canvas.h||t.y-t.radius<0)&&(t.vy=-t.vy);if(a("grab",n.interactivity.events.onhover.mode)&&n.fn.modes.grabParticle(t),(a("bubble",n.interactivity.events.onhover.mode)||a("bubble",n.interactivity.events.onclick.mode))&&n.fn.modes.bubbleParticle(t),(a("repulse",n.interactivity.events.onhover.mode)||a("repulse",n.interactivity.events.onclick.mode))&&n.fn.modes.repulseParticle(t),n.particles.line_linked.enable||n.particles.move.attract.enable)for(var r=e+1;r<n.particles.array.length;r++){var c=n.particles.array[r];n.particles.line_linked.enable&&n.fn.interact.linkParticles(t,c),n.particles.move.attract.enable&&n.fn.interact.attractParticles(t,c),n.particles.move.bounce&&n.fn.interact.bounceParticles(t,c)}}},n.fn.particlesDraw=function(){n.canvas.ctx.clearRect(0,0,n.canvas.w,n.canvas.h),n.fn.particlesUpdate();for(var e=0;e<n.particles.array.length;e++){n.particles.array[e].draw()}},n.fn.particlesEmpty=function(){n.particles.array=[]},n.fn.particlesRefresh=function(){cancelRequestAnimFrame(n.fn.checkAnimFrame),cancelRequestAnimFrame(n.fn.drawAnimFrame),n.tmp.source_svg=void 0,n.tmp.img_obj=void 0,n.tmp.count_svg=0,n.fn.particlesEmpty(),n.fn.canvasClear(),n.fn.vendors.start()},n.fn.interact.linkParticles=function(e,t){var a=e.x-t.x,i=e.y-t.y,s=Math.sqrt(a*a+i*i);if(s<=n.particles.line_linked.distance){var r=n.particles.line_linked.opacity-s/(1/n.particles.line_linked.opacity)/n.particles.line_linked.distance;if(r>0){var c=n.particles.line_linked.color_rgb_line;n.canvas.ctx.strokeStyle="rgba("+c.r+","+c.g+","+c.b+","+r+")",n.canvas.ctx.lineWidth=n.particles.line_linked.width,n.canvas.ctx.beginPath(),n.canvas.ctx.moveTo(e.x,e.y),n.canvas.ctx.lineTo(t.x,t.y),n.canvas.ctx.stroke(),n.canvas.ctx.closePath()}}},n.fn.interact.attractParticles=function(e,t){var a=e.x-t.x,i=e.y-t.y;if(Math.sqrt(a*a+i*i)<=n.particles.line_linked.distance){var s=a/(1e3*n.particles.move.attract.rotateX),r=i/(1e3*n.particles.move.attract.rotateY);e.vx-=s,e.vy-=r,t.vx+=s,t.vy+=r}},n.fn.interact.bounceParticles=function(e,t){var a=e.x-t.x,i=e.y-t.y;Math.sqrt(a*a+i*i)<=e.radius+t.radius&&(e.vx=-e.vx,e.vy=-e.vy,t.vx=-t.vx,t.vy=-t.vy)},n.fn.modes.pushParticles=function(e,t){n.tmp.pushing=!0;for(var a=0;a<e;a++)n.particles.array.push(new n.fn.particle(n.particles.color,n.particles.opacity.value,{x:t?t.pos_x:Math.random()*n.canvas.w,y:t?t.pos_y:Math.random()*n.canvas.h})),a==e-1&&(n.particles.move.enable||n.fn.particlesDraw(),n.tmp.pushing=!1)},n.fn.modes.removeParticles=function(e){n.particles.array.splice(0,e),n.particles.move.enable||n.fn.particlesDraw()},n.fn.modes.bubbleParticle=function(e){if(n.interactivity.events.onhover.enable&&a("bubble",n.interactivity.events.onhover.mode)){var t=e.x-n.interactivity.mouse.pos_x,i=e.y-n.interactivity.mouse.pos_y,s=1-(v=Math.sqrt(t*t+i*i))/n.interactivity.modes.bubble.distance;function r(){e.opacity_bubble=e.opacity,e.radius_bubble=e.radius}if(v<=n.interactivity.modes.bubble.distance){if(s>=0&&"mousemove"==n.interactivity.status){if(n.interactivity.modes.bubble.size!=n.particles.size.value)if(n.interactivity.modes.bubble.size>n.particles.size.value){(o=e.radius+n.interactivity.modes.bubble.size*s)>=0&&(e.radius_bubble=o)}else{var c=e.radius-n.interactivity.modes.bubble.size,o=e.radius-c*s;e.radius_bubble=o>0?o:0}var l;if(n.interactivity.modes.bubble.opacity!=n.particles.opacity.value)if(n.interactivity.modes.bubble.opacity>n.particles.opacity.value)(l=n.interactivity.modes.bubble.opacity*s)>e.opacity&&l<=n.interactivity.modes.bubble.opacity&&(e.opacity_bubble=l);else(l=e.opacity-(n.particles.opacity.value-n.interactivity.modes.bubble.opacity)*s)<e.opacity&&l>=n.interactivity.modes.bubble.opacity&&(e.opacity_bubble=l)}}else r();"mouseleave"==n.interactivity.status&&r()}else if(n.interactivity.events.onclick.enable&&a("bubble",n.interactivity.events.onclick.mode)){if(n.tmp.bubble_clicking){t=e.x-n.interactivity.mouse.click_pos_x,i=e.y-n.interactivity.mouse.click_pos_y;var v=Math.sqrt(t*t+i*i),p=((new Date).getTime()-n.interactivity.mouse.click_time)/1e3;p>n.interactivity.modes.bubble.duration&&(n.tmp.bubble_duration_end=!0),p>2*n.interactivity.modes.bubble.duration&&(n.tmp.bubble_clicking=!1,n.tmp.bubble_duration_end=!1)}function d(t,a,i,s,r){if(t!=a)if(n.tmp.bubble_duration_end)null!=i&&(o=t+(t-(s-p*(s-t)/n.interactivity.modes.bubble.duration)),"size"==r&&(e.radius_bubble=o),"opacity"==r&&(e.opacity_bubble=o));else if(v<=n.interactivity.modes.bubble.distance){if(null!=i)var c=i;else c=s;if(c!=t){var o=s-p*(s-t)/n.interactivity.modes.bubble.duration;"size"==r&&(e.radius_bubble=o),"opacity"==r&&(e.opacity_bubble=o)}}else"size"==r&&(e.radius_bubble=void 0),"opacity"==r&&(e.opacity_bubble=void 0)}n.tmp.bubble_clicking&&(d(n.interactivity.modes.bubble.size,n.particles.size.value,e.radius_bubble,e.radius,"size"),d(n.interactivity.modes.bubble.opacity,n.particles.opacity.value,e.opacity_bubble,e.opacity,"opacity"))}},n.fn.modes.repulseParticle=function(e){if(n.interactivity.events.onhover.enable&&a("repulse",n.interactivity.events.onhover.mode)&&"mousemove"==n.interactivity.status){var t=e.x-n.interactivity.mouse.pos_x,i=e.y-n.interactivity.mouse.pos_y,s=Math.sqrt(t*t+i*i),r={x:t/s,y:i/s},c=n.interactivity.modes.repulse.distance,o=(u=1/c*(-1*Math.pow(s/c,2)+1)*c*100,b=0,y=50,Math.min(Math.max(u,b),y)),l={x:e.x+r.x*o,y:e.y+r.y*o};"bounce"==n.particles.move.out_mode?(l.x-e.radius>0&&l.x+e.radius<n.canvas.w&&(e.x=l.x),l.y-e.radius>0&&l.y+e.radius<n.canvas.h&&(e.y=l.y)):(e.x=l.x,e.y=l.y)}else if(n.interactivity.events.onclick.enable&&a("repulse",n.interactivity.events.onclick.mode))if(n.tmp.repulse_finish||(n.tmp.repulse_count++,n.tmp.repulse_count==n.particles.array.length&&(n.tmp.repulse_finish=!0)),n.tmp.repulse_clicking){c=Math.pow(n.interactivity.modes.repulse.distance/6,3);var v=n.interactivity.mouse.click_pos_x-e.x,p=n.interactivity.mouse.click_pos_y-e.y,d=v*v+p*p,m=-c/d*1;d<=c&&function(){var t=Math.atan2(p,v);if(e.vx=m*Math.cos(t),e.vy=m*Math.sin(t),"bounce"==n.particles.move.out_mode){var a={x:e.x+e.vx,y:e.y+e.vy};(a.x+e.radius>n.canvas.w||a.x-e.radius<0)&&(e.vx=-e.vx),(a.y+e.radius>n.canvas.h||a.y-e.radius<0)&&(e.vy=-e.vy)}}()}else 0==n.tmp.repulse_clicking&&(e.vx=e.vx_i,e.vy=e.vy_i);var u,b,y},n.fn.modes.grabParticle=function(e){if(n.interactivity.events.onhover.enable&&"mousemove"==n.interactivity.status){var t=e.x-n.interactivity.mouse.pos_x,a=e.y-n.interactivity.mouse.pos_y,i=Math.sqrt(t*t+a*a);if(i<=n.interactivity.modes.grab.distance){var s=n.interactivity.modes.grab.line_linked.opacity-i/(1/n.interactivity.modes.grab.line_linked.opacity)/n.interactivity.modes.grab.distance;if(s>0){var r=n.particles.line_linked.color_rgb_line;n.canvas.ctx.strokeStyle="rgba("+r.r+","+r.g+","+r.b+","+s+")",n.canvas.ctx.lineWidth=n.particles.line_linked.width,n.canvas.ctx.beginPath(),n.canvas.ctx.moveTo(e.x,e.y),n.canvas.ctx.lineTo(n.interactivity.mouse.pos_x,n.interactivity.mouse.pos_y),n.canvas.ctx.stroke(),n.canvas.ctx.closePath()}}}},n.fn.vendors.eventsListeners=function(){"window"==n.interactivity.detect_on?n.interactivity.el=window:n.interactivity.el=n.canvas.el,(n.interactivity.events.onhover.enable||n.interactivity.events.onclick.enable)&&(n.interactivity.el.addEventListener("mousemove",(function(e){if(n.interactivity.el==window)var t=e.clientX,a=e.clientY;else t=e.offsetX||e.clientX,a=e.offsetY||e.clientY;n.interactivity.mouse.pos_x=t,n.interactivity.mouse.pos_y=a,n.tmp.retina&&(n.interactivity.mouse.pos_x*=n.canvas.pxratio,n.interactivity.mouse.pos_y*=n.canvas.pxratio),n.interactivity.status="mousemove"})),n.interactivity.el.addEventListener("mouseleave",(function(e){n.interactivity.mouse.pos_x=null,n.interactivity.mouse.pos_y=null,n.interactivity.status="mouseleave"}))),n.interactivity.events.onclick.enable&&n.interactivity.el.addEventListener("click",(function(){if(n.interactivity.mouse.click_pos_x=n.interactivity.mouse.pos_x,n.interactivity.mouse.click_pos_y=n.interactivity.mouse.pos_y,n.interactivity.mouse.click_time=(new Date).getTime(),n.interactivity.events.onclick.enable)switch(n.interactivity.events.onclick.mode){case"push":n.particles.move.enable||1==n.interactivity.modes.push.particles_nb?n.fn.modes.pushParticles(n.interactivity.modes.push.particles_nb,n.interactivity.mouse):n.interactivity.modes.push.particles_nb>1&&n.fn.modes.pushParticles(n.interactivity.modes.push.particles_nb);break;case"remove":n.fn.modes.removeParticles(n.interactivity.modes.remove.particles_nb);break;case"bubble":n.tmp.bubble_clicking=!0;break;case"repulse":n.tmp.repulse_clicking=!0,n.tmp.repulse_count=0,n.tmp.repulse_finish=!1,setTimeout((function(){n.tmp.repulse_clicking=!1}),1e3*n.interactivity.modes.repulse.duration)}}))},n.fn.vendors.densityAutoParticles=function(){if(n.particles.number.density.enable){var e=n.canvas.el.width*n.canvas.el.height/1e3;n.tmp.retina&&(e/=2*n.canvas.pxratio);var t=e*n.particles.number.value/n.particles.number.density.value_area,a=n.particles.array.length-t;a<0?n.fn.modes.pushParticles(Math.abs(a)):n.fn.modes.removeParticles(a)}},n.fn.vendors.checkOverlap=function(e,t){for(var a=0;a<n.particles.array.length;a++){var i=n.particles.array[a],s=e.x-i.x,r=e.y-i.y;Math.sqrt(s*s+r*r)<=e.radius+i.radius&&(e.x=t?t.x:Math.random()*n.canvas.w,e.y=t?t.y:Math.random()*n.canvas.h,n.fn.vendors.checkOverlap(e))}},n.fn.vendors.createSvgImg=function(e){var t=n.tmp.source_svg.replace(/#([0-9A-F]{3,6})/gi,(function(t,a,i,s){if(e.color.rgb)var n="rgba("+e.color.rgb.r+","+e.color.rgb.g+","+e.color.rgb.b+","+e.opacity+")";else n="hsla("+e.color.hsl.h+","+e.color.hsl.s+"%,"+e.color.hsl.l+"%,"+e.opacity+")";return n})),a=new Blob([t],{type:"image/svg+xml;charset=utf-8"}),i=window.URL||window.webkitURL||window,s=i.createObjectURL(a),r=new Image;r.addEventListener("load",(function(){e.img.obj=r,e.img.loaded=!0,i.revokeObjectURL(s),n.tmp.count_svg++})),r.src=s},n.fn.vendors.destroypJS=function(){cancelAnimationFrame(n.fn.drawAnimFrame),s.remove(),pJSDom=null},n.fn.vendors.drawShape=function(e,t,a,i,s,n){var r=s*n,c=s/n,o=180*(c-2)/c,l=Math.PI-Math.PI*o/180;e.save(),e.beginPath(),e.translate(t,a),e.moveTo(0,0);for(var v=0;v<r;v++)e.lineTo(i,0),e.translate(i,0),e.rotate(l);e.fill(),e.restore()},n.fn.vendors.exportImg=function(){window.open(n.canvas.el.toDataURL("image/png"),"_blank")},n.fn.vendors.loadImg=function(e){if(n.tmp.img_error=void 0,""!=n.particles.shape.image.src)if("svg"==e){var t=new XMLHttpRequest;t.open("GET",n.particles.shape.image.src),t.onreadystatechange=function(e){4==t.readyState&&(200==t.status?(n.tmp.source_svg=e.currentTarget.response,n.fn.vendors.checkBeforeDraw()):(console.log("Error pJS - Image not found"),n.tmp.img_error=!0))},t.send()}else{var a=new Image;a.addEventListener("load",(function(){n.tmp.img_obj=a,n.fn.vendors.checkBeforeDraw()})),a.src=n.particles.shape.image.src}else console.log("Error pJS - No image.src"),n.tmp.img_error=!0},n.fn.vendors.draw=function(){"image"==n.particles.shape.type?"svg"==n.tmp.img_type?n.tmp.count_svg>=n.particles.number.value?(n.fn.particlesDraw(),n.particles.move.enable?n.fn.drawAnimFrame=requestAnimFrame(n.fn.vendors.draw):cancelRequestAnimFrame(n.fn.drawAnimFrame)):n.tmp.img_error||(n.fn.drawAnimFrame=requestAnimFrame(n.fn.vendors.draw)):null!=n.tmp.img_obj?(n.fn.particlesDraw(),n.particles.move.enable?n.fn.drawAnimFrame=requestAnimFrame(n.fn.vendors.draw):cancelRequestAnimFrame(n.fn.drawAnimFrame)):n.tmp.img_error||(n.fn.drawAnimFrame=requestAnimFrame(n.fn.vendors.draw)):(n.fn.particlesDraw(),n.particles.move.enable?n.fn.drawAnimFrame=requestAnimFrame(n.fn.vendors.draw):cancelRequestAnimFrame(n.fn.drawAnimFrame))},n.fn.vendors.checkBeforeDraw=function(){"image"==n.particles.shape.type?"svg"==n.tmp.img_type&&null==n.tmp.source_svg?n.tmp.checkAnimFrame=requestAnimFrame(check):(cancelRequestAnimFrame(n.tmp.checkAnimFrame),n.tmp.img_error||(n.fn.vendors.init(),n.fn.vendors.draw())):(n.fn.vendors.init(),n.fn.vendors.draw())},n.fn.vendors.init=function(){n.fn.retinaInit(),n.fn.canvasInit(),n.fn.canvasSize(),n.fn.canvasPaint(),n.fn.particlesCreate(),n.fn.vendors.densityAutoParticles(),n.particles.line_linked.color_rgb_line=t(n.particles.line_linked.color)},n.fn.vendors.start=function(){a("image",n.particles.shape.type)?(n.tmp.img_type=n.particles.shape.image.src.substr(n.particles.shape.image.src.length-3),n.fn.vendors.loadImg(n.tmp.img_type)):n.fn.vendors.checkBeforeDraw()},n.fn.vendors.eventsListeners(),n.fn.vendors.start()};function t(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,a,i){return t+t+a+a+i+i}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function a(e,t){return t.indexOf(e)>-1}Object.deepExtend=function(e,t){for(var a in t)t[a]&&t[a].constructor&&t[a].constructor===Object?(e[a]=e[a]||{},arguments.callee(e[a],t[a])):e[a]=t[a];return e},window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)},window.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout,window.pJSDom=[],window.particlesJS=function(t,a){"string"!=typeof t&&(a=t,t="particles-js"),t||(t="particles-js");var i=document.getElementById(t),s="particles-js-canvas-el",n=i.getElementsByClassName(s);if(n.length)for(;n.length>0;)i.removeChild(n[0]);var r=document.createElement("canvas");r.className=s,r.style.width="100%",r.style.height="100%",null!=document.getElementById(t).appendChild(r)&&pJSDom.push(new e(t,a))},window.particlesJS.load=function(e,t,a){var i=new XMLHttpRequest;i.open("GET",t),i.onreadystatechange=function(t){if(4==i.readyState)if(200==i.status){var s=JSON.parse(t.currentTarget.response);window.particlesJS(e,s),a&&a()}else console.log("Error pJS - XMLHttpRequest status: "+i.status),console.log("Error pJS - File config not found")},i.send()}}}]);
  2. //# sourceMappingURL=689.js.map