forked from hsist/hackerspace.ist
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
107 KiB
103 lines
107 KiB
6 years ago
|
<head>
|
||
|
<meta name="generator" content="Hugo 0.42.1" />
|
||
|
<meta charset="utf-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<meta name="robots" content="noindex">
|
||
|
<title>404 Error | hackerspace istanbul</title>
|
||
|
<link rel="icon" sizes="any" href="data:image/svg+xml,%3Csvg%20viewBox='0%200%2046%2045'%20xmlns='http://www.w3.org/2000/svg'%3E%3Ctitle%3EAfter%20Dark%3C/title%3E%3Cpath%20d='M.708%2045L23%20.416%2045.292%2045H.708zM35%2038L23%2019%2011%2038h24z'%20fill='%23000'/%3E%3C/svg%3E">
|
||
|
|
||
|
<meta name="theme-color" content="#000">
|
||
|
|
||
|
|
||
|
<style media="screen">
|
||
|
@keyframes intro {
|
||
|
0% {
|
||
|
opacity: 0;
|
||
|
}
|
||
|
100% {
|
||
|
opacity: 1;
|
||
|
}
|
||
|
}
|
||
|
@font-face {
|
||
|
font-family: 'Londrina Outline';
|
||
|
src: url(data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAAH/AABIAAAABIQQAAH9XAAEAQgAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4b3GocIAZgAINiCAQRCAqDwHSC31cBNgIkA4ckC4NUAAQgBYpsB4VbDAc/d2ViZgYbWu0H0FvbA9wOoG78P2lHBvI4JLANR0X95KRCzv7/PyaocdiHq2DMcMGLsMiaWYKtslVWtlPStp1Z9ZGK3HCCYZehVz/3NVwXF1xwadluHEkYIDqkn3KQiW0vl5s0Q7dseO3zxiDZ/wlMOZL0eVY4vwVOEKAREvqPUPLpwVboG+7U5DU7RZ7///2e/Vz7XFSTaHMPxapbpTPIjK4heieKVfHRHzRL8P8Znl+b7/26hKuGu+PuOOgjWrjkjr47ODKOLlEQRGywpg3GVHSbUVNnThe6TWcs3Zwu0h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1xu+zDd1gVD8ZsHJZvROV8/fUUa6nrWqhDqkjA2toKJrUG6H6iu9V
|
||
|
font-weight: normal;
|
||
|
font-style: normal;
|
||
|
}
|
||
|
html, body {
|
||
|
overflow: hidden;
|
||
|
animation: intro 3s both;
|
||
|
animation-delay: 0.15s;
|
||
|
}
|
||
|
body {
|
||
|
background-color: black;
|
||
|
margin: 0;
|
||
|
}
|
||
|
canvas {
|
||
|
position: absolute;
|
||
|
overflow: hidden;
|
||
|
top: 0;
|
||
|
left: 0;
|
||
|
z-index: -1;
|
||
|
}
|
||
|
body {
|
||
|
display: flex;
|
||
|
height: 100vh;
|
||
|
align-items: center;
|
||
|
}
|
||
|
header {
|
||
|
font-family: 'Londrina Outline', sans-serif;
|
||
|
text-align: center;
|
||
|
margin: 0 auto;
|
||
|
font-size: 10vw;
|
||
|
}
|
||
|
h1 {
|
||
|
position: relative;
|
||
|
font-weight: 900;
|
||
|
color: white;
|
||
|
opacity: 0.75;
|
||
|
}
|
||
|
header h1 {
|
||
|
text-align: center;
|
||
|
width: 100%;
|
||
|
}
|
||
|
header h1:before {
|
||
|
content: attr(data-letters);
|
||
|
position: absolute;
|
||
|
left: 0;
|
||
|
overflow: hidden;
|
||
|
width: 100%;
|
||
|
height: 50%;
|
||
|
color: black;
|
||
|
text-shadow: 3px -2px 5px black, -3px 3px 4px black;
|
||
|
text-align: center;
|
||
|
}
|
||
|
header h1:after {
|
||
|
content: attr(data-letters);
|
||
|
position: absolute;
|
||
|
left: -10px;
|
||
|
overflow: hidden;
|
||
|
width: 100%;
|
||
|
height: 49%;
|
||
|
color: white;
|
||
|
}
|
||
|
a {
|
||
|
color: rgba(255,255,255,0.75);
|
||
|
text-decoration: none;
|
||
|
}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<canvas id="c"></canvas>
|
||
|
<header>
|
||
|
<a title="Page Not Found" href="http://hackerspace.ist/">
|
||
|
<h1 data-letters="404"><span>404</span></h1>
|
||
|
</a>
|
||
|
</header>
|
||
|
<script>
|
||
|
|
||
|
class Dots{constructor(width,height,spacing){this.spacing=spacing;this.dots=[];this.alphaStep=1/10;this.cols=Math.floor(width/spacing);this.rows=Math.floor(height/spacing);const canvas=document.createElement('canvas'),ctx=canvas.getContext('2d');canvas.width=width;canvas.height=height;this.canvas=canvas;this.ctx=ctx;this.draw()}draw(){const ctx=this.ctx,spacing=this.spacing;ctx.fillStyle='rgba(24, 129, 141, .1)';this.dots=Array.apply(null,Array(this.cols)).map((n,x)=>{return Array.apply(null,Array(this.rows)).map((p,y)=>{let dot={opacity:0.1,x:x*spacing,y:y*spacing};ctx.fillRect(dot.x,dot.y,1,1);return dot})})}ghost(){const ghostDots=document.createElement('canvas');ghostDots.width=this.canvas.width;ghostDots.height=this.canvas.height;const dotsCtx=ghostDots.getContext('2d');dotsCtx.fillStyle='rgb(24, 129, 141)';this.dots.forEach(col=>{col.forEach(dot=>{dotsCtx.fillRect(dot.x,dot.y,1,1)})});return ghostDots}}class Circuits{constructor(width,height,size,minLength,maxLength){this.size=size;this.width=width;this.height=height;this.cols= ~~(width/size);this.rows= ~~(height/size);this.scene=Array.apply(null,Array(this.cols)).map(()=>new Col(this.rows));this.collection=[];this.minLength=minLength;this.maxLength=maxLength;this.populate();this.draw()}draw(){const canvas=document.createElement('canvas'),ctx=canvas.getContext('2d'),size=this.size;canvas.width=this.width;canvas.height=this.height;ctx.strokeStyle='rgba(59, 177, 188, 1)';ctx.lineWidth=Math.round(size/10);this.collection.forEach(circuit=>{let point=[circuit.start[0],circuit.start[1]],path=circuit.path;ctx.beginPath();ctx.moveTo(point[0]*size+size/2+path[0][0]*size/4,point[1]*size+size/2+path[0][1]*size/4);path.forEach((dir,index)=>{point[0]+=dir[0];point[1]+=dir[1];if(index===path.length-1){ctx.lineTo(point[0]*size+size/2-dir[0]*size/4,point[1]*size+size/2-dir[1]*size/4)}else{ctx.lineTo(point[0]*size+size/2,point[1]*size+size/2)}});ctx.stroke()});ctx.lineWidth= ~~(this.size/5);ctx.strokeStyle='rgba(59, 177, 188, .6)';this.collection.forEach(circuit=>{ctx.beginPath();ctx.arc(circuit.start[0]*size+size/2,circuit.start[1]*size+size/2,size/4,0,2*Math.PI,false);ctx.stroke();ctx.beginPath();ctx.arc(circuit.end[0]*size+size/2,circuit.end[1]*size+size/2,size/4,0,2*Math.PI,false);ctx.stroke()});this.canvas=canvas}populate(){const size=this.size;let start=null,n=1000,maxLength=this.maxLength,minLength=this.minLength,length=0,dir=null;while((start=this.getStart())&&n--){length=minLength+ ~~(Math.random()*(maxLength-minLength));dir=this.getDir(start);this.setUsed(start[0],start[1]);if(dir[0]!==0||dir[1]!==0){let circuit=new Circuit(start,size),moving=true,path=[start[0],start[1]],coords=[start[0],start[1]];length-=1;while(moving&&length){circuit.path.push(dir);circuit.coords.push([path[0],path[1]]);path[0]+=dir[0];path[1]+=dir[1];this.setUsed(path[0],path[1]);dir=this.getDir(path,dir);if(dir[0]===0&&dir[1]===0){moving=false}length-=1}if(circuit.path.length>=minLength){circuit.end=path;circuit.coords.push([path[0],path[1]]);let speed=Math.random()*0.5+0.5;circuit.things.push(things.create(circuit,speed*1));if(circuit.path.length>maxLength/3){speed=Math.random()*0.5+0.5;circuit.things.push(things.create(circuit,-speed,circuit.path.length*size))}if(circuit.path.length>maxLength/1.5){speed=Math.random()*0.5+0.5*(Math.random()>=0.5?-1:1);circuit.things.push(things.create(circuit,speed,Math.random()*circuit.path.length*size))}circuit.length=circuit.path.length*size;this.collection.push(circuit)}}}}getStart(){let found=false,col=null,row=null,free=[],result=false;const scene=this.scene;scene.forEach((col,index)=>{if(col.free){free.push(index)}});if(free.length){col=this.pickOne(free);free.length=0;scene[col].rows.forEach((row,index)=>{if(row===0){free.push(index)}});row=this.pickOne(free);result=[col,row]}return result}pickOne(array){return array[~~(Math.random()*array.length)]}setUsed(x,y){this.scene[x].rows[y]=1;this.scene[x].free-=1}isAvailable(x,y){const scene=this.scene;let result=false;if(typeof scene[x]!=='undefined'){if(typeof scene[x].rows[y]!=='undefined'){if(scene[x].row
|
||
|
</script>
|
||
|
</body>
|