-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathindex.html
More file actions
477 lines (399 loc) · 18.1 KB
/
Copy pathindex.html
File metadata and controls
477 lines (399 loc) · 18.1 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
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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JSON-UI Builder</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Top Navigation Bar -->
<div class="top-navbar">
<div class="navbar-left">
<div class="importers">
<label class="ui_textures_importer">
<input title="Import Textures" type="file" id="ui_textures_importer"
onchange="Builder.handleUiTexturesUpload()" webkitdirectory directory multiple />
Import Textures
</label>
<label class="form_importer">
<input title="Upload Form" type="file" id="form_importer" onchange="Builder.uploadForm()" accept=".json" />
Upload Form
</label>
</div>
</div>
<div class="navbar-center">
<!-- Authentication UI -->
<div id="authStatus" class="auth-status-inline">
<span id="authUserDisplay">Not signed in</span>
<button id="authSignInBtn" onclick="Builder.openAuthModal(false)">Sign In</button>
<button id="authSignUpBtn" onclick="Builder.openAuthModal(true)">Sign Up</button>
<button id="authLogoutBtn" onclick="Builder.logout()" style="display: none;">Logout</button>
</div>
<!-- Preset buttons -->
<button id="presetUploadBtn" onclick="Builder.openUploadPresetModal()" style="display: none;" class="navbar-preset-btn primary">Upload Preset</button>
<button id="presetManagementBtn" onclick="Builder.openPresetManagementModal()" style="display: none;" class="navbar-preset-btn secondary">Manage Presets</button>
<button class="navbar-preset-btn tertiary" onclick="Builder.texturePresetsModal()">Preset Textures</button>
<div class="navbar-divider"></div>
<button class="modalSettingsBtn" id="modalSettingsBtn">
<span class="settings_label">Settings</span>
<img class="settings_img" src="icons/settings_cog.webp" alt="Settings">
</button>
<div class="scale-control">
<label for="ui_scale_slider" style="color: white; font-size: 12px; margin-right: 5px;">Scale:</label>
<input id="ui_scale_slider" type="range" min="10" max="100">
</div>
<button id="undo-btn" onclick="Builder.undo()" disabled title="Undo (Ctrl+Z)">↶ Undo</button>
<button id="redo-btn" onclick="Builder.redo()" disabled title="Redo (Ctrl+Y)">↷ Redo</button>
</div>
<div class="navbar-right">
<img src="icons/help.webp" class="help_button" onclick="Builder.openHelpMenu()" alt="Help">
<a href="https://discord.gg/zqfNbYCcA9" class="discord_link" target="_blank">
<img src="icons/discord.webp" class="discord_icon" alt="Discord">
</a>
</div>
</div>
<!-- The Settings Modal -->
<div id="modalSettings" class="modal">
<div class="modal-content">
<span id="modalSettingsClose" class="modalClose">×</span>
<h2 class="modalHeader">Settings</h2>
<div class="modalSettingsForm">
</div>
</div>
</div>
<!--------------->
<!-- The Add Button Modal -->
<div id="modalAddButton" class="modal">
<div class="modal-content">
<span id="modalAddButtonClose" class="modalClose">×</span>
<h2 class="modalHeader">Add Button</h2>
<div class="modalAddButtonForm">
</div>
</div>
</div>
<!--------------->
<!-- The Create Form Modal -->
<div id="modalCreateForm" class="modal">
<div class="modal-content">
<h2 class="modalHeader">Create Form</h2>
<div class="modalCreateFormForm">
</div>
</div>
</div>
<!--------------->
<!-- The Load Texture Presets Modal -->
<div id="modalLoadTexturePresets" class="modal">
<div class="modal-content">
<span id="modalLoadTexturePresetsClose" class="modalClose">×</span>
<h2 class="modalHeader">Load Texture Presets</h2>
<div class="modalLoadTexturePresetsForm">
</div>
</div>
</div>
<!--------------->
<!-- The Help Menu Modal -->
<div id="modalHelpMenu" class="modal">
<div class="modal-content">
<span id="modalHelpMenuClose" class="modalClose">×</span>
<h2 class="modalHeader">Help</h2>
<div class="modalHelpMenuForm">
<label style="font-weight: 500; color: rgb(255, 255, 255);">Key Binds:</label><br><br>
<label class="modalOptionLabel">
CTRL + c: <b>Copy</b><br>
CTRL + v: <b>Paste</b><br>
CTRL + x: <b>Cut</b><br>
Tab: <b>Indent</b><br>
Del: <b>Delete</b><br>
Tab | Enter: <b>Autocomplete</b><br>
Arrow Keys: <b>Move</b>
</label><br><br><br>
<label style="font-weight: 500; color: rgb(255, 255, 255); font-size: 20px;">General
Issues:</label><br><br>
<label style="font-weight: 500; color: rgb(255, 255, 255);">Why arent my buttons working
in-game?</label><br><br>
<label class="modalOptionLabel">You probably need to stack the button on top of a collection panel, if
that doesnt fix it, check that all texture paths are correct</label><br><br>
<label style="font-weight: 500; color: rgb(255, 255, 255);">Why isnt the form uploader
working?</label><br><br>
<label class="modalOptionLabel">The form uploader can only upload forms made by the website</label>
</div>
</div>
</div>
<!--------------->
<!-- The Choose Image Modal -->
<div id="modalChooseImage" class="modal">
<div class="modal-content">
<span id="modalChooseImageClose" class="modalClose">×</span>
<h2 class="modalHeader">Choose Image</h2>
<img src="icons/nineslice.webp" style="width: 20px; position: relative; top: 5px; left: 5px;" alt="Nineslice">
<label style="font-weight: 500; color: rgb(255, 255, 255);">: Nineslice Image</label>
<div class="modalChooseImageForm">
</div>
</div>
</div>
<!--------------->
<div class="main">
<div class="buttons">
<div class="addElements">
Elements:
<button type="button" onclick="Builder.addPanel()">Add panel</button>
<button type="button" onclick="Builder.openAddImageMenu()">Add image</button>
<button type="button" onclick="Builder.addButton()">Add button</button>
<button type="button" onclick="Builder.addCollectionPanel()">Add Collection Panel</button>
<button type="button" onclick="Builder.addLabel()">Add Label</button>
<button type="button" onclick="Builder.addScrollingPanel()">Add Scrolling Panel</button>
</div>
<div class="breaker"></div>
<div class="utilElements">
<button class="utilElement" type="button" onclick="Builder.reset()">Reset <img
style="width: 17px; top: 3px; position: relative; filter: drop-shadow(0px 0px 5px #000000);"
src="icons/reset.webp" alt="Reset"> </button>
<button class="utilElement" type="button" onclick="Builder.deleteSelected()">Delete Selected <img
style="width: 20px; top: 3px; position: relative; filter: drop-shadow(0px 0px 5px #000000);"
src="icons/bin.webp" alt="Delete"> </button>
<div style="display:flex; flex-direction: row; justify-content: center; align-items: center">
<div class="utilElement" style="width: 100%;">Form</div>
<img class="utilElement" title="Copy" onclick="Builder.generateAndCopyJsonUI('copy')"
style="width: 20px; position: relative; filter: drop-shadow(0px 0px 5px #000000); cursor: pointer;"
src="icons/clipboard.webp" alt="Copy">
<img class="utilElement" title="Download" onclick="Builder.generateAndCopyJsonUI('download')"
style="width: 20px; position: relative; filter: drop-shadow(0px 0px 5px #000000); cursor: pointer;"
src="icons/download.webp" alt="Download">
</div>
<div style="display:flex; flex-direction: row; justify-content: center; align-items: center">
<div class="utilElement" style="width: 100%;">Server-Form</div>
<img class="utilElement" title="Copy" onclick="Builder.downloadServerForm('copy')"
style="width: 20px; position: relative; filter: drop-shadow(0px 0px 5px #000000); cursor: pointer;"
src="icons/clipboard.webp" alt="Copy">
<img class="utilElement" title="Download" onclick="Builder.downloadServerForm('download')"
style="width: 20px; position: relative; filter: drop-shadow(0px 0px 5px #000000); cursor: pointer;"
src="icons/download.webp" alt="Download">
</div>
</div>
<div class="breaker"></div>
<div id="explorer" class="explorer"></div>
</div>
<div class="main_window_outline">
<div class="main_window" id="main_window">
<img title="Background" src="background.png" width="100%" height="100%" class="bg_image" id="bg_image" alt="Background">
</div>
</div>
<div class="scripter">
<div class="scripter_title_label">Script</div>
<div style="color: rgb(139, 139, 139);">For Fixed Collection Index Forms Only</div>
<div class="scripter_buttons">
<button class="generate_js_scripter" id="generate_js_scripter">Copy <img
style="width: 18px; top: 3px; position: relative; filter: drop-shadow(0px 0px 5px #000000);"
src="icons/js.webp" alt="JavaScript"> To Clipboard</button>
<button class="generate_ts_scripter" id="generate_ts_scripter">Copy <img
style="width: 18px; top: 3px; position: relative; filter: drop-shadow(0px 0px 5px #000000);"
src="icons/ts.webp" alt="TypeScript"> To Clipboard</button>
</div>
<br><br><br>
<div class="scripter_title_label">Bindings</div>
<div style="color: rgb(139, 139, 139);">Advanced Feature</div>
<div id="errorMessage" title="Default Error Message" style="visibility: hidden; color: #7e0000;">Warnings ⚠️
</div>
<textarea spellcheck="false" readonly class="bindings" id="bindings"></textarea>
<div style="display:flex; flex-direction: row; justify-content: center; align-items: center">
<div style="font-size: 20px; color: rgb(39, 165, 255);">TAB</div>  To indent
<div onclick="Builder.formatBindingsArea()" style="position: relative; margin-left: 15px; cursor: pointer;"
class="utilElement">Format <img
style="width: 20px; top: 3px; position: relative; filter: drop-shadow(0px 0px 5px #000000);"
src="icons/curly_brackets.webp" alt="Format"></div>
</div>
</div>
</div>
<div id="properties" class="properties"></div>
<div id="notif-container"></div>
<div id="mainWarningMessage"></div>
<script src="./dist/index.js" type="module"></script>
<style>
/* Top Navigation Bar */
.top-navbar {
position: fixed;
top: 0;
left: 0;
right: 0;
min-height: 60px;
background-color: linear-gradient(135deg, rgb(58, 58, 58, 0.95), rgb(0, 0, 0, 0.95));
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
backdrop-filter: blur(10px);
z-index: 999;
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 15px;
flex-wrap: wrap;
gap: 10px;
}
.navbar-left,
.navbar-center,
.navbar-right {
display: flex;
align-items: center;
gap: 10px;
}
.navbar-center {
flex: 1;
justify-content: center;
flex-wrap: wrap;
gap: 10px;
}
.navbar-divider {
width: 1px;
height: 30px;
background: rgba(255, 255, 255, 0.2);
margin: 0 5px;
}
.navbar-right {
gap: 15px;
}
.scale-control {
display: flex;
align-items: center;
}
#undo-btn,
#redo-btn {
font-size: 13px;
padding: 8px 12px;
background: linear-gradient(135deg, #444, #333);
color: white;
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 6px;
cursor: pointer;
transition: all 0.3s ease;
white-space: nowrap;
}
#undo-btn:hover:not(:disabled),
#redo-btn:hover:not(:disabled) {
background: linear-gradient(135deg, #555, #444);
transform: translateY(-1px);
}
#undo-btn:disabled,
#redo-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Authentication Status - Inline in navbar */
.auth-status-inline {
display: flex;
align-items: center;
gap: 8px;
background: linear-gradient(135deg, rgba(0, 0, 0, 0.6), rgba(20, 20, 20, 0.6));
padding: 6px 10px;
border-radius: 6px;
border: 1px solid rgba(255, 255, 255, 0.15);
}
.auth-status-inline span {
color: white;
font-size: 12px;
font-weight: 500;
white-space: nowrap;
}
.auth-status-inline button {
padding: 6px 12px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 11px;
font-weight: 600;
transition: all 0.3s ease;
white-space: nowrap;
}
#authSignInBtn,
#authSignUpBtn {
background: linear-gradient(135deg, #007bff, #0056b3);
color: white;
}
#authSignInBtn:hover,
#authSignUpBtn:hover {
background: linear-gradient(135deg, #0056b3, #004085);
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}
#authLogoutBtn {
background: linear-gradient(135deg, #dc3545, #c82333);
color: white;
}
#authLogoutBtn:hover {
background: linear-gradient(135deg, #c82333, #bd2130);
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}
/* Preset buttons in navbar */
.navbar-preset-btn {
padding: 8px 14px;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 12px;
font-weight: 600;
transition: all 0.3s ease;
white-space: nowrap;
}
.navbar-preset-btn.primary {
background: linear-gradient(135deg, #28a745, #218838);
color: white;
}
.navbar-preset-btn.primary:hover {
background: linear-gradient(135deg, #218838, #1e7e34);
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}
.navbar-preset-btn.secondary {
background: linear-gradient(135deg, #17a2b8, #138496);
color: white;
}
.navbar-preset-btn.secondary:hover {
background: linear-gradient(135deg, #138496, #117a8b);
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}
.navbar-preset-btn.tertiary {
background: linear-gradient(135deg, #6f42c1, #5a32a3);
color: white;
}
.navbar-preset-btn.tertiary:hover {
background: linear-gradient(135deg, #5a32a3, #4c2a8a);
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(111, 66, 193, 0.3);
}
/* Adjust main content to account for navbar */
.main {
margin-top: 70px;
}
/* Responsive adjustments */
@media (max-width: 1600px) {
.navbar-center {
max-width: none;
}
}
@media (max-width: 1200px) {
.auth-status-inline span {
display: none;
}
}
@media (max-width: 768px) {
.top-navbar {
flex-direction: column;
padding: 10px;
}
.navbar-left,
.navbar-center,
.navbar-right {
width: 100%;
justify-content: center;
flex-wrap: wrap;
}
.navbar-divider {
display: none;
}
.main {
margin-top: 160px;
}
}
</style>
</body>
</html>