function randomInt(a,b){return Math.floor(Math.random()*(b-a+1)+a)}var canvas=document.createElement("canvas"),ctx=canvas.getContext("2d");document.getElementById("canvasContainer").appendChild(canvas);var width=window.innerWidth,height=window.innerHeight;canvas.width=width,canvas.height=height;function clearCanvas(){ctx.fillStyle="#000",ctx.fillRect(0,0,width,height)}clearCanvas();for(var node,t=0,colors=["#4f91f9","#a7f94f","#f94f4f","#f9f74f","#8930ff","#fc4edf","#ff9c51"],nodeSize=3.5,speed=1.5,nodeAmount=150,nodes=[],lineWidth=1,nodePositionArray=[],drawLineThreshold=170,i=0;ithis.y||this.y>height-2*nodeSize)&&(this.speedY=-this.speedY),(1>this.x||this.x>width-2*nodeSize)&&(this.speedX=-this.speedX),nodePositionArray[this.id]=[this.x,this.y,this.color]},this.draw=function(){ctx.fillStyle=this.color,circle(this.x,this.y,nodeSize),ctx.fill()}}function drawLines(){for(var a=0;a