-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
125 lines (125 loc) · 4.43 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SSMG - Simple Seedable Map Generator</title>
<style>
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type="number"] {
-moz-appearance: textfield;
}
body {
margin: 0px;
margin-left: 10px;
margin-top: 10px;
background: gainsboro;
}
#canvas {
text-align: center;
}
.text-center {
text-align: center;
}
.title {
text-align: center;
font-weight: bold;
}
.panel-title {
font-weight: bold;
}
.panels-wrapper {
display: flex;
}
.panel-right {
display: flex;
word-wrap: break-word;
}
</style>
</head>
<body>
<div id="app"></div>
<p class="title">SSMG - Simple Seedable Map Generator</p>
<div class="panels-wrapper">
<div>
<div class="text-center">
<span class="panel-title">Map Options</span>
</div>
<div>
<input type="range" id="tilePixelSize" name="tilePixelSize" value="5" min="1" max="10" oninput="tilePixelSizeValue.value = this.value" />
<output id="tilePixelSizeValue">5</output>
Pixels per tile*
</div>
<div>
<input type="range" id="width" name="width" value="100" min="1" max="1000" oninput="widthValue.value = this.value" />
<output id="widthValue">100</output>
Width
</div>
<div>
<input type="range" id="height" name="height" value="100" min="1" max="1000" oninput="heightValue.value = this.value" />
<output id="heightValue">100</output>
Height
</div>
<div>
<input type="range" id="smoothLevel" name="smoothLevel" value="25" min="1" max="100" oninput="smoothLevelValue.value = this.value" />
<output id="smoothLevelValue">25</output>
smoothLevel
</div>
<div>
<input type="range" id="elevationMax" name="elevationMax" value="500" min="0" max="1000" oninput="elevationMaxValue.value = this.value" />
<output id="elevationMaxValue">500</output>
elevationMax
</div>
<div>
<input type="range" id="elevationMin" name="elevationMin" value="0" min="0" max="1000" oninput="elevationMinValue.value = this.value" />
<output id="elevationMinValue">0</output>
elevationMin
</div>
<div>
<input type="range" id="percentageGrass" name="percentageGrass" value="0.3" step="0.01" min="0.01" max="1" oninput="percentageGrassValue.value = this.value" />
<output id="percentageGrassValue">0.3</output>
percentageGrass
</div>
<div>
<input type="range" id="percentageStone" name="percentageStone" value="0.3" step="0.01" min="0.01" max="1" oninput="percentageStoneValue.value = this.value" />
<output id="percentageStoneValue">0.3</output>
percentageStone
</div>
<div>
<input type="range" id="percentageSand" name="percentageSand" value="0.03" step="0.01" min="0.01" max="1" oninput="percentageSandValue.value = this.value" />
<output id="percentageSandValue">0.03</output>
percentageSand
</div>
<div>
<input type="range" id="percentageShore" name="percentageShore" value="0.08" step="0.01" min="0.01" max="1" oninput="percentageShoreValue.value = this.value" />
<output id="percentageShoreValue">0.07</output>
percentageShore
</div>
<br />
<input type="number" id="seed" placeholder="Map seed (numbers only!)" />
<button type="button" id="button">Generate</button><br /><br />
*Not part of the library, it's just a convenience here!
</div>
<div class="panel-right">
<div>
<div class="text-center">
<span class="panel-title">Input</span>
</div>
<pre id="json-input"></pre>
</div>
<div>
<div class="text-center">
<span class="panel-title">Output</span>
</div>
<pre id="json-output"></pre>
</div>
</div>
</div>
<canvas id="canvas"></canvas>
<script src="/src/demo.ts" type="module"></script>
</body>
</html>