-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path404.html
170 lines (132 loc) · 4.03 KB
/
404.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<!--
_,.---._ _,.---._
,--.-. .-,--.,-.' , - `. ,--.-. .-,--.,-.' , - `.
/==/- / /=/_ //==/_, , - \ /==/- / /=/_ //==/_, , - \
\==\, \/=/. /|==| .=. | \==\, \/=/. /|==| .=. |
\==\ \/ -/ |==|_ : ;=: - | \==\ \/ -/ |==|_ : ;=: - |
|==| ,_/ |==| , '=' | |==| ,_/ |==| , '=' |
\==\-, / \==\ - ,_ / \==\-, / \==\ - ,_ /
/==/._/ '.='. - .' /==/._/ '.='. - .'
`--`-` `--`--'' `--`-` `--`--''
THIS IS THE 404
-->
<html>
<head>
<meta charset='utf-8'>
<title>404'ed!</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/libraries/p5.min.js"></script>
<script src="/libraries/p5.sound.min.js"></script>
<style>
html, body{ height:100%; margin:0; }
header{ height:50px; background:lightcyan; }
footer{ height:50px; background:PapayaWhip; }
/* Trick */
body{
display:flex;
flex-direction:column;
}
#overlay {
z-index: 1000;
margin: 1em 2em 2em 1em;
font-size: 2em;
display: flex;
align-items: center;
justify-content: center;
border-radius: 1em;
}
.bg-color {
padding: 1rem;
border: dashed;
background-color: yellow;
color: purple;
}
</style>
</head>
<body id="gradient">
<script src="sketch.js"> </script>
<div id="overlay">
<p class="bg-color">404'ed! That page doesn't exist! Try going <a href="http://leetusman.com/" alt="home">somewhere else</a>.</p>
</div>
<script>
const imgsOnPage = 6;
//DON'T CHANGE THESE
const items=12; //max image in folder
let chosen = [];
let selection;
function preload(){
selection = loadSound('/snd/select.mp3');
}
function setup(){
noCanvas();
makePage();
}
function makePage(){
for (let i = 0; i < imgsOnPage; i++){
let item = floor(random(items));
chosen.push(item);
let img = createImg("/images/collapsed/"+item+".png");
//console.log(img.style('width'))
let _x = random(windowWidth-img.width/2);
let _y = random(windowHeight);
img.position(_x,_y);
}
}
function mousePressed(){
selection.play();
makePage();
}
// gradient bg - nicked from luis from my spam.cafe site, updated to a p5 stylee ;0
// ------------------------------------------------
var colors = new Array(
[62,35,255],
[60,255,60],
[255,35,98],
[45,175,230],
[255,0,255],
[255,128,0]);
var step = 0;
//color table indices for:
// current color left
// next color left
// current color right
// next color right
var colorIndices = [0,1,2,3];
//transition speed
var gradientSpeed = 0.002;
function updateGradient()
{
var c0_0 = colors[colorIndices[0]];
var c0_1 = colors[colorIndices[1]];
var c1_0 = colors[colorIndices[2]];
var c1_1 = colors[colorIndices[3]];
var istep = 1 - step;
var r1 = Math.round(istep * c0_0[0] + step * c0_1[0]);
var g1 = Math.round(istep * c0_0[1] + step * c0_1[1]);
var b1 = Math.round(istep * c0_0[2] + step * c0_1[2]);
var color1 = "rgb("+r1+","+g1+","+b1+")";
var r2 = Math.round(istep * c1_0[0] + step * c1_1[0]);
var g2 = Math.round(istep * c1_0[1] + step * c1_1[1]);
var b2 = Math.round(istep * c1_0[2] + step * c1_1[2]);
var color2 = "rgb("+r2+","+g2+","+b2+")";
let grad = select('#gradient');
grad.style("background","-webkit-gradient(linear, left top, right top, from("+color1+"), to("+color2+"))");
grad.style("background","-moz-linear-gradient(left, "+color1+" 0%, "+color2+" 100%)");
step += gradientSpeed;
if ( step >= 1 )
{
step %= 1;
colorIndices[0] = colorIndices[1];
colorIndices[2] = colorIndices[3];
//pick two new target color indices
//do not pick the same as the current one
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);
</script>
</body>
</html>