function drewps() { this.locate = function(c,t) { if(c.tagName == "CANVAS") { this.mainframe = c; this.ctx = this.mainframe.getContext("2d"); this.pts = []; t = this; c.onmouseenter = function(e){t.initX = e.offsetX;t.initY = e.offsetY;t.origins=[];for(var i=0; i o.mainframe.width-co) && o.pts[i].lr){o.pts[i].lr = o.inv(o.pts[i].lr);} if((o.pts[i].y > o.mainframe.height-co) && o.pts[i].tb){o.pts[i].tb = o.inv(o.pts[i].tb);} if(o.pts[i].y < co && !o.pts[i].tb){o.pts[i].tb = o.inv(o.pts[i].tb);} o.pts[i].x += ((o.pts[i].lr) ? o.pts[i].speed : -o.pts[i].speed); o.pts[i].y += ((o.pts[i].tb) ? o.pts[i].speed : -o.pts[i].speed); } if(f && typeof f == "function"){f(o.pts);}; o.set(); o.liner(); },1); }, this.add = function(c,s,o) { this.ctx.fillStyle = (this.backgroundcolor === undefined) ? "black" : this.backgroundcolor; this.ctx.fillRect(0,0,this.mainframe.width,this.mainframe.height); for(var i=0; i= 0.5){coe=0.5;} if(coe < 0.1*0.1){continue;} this.ctx.beginPath(); this.ctx.strokeStyle = this.linecolor; this.ctx.lineWidth = coe; this.ctx.moveTo(this.mx,this.my); this.ctx.lineTo(this.pts[i].x,this.pts[i].y); this.ctx.stroke(); } else if(this.autoline == "a-line") { for(var q=0; q= 0.5){coe=0.5;} if(coe < 0.1*0.1){continue;} this.ctx.beginPath(); this.ctx.strokeStyle = this.linecolor; this.ctx.lineWidth = coe; this.ctx.moveTo(this.pts[i].x,this.pts[i].y); this.ctx.lineTo(this.pts[q].x,this.pts[q].y); this.ctx.stroke(); } } }}, this.sniff = function() { var elements = document.querySelectorAll("*"); var frames = []; var useless = 0; var dummy = document.createElement("canvas"); for(var i=0; i= 0.5;}, this.inv = function(b){return !b;}, this.rn = function(mi, ma){var min=mi,max=ma;return Math.random()*(max - min)+min;}, this.ld = function(point1,point2){var xs=0;varys=0;xs=point2.x-point1.x;xs=xs*xs;ys=point2.y-point1.y;ys=ys*ys;return Math.sqrt(xs+ys);}, this.h2rgba = function(hex, alpha){var r=parseInt(hex.slice(1,3),16),g=parseInt(hex.slice(3,5),16),b=parseInt(hex.slice(5,7),16);return "rgba("+r+", "+g+", "+b+", "+alpha+")";} this.sense = 20, this.moving = false, this.floater = false, this.dblur = false, this.rng = false, this.callback = null }