-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
158 lines (139 loc) · 7.13 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Terrain Gen</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="semantic.min.css">
<!--- This is pretty cool & free -->
<script src="ui.js"></script>
<script src="HueToRGB.js"></script>
<script src="simplex-noise.js"></script>
<script src="terrain.js"></script>
</head>
<body>
<div id="header">
<table class="table-std">
<tr>
<th>Map Controls</th>
<th>Variables</th>
<th>Options</th>
<th>Mode-specific Options</th>
</tr>
<tr>
<td>
<button class="ui button" onclick="genMap('random-noise')">Generate <red>'random-noise'</red>
map</button> <br>
<button class="ui button" onclick="genMap('simplex-noise')">Generate <orange>'simplex-noise'
</orange> map</button> <br>
<button class="ui button" onclick="genMap('web-img')">Generate map from <purple>'web-image'</purple>
</button> <br>
<button class="ui button" onclick="genMap('img-file')">Generate map from <green>'img-file'</green>
</button>
<br><br>
<button class="ui button" onclick="smooth(ctx)">
<blue>Smooth map</blue>
</button> <br>
</td>
<td>
<p id="width_display" class="var-title">Width:</p>
<input type="range" id="width_slider" min="1" max="3000" oninput="updateSliders()"> <br>
<p id="height_display" class="var-title">Height:</p>
<input type="range" id="height_slider" min="1" max="3000" oninput="updateSliders()"> <br>
<div class="ui form">
<label for="detail">Use </label>
<input type="number" min="2" max="360" value="360" id="detail"
style="padding:0.3em;height:0.8em;width:3em;">
<label for="detail">different values </label>
</div><br>
</td>
<td>
<h4 class="op-title"> -------- Colour Options -------- </h4>
<div class="op-box ui form">
<div class="ui slider checkbox">
<input type="radio" name="colormode" id="mode_hue" checked="true">
<label for="mode_hue">Hue changes with value</label>
</div>
<br>
<div class="ui slider checkbox">
<input type="radio" name="colormode" id="mode_gray">
<label for="mode_gray">Lightness changes with value</label>
</div>
</div>
<br>
<button class="ui button" onclick="show(ctx)">
<blue>Redraw canvas</blue>
</button>
<br>
<h4 class="op-title"> -------- World Options -------- </h4>
<div class="ui form">
<label for="neighbour_range">Search for neighbours within </label>
<input type="number" min="1" max="9" value="1" id="neighbour_range"
style="padding:0.3em;height:0.8em;width:2em;">
<label for="neighbour_range"> square(s) when smoothing</label>
</div>
<br>
<div class="op-box ui form">
<div class="ui slider checkbox">
<input type="radio" name="edge_behaviour" id="flat" checked="true">
<label for="flat">Treat the world as flat when smoothing</label>
</div>
<br>
<div class="ui slider checkbox">
<input type="radio" name="edge_behaviour" id="sphere">
<label for="sphere">Treat the world as spherical when smoothing</label>
</div>
<br>
<div class="ui slider checkbox">
<input type="radio" name="edge_behaviour" id="torus">
<label for="torus">Treat the world as a torus when smoothing</label>
</div>
</div>
</td>
<td>
<h4 class="op-title"> -------- Simplex Options --------</h4>
<div class="ui toggle checkbox">
<input type="checkbox" name="new_simplex_seed" id="reseed_simplex" checked="true">
<label for="reseed_simplex">Re-randomize the noise map each time</label>
</div>
<br> <br>
<p id="kSimplex_display" class="var-title">Noise Size Modifier:</p>
<input type="range" id="kSimplex_slider" min="0.0001" max="8" step="0.000001"
oninput="updateSliders()"> <br>
<h4 class="op-title"> -------- Image Options --------</h4>
<div class="ui label">Image URL:</div>
<div class="ui input">
<input id="link_input" type="text" name="web_address" placeholder="www.example.com/image.jpg"
style="width:16em">
</div>
<br>
<div class="ui label">Image File:</div>
<div class="ui input">
<input id="file_input" type="file" name="file" accept="image/*">
</div>
<br><br>
<div class="op-box ui form">
<div class="ui slider checkbox">
<input type="radio" name="data_axis" id="axis_hue" checked="true">
<label for="hue">Use the image's hue as the data</label>
</div>
<br>
<div class="ui slider checkbox">
<input type="radio" name="data_axis" id="axis_saturation" checked="true">
<label for="hue">Use the image's saturation as the data</label>
</div>
<br>
<div class="ui slider checkbox">
<input type="radio" name="data_axis" id="axis_lightness" checked="true">
<label for="hue">Use the image's lightness as the data</label>
</div>
</div>
</td>
</tr>
</table>
</div>
<div id="doc" style="overflow-x:auto; margin:0"> </div>
</body>
</html>