-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
364 lines (357 loc) · 22.7 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="vendors/bootsrap/bootstrap.min.css">
<script src="vendors/honeycomb.min.js"></script>
<script src="vendors/pixijs/pixi.min.js"></script>
<script src="vendors/pixijs/viewport.js"></script>
<script src="vendors/simplex-noise.js"></script>
<script src="vendors/reimg.js"></script>
<script src="vendors/jquery-3.3.1.slim.min.js"></script>
<script src="vendors/popper.min.js"></script>
<script src="vendors/bootsrap/bootstrap.min.js"></script>
<script src="resources/js/source.js"></script>
<title>Basic Procedural Hexagon Terrain Generator</title>
<link href="data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAX19fAJOTkwAJCQkA+/v7AD09PQC3t7cA/f39ANvb2wBRUVEA5OTkACYmJgA4ODgAy8vLAP///wAWFhYAqampAO/v7wCZmZkAbm5uAL29vQDGxsYA+vr6AAEBAQDz8/MA/Pz8ABMTEwAcHBwAhISEAFlZWQDs7OwA9fX1AAwMDAD+/v4AdHR0AH19fQAnJycAMDAwABcXFwBLS0sAICAgACkpKQCjo6MAGRkZANfX1wDg4OAAKysrAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADg4ODg4OESITHg4ODg4ODg4ODg4EEg8AABoCFg4ODg4ODiEUJQAAAAAAAC4GIQ4ODggJFwAAAAAAAAAAACcsDg4pAAAAAAAAAAAAAAAAKw4OCwAAAAAAAAAAAAAAAA8ODgsAAAAAAAAAAAAAAAAPDg4LAAAAAAAAAAAAAAAADw4OCwAAAAAAAAAAAAAAAA8ODgsAAAAAAAAAAAAAAAAPDg4LAAAAAAAAAAAAAAAADw4OJAAAAAAAAAAAAAAAACYODg0FAAAAAAAAAAAAAAwVDg4OBxAoAAAAAAAAGyoZDg4ODg4OHxwgAAADIxgODg4ODg4ODg4OCgEdLQ4ODg4ODgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" rel="icon" type="image/x-icon" />
</head>
<body>
<div class="container">
<div class="m-1">
<button type="button" class="btn btn-primary m-1" data-toggle="modal" data-target="#gridSettingsModal">
Grid
</button>
<button type="button" class="btn btn-primary m-1" data-toggle="modal" data-target="#elevationModal">
Elevation
</button>
<button type="button" class="btn btn-primary m-1" data-toggle="modal" data-target="#moistureModal">
Moisture
</button>
<button type="button" class="btn btn-primary m-1" onclick="downloadCanvasAsPng()">
Download as PNG
</button>
<button type="button" class="btn btn-primary m-1" data-toggle="modal" data-target="#mapHashModal">
Map Hash
</button>
<button type="button" class="btn btn-success m-1 float-right" id="reset">
Reset
</button>
<button type="button" class="btn btn-success m-1 float-right" id="redraw">
Redraw
</button>
</div>
</div>
<div class="container" id="grid" style="padding: 0">
<canvas id="canvas" class="border border-dark"></canvas>
</div>
<!-- Grid Settings Modal -->
<div class="modal fade" id="gridSettingsModal" tabindex="-1" role="dialog" aria-labelledby="gridSettingsTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="gridSettingsTitle">Grid Settings</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form id="gridSettingsForm" name="gridSettingsForm" role="form">
<div class="modal-body">
<div class="form-row">
<div class="form-group col-md-6">
<label for="hexColums">Columns</label>
<input type="number" class="form-control" id="hexColums" name="hexColums">
</div>
<div class="form-group col-md-6">
<label for="hexRows">Rows</label>
<input type="number" class="form-control" id="hexRows" name="hexRows">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<input class="form-group" type="checkbox" id="hideCoords" name="hideCoords">
<label for="hideCoords">
Hide Coordinates
</label>
</div>
<div class="form-group col-md-6">
<input class="form-group" type="checkbox" id="hideGrid" name="hideGrid">
<label for="hideGrid">
Hide Grid
</label>
</div>
</div>
<div class="form-row">
<label class="col-md-12 font-weight-bold">Contour Interval</label>
<div class="form-group col-md-3">
<label for="contourInterval_0">Deep Water</label>
<input type="number" class="form-control form-control-sm" id="contourInterval_0" name="contourInterval_0" step="0.01" min="0" max="1">
</div>
<div class="form-group col-md-3">
<label for="contourInterval_1">Shallow Water</label>
<input type="number" class="form-control form-control-sm" id="contourInterval_1" name="contourInterval_1" step="0.01" min="0" max="1">
</div>
<div class="form-group col-md-2">
<label for="contourInterval_2">Flat</label>
<input type="number" class="form-control form-control-sm" id="contourInterval_2" name="contourInterval_2" step="0.01" min="0" max="1">
</div>
<div class="form-group col-md-2">
<label for="contourInterval_3">Hill</label>
<input type="number" class="form-control form-control-sm" id="contourInterval_3" name="contourInterval_3" step="0.01" min="0" max="1">
</div>
<div class="form-group col-md-2">
<label for="contourInterval_4">Mountain</label>
<input type="number" class="form-control form-control-sm" id="contourInterval_4" name="contourInterval_4" step="0.01" min="0" max="1">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Apply</button>
</div>
</form>
</div>
</div>
</div>
<!-- Elevation Noise Modal -->
<div class="modal fade" id="elevationModal" tabindex="-1" role="dialog" aria-labelledby="elevationNoiseSettings" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="elevationNoiseSettings">Elevation Noise Settings</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form id="elevationNoiseSettingsForm" name="elevationNoiseSettingsForm" role="form">
<div class="modal-body">
<div class="form-row">
<div class="form-group col-md-12">
<label for="elevationSeed">Elevation Seed</label>
<input type="text" class="form-control" id="elevationSeed" name="elevationSeed" >
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<input class="form-group" type="checkbox" id="setElevationSeed" name="setElevationSeed">
<label for="setElevationSeed">
Set Elevation Seed
</label>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="frequencyElevation">Frequency</label>
<input type="number" class="form-control" id="frequencyElevation" name="frequencyElevation" step="0.1">
</div>
<div class="form-group col-md-6">
<label for="redistributionElevation">Redistribution</label>
<input type="number" class="form-control" id="redistributionElevation" name="redistributionElevation" step="0.1">
</div>
</div>
<div class="form-row">
<label class="col-md-12 font-weight-bold">Elevation Octaves</label>
<div class="form-group col-md-3">
<label for="elevationOctaves_0">e0</label>
<input type="number" class="form-control form-control-sm" id="elevationOctaves_0" name="elevationOctaves_0" step="0.01" min="0" max="1">
</div>
<div class="form-group col-md-3">
<label for="elevationOctaves_1">e1</label>
<input type="number" class="form-control form-control-sm" id="elevationOctaves_1" name="elevationOctaves_1" step="0.01" min="0" max="1">
</div>
<div class="form-group col-md-3">
<label for="elevationOctaves_2">e2</label>
<input type="number" class="form-control form-control-sm" id="elevationOctaves_2" name="elevationOctaves_2" step="0.01" min="0" max="1">
</div>
<div class="form-group col-md-3">
<label for="elevationOctaves_3">e3</label>
<input type="number" class="form-control form-control-sm" id="elevationOctaves_3" name="elevationOctaves_3" step="0.01" min="0" max="1">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<input class="form-group" type="checkbox" id="createIsland" name="createIsland">
<label for="createIsland">
Island
</label>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Apply</button>
</div>
</form>
</div>
</div>
</div>
<!-- Moisture Noise Modal -->
<div class="modal fade" id="moistureModal" tabindex="-1" role="dialog" aria-labelledby="moistureNoiseSettings" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="moistureNoiseSettings">Moisture Noise Settings</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form id="moistureNoiseSettingsForm" name="moistureNoiseSettingsForm" role="form">
<div class="modal-body">
<div class="form-row">
<div class="form-group col-md-12">
<label for="moistureSeed">Moisture Seed</label>
<input type="text" class="form-control" id="moistureSeed" name="moistureSeed">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<input class="form-group" type="checkbox" id="setMoistureSeed" name="setMoistureSeed">
<label for="setMoistureSeed">
Set Moisture Seed
</label>
</div>
<div class="form-group col-md-6">
<input class="form-group" type="checkbox" id="drawMoisture" name="drawMoisture">
<label for="drawMoisture">
Draw Moisture
</label>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="frequencyMoisture">Frequency</label>
<input type="number" class="form-control" id="frequencyMoisture" name="frequencyMoisture" step="0.1">
</div>
<div class="form-group col-md-6">
<label for="redistributionMoisture">Redistribution</label>
<input type="number" class="form-control" id="redistributionMoisture" name="redistributionMoisture" step="0.1">
</div>
</div>
<div class="form-row">
<label class="col-md-12 font-weight-bold">Moisture Octaves</label>
<div class="form-group col-md-3">
<label for="moistureOctaves_0">h0</label>
<input type="number" class="form-control form-control-sm" id="moistureOctaves_0" name="moistureOctaves_0" step="0.01" min="0" max="1">
</div>
<div class="form-group col-md-3">
<label for="moistureOctaves_1">h1</label>
<input type="number" class="form-control form-control-sm" id="moistureOctaves_1" name="moistureOctaves_1" step="0.01" min="0" max="1">
</div>
<div class="form-group col-md-3">
<label for="moistureOctaves_2">h2</label>
<input type="number" class="form-control form-control-sm" id="moistureOctaves_2" name="moistureOctaves_2" step="0.01" min="0" max="1">
</div>
<div class="form-group col-md-3">
<label for="moistureOctaves_3">h3</label>
<input type="number" class="form-control form-control-sm" id="moistureOctaves_3" name="moistureOctaves_3" step="0.01" min="0" max="1">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Apply</button>
</div>
</form>
</div>
</div>
</div>
<!-- Map Hash -->
<div class="modal fade" id="mapHashModal" tabindex="-1" role="dialog" aria-labelledby="mapHash" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="mapHashTitle">Map Hash</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form id="mapHashForm" name="mapHashForm" role="form">
<div class="modal-body">
<div class="form-row">
<div class="form-group col-md-12">
<label for="mapHash">Map Hash</label>
<textarea class="form-control" id="mapHash" name="mapHash" rows="10"></textarea>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<input class="form-group" type="checkbox" id="setMapHash" name="setMapHash">
<label for="setMapHash">
Set Map Hash
</label>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Apply</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="hexInfoModal" tabindex="-1" role="dialog" aria-labelledby="hexInfoModal" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="hexInfoModalTitle">Hexagon Details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form id="hexInfoForm" name="hexInfoForm" role="form">
<div class="modal-body">
<div class="form-row">
<div class="form-group col-md-3">
<label for="hColumn">Column</label>
<input type="text" class="form-control" id="hColumn" name="hColumn" readonly>
</div>
<div class="form-group col-md-3">
<label for="hRow">Row</label>
<input type="text" class="form-control" id="hRow" name="hRow" readonly>
</div>
<div class="form-group col-md-3">
<label for="xCoord">X</label>
<input type="text" class="form-control" id="xCoord" name="xCoord" readonly>
</div>
<div class="form-group col-md-3">
<label for="yCoord">Y</label>
<input type="text" class="form-control" id="yCoord" name="yCoord" readonly>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-2">
<label for="hElevation">E</label>
<input type="text" class="form-control" id="hElevation" name="hElevation" readonly>
</div>
<div class="form-group col-md-4">
<label for="hTerrain">Terrain</label>
<input type="text" class="form-control" id="hTerrain" name="hTerrain" readonly>
</div>
<div class="form-group col-md-2">
<label for="hMoisture">M</label>
<input type="text" class="form-control" id="hMoisture" name="hMoisture" readonly>
</div>
<div class="form-group col-md-4">
<label for="hBiome">Biome</label>
<input type="text" class="form-control" id="hBiome" name="hBiome" readonly>
</div>
</div>
<div class="form-row">
<div id="terrainColorRow" class="form-group col-md-6">
<label id="terrainColor"></label>
</div>
<div id="biomeColorRow" class="form-group col-md-6">
<label id="biomeColor"></label>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>