text: (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{10:function(t,i,e){"use strict";e.r(i);var n=e(2),s=document.querySelector("canvas"),o=s.getContext("2d"),a={x:10,y:10},h=["#8be9fd","#50fa7b","#ffb86c","#ff79c6","#bd93f9","#ff5555","#f1fa8c"],c=0,r=0;s.addEventListener("mousemove",function(t){a.x=t.x,a.y=t.y}),s.addEventListener("click",function(){c=Object(n.a)(100,500)}),window.addEventListener("resize",function(){d()});var y=function(t,i,e,s,o){this.x=t,this.y=i,this.velocity=e,this.radius=s,this.color=o,this.radians=Math.random()*Math.PI*2,this.opacity=0;var a=Object(n.a)(50,120);this.distance={x:a,y:a},this.lastMouse={x:t,y:i}};y.prototype.draw=function(t){o.beginPath(),o.strokeStyle=this.color,o.lineWidth=this.radius,o.moveTo(t.x,t.y),o.lineTo(this.x,this.y),o.stroke(),o.closePath()},y.prototype.update=function(){var t={x:this.x,y:this.y};this.radians+=this.velocity,this.lastMouse.x+=.05*(a.x-this.lastMouse.x),this.lastMouse.y+=.05*(a.y-this.lastMouse.y),this.x=this.lastMouse.x+Math.cos(this.radians)*(this.distance.x+r),this.y=this.lastMouse.y+Math.sin(this.radians)*(this.distance.y+r),this.draw(t)};var u=[];function d(){s.width=window.innerWidth,s.height=window.innerHeight}d(),function(){a.x=.5*s.width,a.y=.5*s.height,u=[];for(var t=0;t<100;t++){var i=Object(n.a)(1,2),e=.5*s.width,o=.5*s.height,c=.01*Object(n.a)(3,8),r=h[Object(n.a)(0,h.length)];u.push(new y(e,o,c,i,r))}}(),function t(){o.fillStyle="rgba(40, 42, 54, 0.1)",o.fillRect(0,0,s.width,s.height),u.forEach(function(t){return t.update()}),0!==c&&r>c?c=0:c>0?r+=2:r>c?r-=1:r<0&&(r=0),requestAnimationFrame(t)}()},2:function(t,i,e){"use strict";function n(t,i){return Math.floor(Math.random()*(i-t+1)+t)}function s(t,i){return{x:t.x*Math.cos(i)-t.y*Math.sin(i),y:t.x*Math.sin(i)+t.y*Math.cos(i)}}function o(t,i){var e=t.velocity.x-i.velocity.x,n=t.velocity.y-i.velocity.y;if(e*(i.x-t.x)+n*(i.y-t.y)<0)return!1;var o=-Math.atan2(i.y-t.y,i.x-t.x),a=t.mass,h=i.mass,c=s(t.velocity,o),r=s(i.velocity,o),y={x:c.x*(a-h)/(a+h)+2*r.x*h/(a+h),y:c.y},u={x:r.x*(a-h)/(a+h)+2*c.x*h/(a+h),y:r.y},d=s(y,-o),x=s(u,-o);return t.velocity.x=d.x,t.velocity.y=d.y,i.velocity.x=x.x,i.velocity.y=x.y,!0}e.d(i,"a",function(){return n}),e.d(i,"b",function(){return o})}},[[10,0]]]);
  //# sourceMappingURL=canvas-circular-motion.js.map