Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
207 lines (207 loc) · 8.83 KB
/
Copy pathindex.html
File metadata and controls
207 lines (207 loc) · 8.83 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="css/styles.css" />
<script src="https://cdn.tailwindcss.com"></script>
<script defer src="js/state.js"></script>
<script defer src="js/settings.js"></script>
<script defer src="js/shapes.js"></script>
<script defer src="js/renderer.js"></script>
<script defer src="js/sliders.js"></script>
<script defer src="js/info.js"></script>
<script defer src="js/chooser.js"></script>
</head>
<body class="select-none overflow-hidden bg-slate-600">
<div id="info" class="fixed top-4 right-4 z-10 text-white w-32">
<p>Debug Info</p>
<div id="currentYaw">
Yaw: <span id="yawValue">0</span>°
</div>
<div id="currentPitch">
Pitch: <span id="pitchValue">0</span>°
</div>
<div id="currentCameraPosition">
Camera XYZ: <span id="cameraPositionValue">0, 0, 0</span>
</div>
<div id="currentWorldOffset">
World XYZ: <span id="worldOffsetValue">0, 0, 0</span>
</div>
<div id="currentFPS">
FPS: <span id="fpsValue">0</span>
</div>
</div>
<div id="chooser" class="fixed bottom-4 right-4 z-10 text-white">
<div class="mb-2 flex items-center">
<label for="shapeChooser" class="mr-2">Shape:</label>
<select id="shapeChooser" class="rounded bg-slate-700 p-1 text-white">
<option value="">Loading shapes...</option>
</select>
</div>
<div class="flex items-center">
<label for="textureSelect" class="mr-2">Texture:</label>
<select id="textureSelect" class="rounded bg-slate-700 p-1 text-white">
<option value="">Loading textures...</option>
</select>
</div>
</div>
<button id="settings-toggle" type="button" aria-controls="sliders" aria-expanded="true" aria-label="Hide settings">
<span id="settings-toggle-label">Hide settings</span>
<span class="settings-toggle-icon" aria-hidden="true"></span>
</button>
<div id="sliders" class="fixed z-10 text-white">
<details class="slider-container" name="settings">
<summary>Dimensions</summary>
<div class="border-settings">
<div class="setting-field">
<div class="setting-field-heading">
<label for="shapeWidth">X (width)</label>
<span><span id="widthValue">0</span> px</span>
</div>
<input type="range" id="shapeWidth" class="w-18" min="10" max="1000" value="100" />
</div>
<div class="setting-field">
<div class="setting-field-heading">
<label for="shapeHeight">Y (height)</label>
<span><span id="heightValue">0</span> px</span>
</div>
<input type="range" id="shapeHeight" class="w-18" min="10" max="1000" value="100" />
</div>
<div class="setting-field">
<div class="setting-field-heading">
<label for="shapeDepth">Z (depth)</label>
<span><span id="depthValue">0</span> px</span>
</div>
<input type="range" id="shapeDepth" class="w-18" min="10" max="1000" value="100" />
</div>
</div>
</details>
<details class="slider-container" name="settings">
<summary>Camera</summary>
<div class="border-settings">
<div class="setting-field">
<div class="setting-field-heading">
<label for="smoothness">Smoothness</label>
<span id="smoothnessValue">0</span>
</div>
<input type="range" id="smoothness" class="w-18" min="0.01" max="1" step="0.01" value="0.50" />
</div>
<div class="setting-field">
<div class="setting-field-heading">
<label for="zoom">Camera Zoom</label>
<span id="zoomValue">0</span>
</div>
<input type="range" id="zoom" class="w-18" min="-10" max="10" step="0.10" value="0" />
</div>
<div class="setting-field">
<div class="setting-field-heading">
<label for="scale">Face Scale</label>
<span id="scaleValue">1</span>
</div>
<input type="range" id="scale" class="w-18" min="1" max="10" step="1" value="1" />
</div>
<div class="setting-field">
<div class="setting-field-heading">
<label for="sensitivity">Drag Sensitivity</label>
<span id="sensitivityValue">0</span>
</div>
<input type="range" id="sensitivity" class="w-18" min="1" max="200" step="1" value="100" />
</div>
<div class="setting-field">
<div class="setting-field-heading">
<label for="perspective">FOV (Perspective)</label>
<span id="perspectiveValue">0</span>
</div>
<input type="range" id="perspective" class="w-18" min="500" max="3000" step="100" value="1000" />
</div>
</div>
</details>
<details class="slider-container" name="settings">
<summary>World Grid</summary>
<div class="border-settings">
<label class="flex items-center gap-2 text-sm font-medium" for="gridXY">
<input type="checkbox" id="gridXY" class="h-4 w-4" />
XY plane
</label>
<label class="flex items-center gap-2 text-sm font-medium" for="gridXZ">
<input type="checkbox" id="gridXZ" class="h-4 w-4" checked />
XZ plane (floor)
</label>
<label class="flex items-center gap-2 text-sm font-medium" for="gridYZ">
<input type="checkbox" id="gridYZ" class="h-4 w-4" />
YZ plane
</label>
</div>
</details>
<details class="slider-container" name="settings">
<summary>Face Borders</summary>
<div class="border-settings">
<label class="flex items-center gap-2 text-sm font-medium" for="borderToggle">
<input type="checkbox" id="borderToggle" class="h-4 w-4" />
Enabled
</label>
<label class="setting-field" for="borderColor">
Color
<input type="color" id="borderColor" />
</label>
<div class="setting-field">
<div class="setting-field-heading">
<label for="borderWidth">Width</label>
<span><span id="borderWidthValue">1</span> px</span>
</div>
</div>
</div>
</details>
<details class="slider-container" name="settings">
<summary>Lighting</summary>
<div class="border-settings">
<label class="flex items-center gap-2 text-sm font-medium" for="lightingEnabled">
<input type="checkbox" id="lightingEnabled" class="h-4 w-4" checked />
Enabled
</label>
<label class="setting-field" for="lightingColor">
Color
<input type="color" id="lightingColor" value="#ffffff" />
</label>
<div class="setting-field">
<div class="setting-field-heading">
<label for="lightingIntensity">Intensity</label>
<span><span id="lightingIntensityValue">35</span>%</span>
</div>
<input type="range" id="lightingIntensity" class="w-18" min="0" max="100" step="1" value="35" />
</div>
<div class="setting-field">
<div class="setting-field-heading">
<label for="lightingAzimuth">Azimuth</label>
<span><span id="lightingAzimuthValue">315</span>°</span>
</div>
<input type="range" id="lightingAzimuth" class="w-18" min="0" max="359" step="1" value="315" />
</div>
<div class="setting-field">
<div class="setting-field-heading">
<label for="lightingElevation">Elevation</label>
<span><span id="lightingElevationValue">35</span>°</span>
</div>
<input type="range" id="lightingElevation" class="w-18" min="-90" max="90" step="1" value="35" />
</div>
<div class="setting-field">
<div class="setting-field-heading">
<label for="lightingSoftness">Softness</label>
<span><span id="lightingSoftnessValue">72</span>%</span>
</div>
<input type="range" id="lightingSoftness" class="w-18" min="5" max="100" step="1" value="72" />
</div>
</div>
</details>
</div>
<div id="render" class="flex min-h-screen min-w-screen items-center justify-center">
<div class="world">
<div class="world-grid world-grid-xy"></div>
<div class="world-grid world-grid-xz"></div>
<div class="world-grid world-grid-yz"></div>
<div class="shape"></div>
</div>
</div>
</body>
</html>