forked from MateuszTk/Voptix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
195 lines (193 loc) · 7.06 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
<!DOCTYPE html>
<html>
<head>
<script src="./script/gl-matrix.js"></script>
<script src="./script/perlin.js"></script>
<script src="./script/helper.js"></script>
<script src="./script/octree.js"></script>
<script src="./script/worldgen.js"></script>
<script src="./script/control.js"></script>
<script src="./script/ui.js" defer></script>
<script src="./script/renderer.js"></script>
<link rel="stylesheet" href="./styles/style.css">
<title>Voptix</title>
<link rel="icon" type="image/x-icon" href="./images/favicon.png">
</head>
<body>
<div id="canvas_container">
<canvas id="glCanvas" width="1280" height="720" style="width: 100%; height: 100%;"></canvas>
<div class="crosshair"></div>
</div>
<p id="fps_counter">FPS</p>
<button class="prompt" style="left: 2px; bottom: 2px;" onclick="precisionButton()">
<p style="margin: 4px;"><kbd>P</kbd> <span id="precision">Precision mode</span></p>
</button>
<div id="right-toolbar-container">
<div id="right-toolbar-editor">
<div id="wrapper">
<nav class="tab">
<button id="worldTabLink" onclick="openTab(0)">World</button>
<button id="blockTabLink" onclick="openTab(1)">Block</button>
</nav>
<div id="blockTab">
<section>
<h1>VOXEL</h1>
<div style="float: left;">
<div class="slider" style="color: red;">
<label for="RRange">R.</label>
<input type="range" min="0" max="255" value="255" style="background-color: red;" id="RRange">
<span id="Rtext"></span><br>
</div>
<div class="slider" style="color: green;">
<label for="GRange">G.</label>
<input type="range" min="0" max="255" value="255" style="background-color: green;" id="GRange">
<span id="Gtext"></span><br>
</div>
<div class="slider" style="color: blue;">
<label for="BRange">B.</label>
<input type="range" min="0" max="255" value="255" style="background-color: blue;" id="BRange">
<span id="Btext"></span><br>
</div>
<div class="slider" style="color: white;">
<label for="ARange">C.</label>
<input type="range" min="0" max="255" value="255" id="ARange">
<span id="Atext"></span><br>
</div>
<div class="slider" style="color: white;">
<label for="ERange">E. </label>
<input type="range" min="0" max="255" value="255" id="ERange">
<span id="Etext"></span><br>
</div>
<div class="slider" style="color: white;">
<label for="RoRange">R. </label>
<input type="range" min="0" max="255" value="0" id="RoRange">
<span id="Rotext"></span><br>
</div>
<button type="button" class="button" onclick="addToPalette(brush.color_r, brush.color_g, brush.color_b, brush.clarity, brush.emission, brush.roughness, brush.palette_id);">Fill</button>
</div>
<div id="previewMask" style="float: right;">
<img src="./images/gora.jpg" width="200" height="200" id="matPreview">
</div>
</section>
</div>
<div id="worldTab">
<section>
<h1>BRUSH</h1>
<div style="float: left;">
<div class="slider" style="color: white;">
<label for="PRange">Voxel</label>
<input type="range" min="0" max="64" value="0" id="PRange">
<span id="Ptext"></span><br>
</div>
<div class="slider" style="color: white;">
<label for="VRange">Variant</label>
<input type="range" min="0" max="8" value="0" id="VRange">
<span id="Vtext"></span><br>
</div>
<div class="slider" style="color: white;">
<label for="BsRange">Size</label>
<input type="range" min="1" max="40" value="1" id="BsRange">
<span id="demo4"></span><br>
</div>
<label for="kwadratowypedzelid" style="font-size: 30px; color: white; font-family: Impact;">SQUARE BRUSH</label>
<input type="checkbox" id="kwadratowypedzelid" name="kwadratowypedzel">
</div>
<div id="brushPreview">
<div id="circle"></div>
</div>
</section>
</div>
<section>
<h1>WORLD</h1>
<div style="position: relative; display: flex;">
<button type="button" class="button" onclick="save_palette('save')">Save palette</button>
<button type="button" class="button" onclick="save('save')">Save world</button>
<button type="button" class="button" onclick="loadFile()">Open</button>
<!--<div class="malyedytor">SEED</div>
<div id="seedp"><input type="text" name="seed" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"></div>
<button type="button" id="applyseed" onclick="">Apply</button>-->
</div>
</section>
<section>
<h1>CONTROL SETTINGS</h1>
<div>
<div class="slider">
<label for="MSRange">MOUSE SENSITIVITY</label>
<input type="range" min="1" max="100" value="50" id="MSRange">
<span id="demo5"></span><br>
</div>
<div class="slider">
<label for="FSRange">FLYING SPEED</label>
<input type="range" min="1" max="100" value="50" id="FSRange">
<span id="demo6"></span><br>
</div>
</div>
<h2>KEY BINDINGS</h2>
<div>
<table>
<tr>
<td>Place voxel</td>
<td>LMB</td>
</tr>
<tr>
<td>Remove voxel</td>
<td>RMB</td>
</tr>
<tr>
<td>Pick voxel</td>
<td>MMB</td>
</tr>
<tr>
<td>Show pointer</td>
<td><kbd>F</kbd>/<kbd>Esc</kbd></td>
</tr>
<tr>
<td>Hide pointer</td>
<td><kbd>F</kbd></td>
</tr>
<tr>
<td>Move</td>
<td><kbd>W</kbd>/<kbd>A</kbd>/<kbd>S</kbd>/<kbd>D</kbd>/<kbd>Q</kbd>/<kbd>E</kbd></td>
</tr>
<tr>
<td>Browse voxels</td>
<td><kbd>↑</kbd>/<kbd>↓</kbd>/Scroll wheel</td>
</tr>
<tr>
<td>Browse voxel variants</td>
<td><kbd>Shift</kbd> + <kbd>←</kbd>/<kbd>→</kbd>/Scroll wheel</td>
</tr>
<tr>
<td>Toggle editing precision</td>
<td><kbd>P</kbd></td>
</tr>
</table>
</div>
</section>
<section>
<h1>GRAPHICS</h1>
<select id="resolutionSelect" onchange="scaleUpdate(100)">
<option value="640x360">640 x 360 (16:9)</option>
<option value="800x600">800 x 600 (4:3)</option>
<option value="1024x768">1024 x 768 (4:3)</option>
<option value="1280x720">1280 x 720 (16:9)</option>
<option value="1440x900">1440 x 900 (16:10)</option>
<option value="1920x1080">1920 x 1080 (16:9)</option>
<option value="1920x1200">1920 x 1200 (16:10)</option>
<option value="2560x1440">2560 x 1440 (16:9)</option>
<option value="3840x2160">3840 x 2160 (16:9)</option>
</select>
<div class="slider">
<input type="range" min="1" max="200" value="100" id="resScale" oninput="scaleUpdate()">
<span id="resScaleText"></span><br>
<span id="resText"></span><br>
</div>
<button onclick="resize()">Save</button>
<p>Refresh this page to apply the changes</p>
</section>
</div>
</div>
<div id="right-toolbar-blockPicker"></div>
</div>
</body>
</html>