whisper.cat stuff
This commit is contained in:
1
weboasis/js/canvas/circuits.js
Normal file
1
weboasis/js/canvas/circuits.js
Normal file
File diff suppressed because one or more lines are too long
1
weboasis/js/canvas/gradient.js
Normal file
1
weboasis/js/canvas/gradient.js
Normal file
@ -0,0 +1 @@
|
||||
var colors=[[44,145,223],[110,233,133],[110,233,225],[255,213,0],[255,0,86],[213,0,255]],step=0,colorIndices=[0,1,2,3],gradientSpeed=.004;function updateGradient(){var a=colors[colorIndices[0]],b=colors[colorIndices[1]],c=colors[colorIndices[2]],d=colors[colorIndices[3]],e=1-step,f=Math.round(e*a[0]+step*b[0]),g=Math.round(e*a[1]+step*b[1]),h=Math.round(e*a[2]+step*b[2]),i="#"+(f<<16|g<<8|h).toString(16),j=Math.round(e*c[0]+step*d[0]),k=Math.round(e*c[1]+step*d[1]),l=Math.round(e*c[2]+step*d[2]),m="#"+(j<<16|k<<8|l).toString(16);document.getElementById("canvasContainer").style.background="linear-gradient("+i+","+m+") no-repeat",step+=gradientSpeed,1<=step&&(step%=1,colorIndices[0]=colorIndices[1],colorIndices[2]=colorIndices[3],colorIndices[1]=(colorIndices[1]+Math.floor(1+Math.random()*(colors.length-1)))%colors.length,colorIndices[3]=(colorIndices[3]+Math.floor(1+Math.random()*(colors.length-1)))%colors.length)}setInterval(updateGradient,10);
|
34
weboasis/js/canvas/matrix.js
Normal file
34
weboasis/js/canvas/matrix.js
Normal file
@ -0,0 +1,34 @@
|
||||
function canvasSupport(n) {
|
||||
return !!n.getContext;
|
||||
}
|
||||
function canvasApp() {
|
||||
if (document.getElementById('myCanvas')) {
|
||||
var canvasElement = document.getElementById('myCanvas');
|
||||
canvasElement.parentNode.removeChild(canvasElement);
|
||||
}
|
||||
var Game_Interval;
|
||||
var winwidth = Math.max(window.screen.width, window.innerWidth);
|
||||
var matrixwidth = winwidth / 10;
|
||||
var nodecimal = Math.round(matrixwidth);
|
||||
var n = document.createElement('canvas');
|
||||
n.id = 'myCanvas';
|
||||
n.classList = 'background';
|
||||
document.getElementById('canvasContainer').appendChild(n);
|
||||
if (canvasSupport(n)) {
|
||||
var e = n.getContext('2d');
|
||||
var t = (n.width = window.innerWidth);
|
||||
var a = (n.height = window.innerHeight);
|
||||
var i = Array(nodecimal).join(0).split('');
|
||||
'undefined' != typeof Game_Interval && clearInterval(Game_interval), (Game_Interval = setInterval(o, 42));
|
||||
}
|
||||
function o() {
|
||||
(e.fillStyle = 'rgba(0,0,0,.07)'), e.fillRect(0, 0, t, a), (e.fillStyle = color), (e.font = '10px monospace');
|
||||
i.map(function(n, t) {
|
||||
(text = [...Array(1)].map(() => Math.random().toString(36)[2]).join('').toUpperCase()),
|
||||
(x = (t * 10) + 10),
|
||||
e.fillText(text, x, n),
|
||||
n > 100 + 3e4 * Math.random() ? (i[t] = 0) : (i[t] = n + 10);
|
||||
});
|
||||
}
|
||||
}
|
||||
canvasApp();
|
1
weboasis/js/canvas/matrix.min.js
vendored
Normal file
1
weboasis/js/canvas/matrix.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
var f=new FontFace("matrix_code_nfiregular","url(fonts/matrix_code_nfi-webfont.woff)");function canvasSupport(n){return!!n.getContext}function canvasApp(n){if(document.fonts.add(n),document.getElementById("myCanvas")){var t=document.getElementById("myCanvas");t.parentNode.removeChild(t)}var e,a=Math.max(window.screen.width,window.innerWidth)/10,o=Math.round(a),i=document.createElement("canvas");if(i.id="myCanvas",i.classList="background",document.getElementById("canvasContainer").appendChild(i),canvasSupport(i)){var r=i.getContext("2d"),d=i.width=window.innerWidth,c=i.height=window.innerHeight,l=Array(o).join(0).split("");void 0!==e&&clearInterval(Game_interval),e=setInterval((function(){r.fillStyle="rgba(0,0,0,.07)",r.fillRect(0,0,d,c),r.fillStyle=color,r.font="12px matrix_code_nfiregular",l.map((function(n,t){text=[...Array(1)].map((()=>Math.random().toString(36)[2])).join("").toLowerCase(),x=10*t+10,r.fillText(text,x,n),n>100+3e4*Math.random()?l[t]=0:l[t]=n+10}))}),42)}}f.load().then((function(n){canvasApp(n)}));
|
1
weboasis/js/canvas/matrix.min.js.old
Normal file
1
weboasis/js/canvas/matrix.min.js.old
Normal file
@ -0,0 +1 @@
|
||||
function canvasSupport(a){return!!a.getContext}function canvasApp(){function b(){j.fillStyle="rgba(0,0,0,.07)",j.fillRect(0,0,e,k),j.fillStyle=color,j.font="10px monospace",a.map(function(b,c){text=[...[,]].map(()=>Math.random().toString(36)[2]).join("").toLowerCase(),x=10*c+10,j.fillText(text,x,b),a[c]=b>100+3e4*Math.random()?0:b+10})}if(document.getElementById("myCanvas")){var c=document.getElementById("myCanvas");c.parentNode.removeChild(c)}var d,f=Math.max(window.screen.width,window.innerWidth),g=Math.round(f/10),h=document.createElement("canvas");if(h.id="myCanvas",h.classList="background",document.getElementById("canvasContainer").appendChild(h),canvasSupport(h)){var j=h.getContext("2d"),e=h.width=window.innerWidth,k=h.height=window.innerHeight,a=Array(g).join(0).split("");"undefined"!=typeof d&&clearInterval(Game_interval),d=setInterval(b,42)}}canvasApp();
|
1
weboasis/js/canvas/matrix.new.js
Normal file
1
weboasis/js/canvas/matrix.new.js
Normal file
@ -0,0 +1 @@
|
||||
var f=new FontFace("matrix_code_nfiregular","url(fonts/matrix_code_nfi-webfont.woff)");function canvasSupport(n){return!!n.getContext}function canvasApp(n){if(document.fonts.add(n),document.getElementById("myCanvas")){var t=document.getElementById("myCanvas");t.parentNode.removeChild(t)}var e,a=Math.max(window.screen.width,window.innerWidth)/10,o=Math.round(a),i=document.createElement("canvas");if(i.id="myCanvas",i.classList="background",document.getElementById("canvasContainer").appendChild(i),canvasSupport(i)){var r=i.getContext("2d"),d=i.width=window.innerWidth,c=i.height=window.innerHeight,l=Array(o).join(0).split("");void 0!==e&&clearInterval(Game_interval),e=setInterval((function(){r.fillStyle="rgba(0,0,0,.07)",r.fillRect(0,0,d,c),r.fillStyle=color,r.font="10px matrix_code_nfiregular",l.map((function(n,t){text=[...Array(1)].map((()=>Math.random().toString(36)[2])).join("").toLowerCase(),x=10*t+10,r.fillText(text,x,n),n>100+3e4*Math.random()?l[t]=0:l[t]=n+10}))}),42)}}f.load().then((function(n){canvasApp(n)}));
|
1
weboasis/js/canvas/nodes.js
Normal file
1
weboasis/js/canvas/nodes.js
Normal file
@ -0,0 +1 @@
|
||||
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;i<nodeAmount;i++)node=new Node(randomInt(0,width),randomInt(0,height),i),nodes.push(node);function circle(a,b,c){ctx.beginPath(),ctx.arc(a,b,c,0,2*Math.PI),ctx.closePath()}function line(a,b,c,d){ctx.lineWidth=lineWidth,ctx.beginPath(),ctx.moveTo(a,b),ctx.lineTo(c,d),ctx.stroke()}function distance(a,b,c,d){var e=b-a,f=d-c;return Math.sqrt(e*e+f*f)}function map_range(a,b,c,d,e){return d+(e-d)*(a-b)/(c-b)}function isEven(a){return a==parseFloat(a)?!(a%2):void 0}function hexToRgb(a){var b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);return b?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null}for(var i=0;i<nodes.length;i++)nodes[i].move(),nodes[i].draw();function loop(){clearCanvas(),drawLines();for(var a=0;a<nodes.length;a++)nodes[a].move(),nodes[a].draw();requestAnimationFrame(loop),t++}loop();function Node(a,b,c){this.x=a,this.y=b,this.id=c,isEven(c)?(this.speedX=randomInt(1,100)/100+speed,this.speedY=randomInt(1,100)/100+speed):(this.speedX=randomInt(1,100)/100-speed,this.speedY=randomInt(1,100)/100-speed),this.size=nodeSize,this.color=colors[Math.floor(Math.random()*colors.length)],this.move=function(){this.y+=this.speedY,this.x+=this.speedX,(1>this.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<nodePositionArray.length-1;a++)for(var b=nodePositionArray[a][0],c=nodePositionArray[a][1],d=0;d<nodePositionArray.length-(a+1);d++){var e=nodePositionArray[d+a+1][0],f=nodePositionArray[d+a+1][1],g=distance(b,e,c,f);if(g<drawLineThreshold){var h=map_range(g,0,drawLineThreshold,1,0),k=hexToRgb(nodePositionArray[a][2]),l="rgba("+k.r+","+k.g+","+k.b+","+h+")";ctx.strokeStyle=l,line(b,c,e,f)}}}window.addEventListener("resize",function(){width=window.innerWidth,height=window.innerHeight,canvas.width=width,canvas.height=height,clearCanvas(),nodes=[];for(var a,b=0;b<nodeAmount;b++)a=new Node(randomInt(0,width),randomInt(0,height),b),nodes.push(a);for(var b=0;b<nodes.length;b++)nodes[b].move(),nodes[b].draw()});
|
1
weboasis/js/canvas/stars.js
Normal file
1
weboasis/js/canvas/stars.js
Normal file
@ -0,0 +1 @@
|
||||
function fn(){function a(a,b){if(2>arguments.length&&(b=a,a=0),a>b){var c=b;b=a,a=c}return Math.floor(Math.random()*(b-a+1))+a}function b(a,b){var c=Math.max(a,b),d=Math.round(Math.sqrt(c*c+c*c));return d/2}function c(){ctx.globalCompositeOperation="source-over",ctx.globalAlpha=.8,ctx.fillStyle="hsla("+hue+", 64%, 6%, 1)",ctx.fillRect(0,0,w,h),ctx.globalCompositeOperation="lighter";for(var a=1,b=stars.length;a<b;a++)stars[a].draw();window.requestAnimationFrame(c)}window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}();var d=document.createElement("canvas");d.classList="background",document.getElementById("canvasContainer").appendChild(d),ctx=d.getContext("2d"),w=d.width=window.innerWidth,h=d.height=window.innerHeight,hue=217,stars=[],count=0,maxStars=1200;var e=document.createElement("canvas"),f=e.getContext("2d");document.getElementById("canvasContainer").appendChild(e),e.width=100,e.height=100;var g=e.width/2,j=f.createRadialGradient(g,g,0,g,g,g);j.addColorStop(.025,"#fff"),j.addColorStop(.1,"hsl("+hue+", 61%, 33%)"),j.addColorStop(.25,"hsl("+hue+", 64%, 6%)"),j.addColorStop(1,"transparent"),f.fillStyle=j,f.beginPath(),f.arc(g,g,g,0,2*Math.PI),f.fill();var k=function(){this.orbitRadius=a(b(w,h)),this.radius=a(60,this.orbitRadius)/12,this.orbitX=w/2,this.orbitY=h/2,this.timePassed=a(0,maxStars),this.speed=a(this.orbitRadius)/9e5,this.alpha=a(2,10)/10,count++,stars[count]=this};k.prototype.draw=function(){var b=Math.sin(this.timePassed)*this.orbitRadius+this.orbitX,c=Math.cos(this.timePassed)*this.orbitRadius+this.orbitY,d=a(10);1===d&&0<this.alpha?this.alpha-=.05:2===d&&1>this.alpha&&(this.alpha+=.05),ctx.globalAlpha=this.alpha,ctx.drawImage(e,b-this.radius/2,c-this.radius/2,this.radius,this.radius),this.timePassed+=this.speed};for(var l=0;l<maxStars;l++)new k;c()}fn();
|
1
weboasis/js/canvas/trails.js
Normal file
1
weboasis/js/canvas/trails.js
Normal file
@ -0,0 +1 @@
|
||||
window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(b){window.setTimeout(b,1E3/60)}}(),document.onselectstart=function(){return!1};var c=document.createElement("canvas");c.id="myCanvas",c.className="background",document.getElementById("canvasContainer").appendChild(c);var ctx=c.getContext("2d"),dpr=window.devicePixelRatio,cw=window.innerWidth-500,ch=window.innerHeight-300;c.width=cw*dpr,c.height=ch*dpr,ctx.scale(dpr,dpr);var rand=function(a,b){return~~(Math.random()*(b-a+1)+a)};ctx.lineCap="round";var radius,orbs=[],orbCount=30;function createOrb(a,b){var c=cw/2-a,d=ch/2-b,e=Math.sqrt(c*c+d*d),f=Math.atan2(d,c);orbs.push({x:a,y:b,lastX:a,lastY:b,hue:0,colorAngle:0,angle:f+Math.PI/2,size:rand(1,3)/2,centerX:cw/2,centerY:ch/2,radius:e,speed:rand(1,5)/1e3*(e/750)+.005,alpha:1-Math.abs(e)/cw,draw:function(){ctx.strokeStyle="hsla("+this.colorAngle+",100%,50%,1)",ctx.lineWidth=this.size,ctx.beginPath(),ctx.moveTo(this.lastX,this.lastY),ctx.lineTo(this.x,this.y),ctx.stroke()},update:function(){var a=this.x,b=this.y;this.lastX=this.x,this.lastY=this.y;var c=cw/2,d=ch/2,e=a,f=b,g=-((d-f)/(c-e)),h=Math.atan(g),i=Math.floor(h*(180/Math.PI));e<c&&f<d&&(i+=180),e<c&&f>d&&(i+=180),e>c&&f>d&&(i+=360),f<d&&"-Infinity"==g&&(i=90),f>d&&"Infinity"==g&&(i=270),e<c&&"0"==g&&(i=180),isNaN(i)&&(i=0),this.colorAngle=i,this.x=this.centerX+Math.sin(-1*this.angle)*this.radius,this.y=this.centerY+Math.cos(-1*this.angle)*this.radius,this.angle+=this.speed}})}function orbGo(a){var b=a.pageX-c.offsetLeft,d=a.pageY-c.offsetTop;createOrb(b,d)}function clear(){orbs=[]}for(var count=1e3;count--;)createOrb(cw/2,ch/2+2*count);var loop=function(){window.requestAnimFrame(loop),ctx.fillStyle="rgba(0,0,0,.1)",ctx.fillRect(0,0,cw,ch);for(var a=orbs.length;a--;)for(var b=orbs[a],c=3;c--;)b.update(),b.draw(ctx)};loop();
|
Reference in New Issue
Block a user