-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
227 lines (194 loc) · 6.72 KB
/
index.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html>
<html manifest="main_cache.appcache">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="Directory for the projects created by Tower Hufham">
<meta name="keywords" content="Art,Code,Tower,Games,Procedural,Generative">
<meta name="author" content="Tower Hufham">
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<title>Tower Hufham</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="shortcut icon" href="favicon.ico"></link>
<style>
body {
font-family: 'Open Sans', sans-serif;
text-align: center;
color: #ffffff;
text-shadow: 2px 2px 8px #000000
}
p {
font-size: 125%;
}
h1 {
font-size: 350%;
}
h2 {
font-size: 240%;
}
h3 {
font-size: 150%;
}
.vertical-align {
display: flex;
align-items: center;
flex-wrap: wrap
}
a {
color: yellow;
}
/*
.btn-link {
box-shadow: 0px 0px 1px #000000;
}
*/
</style>
</head>
<body background="img/pool_bg.jpg">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<h1>Tower Hufham</h1>
<h3>Programming, design, and tomfoolery.</h3>
<div class="container">
<div class="row vertical-align">
<div class="col-sm-6">
<h3>Welcome to my website. Take a seat, relax, and enjoy this procedurally generated artwork, on the house.</h3>
</div>
<div class="col-sm-6">
<canvas id="artCanvas" width="324" height="324" style="border:1px solid #000000;"></canvas>
</div>
</div>
</div>
<div class="container">
<!-- <h3>Links to stuff.</h3> -->
<div class="row vertical-align">
<div class="col-sm-3">
<a href="https://ello.co/qubitforest" class="btn btn-link">
<img src="img/qubitforest_logo.png" class="img-responsive center-block" alt="Qubitforest">
</a>
<p><br/><h3>Qubitforest</h3></p>
<p>Art from 2016-2017</p>
</div>
<div class="col-sm-3">
<a href="https://github.com/towerhufham" class="btn btn-link">
<img src="img/code_logo.png" class="img-responsive center-block" alt="Code">
</a>
<p><br/><h3>Code</h3></p>
<p>My github page</p>
</div>
<div class="col-sm-3">
<a href="art.html" class="btn btn-link">
<img src="img/album_icon.png" class="img-responsive center-block" alt="Album Art">
</a>
<p><br />
<h3>Album Art</h3>
</p>
<p>Album art commissions</p>
</div>
<div class="col-sm-3">
<a href="digimon.html" class="btn btn-link">
<img src="img/digimon_logo_crunchy.png" class="img-responsive center-block" alt="Digimon">
</a>
<p><br/><h3>Digimon</h3></p>
<p>Generate Digimon sprites</p>
</div>
</div>
<div class="row vertical-align">
<div class="col-sm-3">
<a href="https://towerhufham.itch.io/chromawarp" class="btn btn-link">
<img src="img/chromawarp_icon.png" class="img-responsive center-block" alt="Chromawarp">
</a>
<p><br/><h3>Chromawarp</h3></p>
<p>Innovative platformer game on the web, made for <a href=https://ldjam.com/>Ludum Dare</a> 35</P>
</div>
<div class="col-sm-3">
<a href="https://sourceforge.net/projects/nethackmodern/" class="btn btn-link">
<img src="img/lorc_cursed_star.png" class="img-responsive center-block" alt="Nethack Modern">
</a>
<p><br/><h3>Nethack Modern</h3></p>
<p>High-res texture pack for <a href=https://www.nethack.org/>Nethack</a> made with assets from <a href=http://www.game-icons.net>game-icons.net</a></p>
</div>
<div class="col-sm-3">
<a href="yugioh.html" class="btn btn-link">
<img src="img/yugioh_icon.png" class="img-responsive center-block" alt="Yugioh Deck Generator">
</a>
<p><br/><h3 style="color:#bbbbbb">Yu-Gi-Oh! Deck Generator (BROKEN)</h3></p>
<p style="color:#bbbbbb">Generates a Yu-Gi-Oh! deck for use in ygoPro or devPro (Currently down due to dead API)</p>
</div>
<div class="col-sm-3">
<a href="pond-scum/pond-scum.html" class="btn btn-link">
<img src="img/pond-scum_logo.png" class="img-responsive center-block" alt="Pond Scum">
</a>
<p><br/><h3>Pond Scum</h3></p>
<p>Small visual project for FNA-102</p>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="noisejs-master/perlin.js"></script>
<script>
var canvas = document.getElementById("artCanvas");
var ctx = canvas.getContext("2d");
function randInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function randomArt() {
var absolute_size = 342
var pixel_size = 2
var pixels = absolute_size / pixel_size
noise.seed(Math.random());
ctx.fillStyle="#FFFFFF";
ctx.fillRect(0,0,absolute_size,absolute_size);
//by Tim Down
function componentToHex(c) {
var hex = c.toString(16);
return hex.length == 1 ? "0" + hex : hex;
}
//by Tim Down
function rgbToHex(r, g, b) {
return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
}
function drawPixel(x, y, color) {
ctx.fillStyle=color;
ctx.fillRect(x*pixel_size, y*pixel_size, pixel_size, pixel_size);
}
var min_scale = 100
var max_scale = 1000
var r1_scale = randInt(min_scale, max_scale)
var g1_scale = randInt(min_scale, max_scale)
var b1_scale = randInt(min_scale, max_scale)
var r2_scale = randInt(min_scale, max_scale)
var g2_scale = randInt(min_scale, max_scale)
var b2_scale = randInt(min_scale, max_scale)
for (var x = 0; x < pixels; x++) {
for (var y = 0; y < pixels; y++) {
// All noise functions return values in the range of -1 to 1.
var r1 = noise.simplex2(x / r1_scale, y / r1_scale);
r1 = Math.floor(Math.abs(r1) * 255);
var g1 = noise.simplex2(x / g1_scale, y / g1_scale);
g1 = Math.floor(Math.abs(g1) * 255);
var b1 = noise.simplex2(x / b1_scale, y / b1_scale);
b1 = Math.floor(Math.abs(b1) * 255);
var r2 = noise.simplex2(x / r2_scale, y / r2_scale);
r2 = Math.floor(Math.abs(r2) * 255);
var g2 = noise.simplex2(x / g2_scale, y / g2_scale);
g2 = Math.floor(Math.abs(g2) * 255);
var b2 = noise.simplex2(x / b2_scale, y / b2_scale);
b2 = Math.floor(Math.abs(b2) * 255);
drawPixel(x, y, rgbToHex(r1 ^ r2, g1 ^ g2, b1 ^ b2))
}
}
}
function loadArt() {
randomArt();
canvas.addEventListener('click', function() {randomArt()}, false);
}
document.addEventListener('DOMContentLoaded', function() {loadArt()}, false);
//document.addEventListener('DOMContentLoaded', function() {setTimeout(function() {loadArt()}, 2000)}, false);
</script>
</html>