-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
542 lines (487 loc) · 22.4 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
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
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="icon" type="image/png" href="../bedrock.png">
<title>Manifest Generator</title>
<!-- update the version number as needed -->
<script defer src="/__/firebase/8.2.6/firebase-app.js"></script>
<!-- include only the Firebase features as you need -->
<script defer src="/__/firebase/8.2.6/firebase-auth.js"></script>
<script defer src="/__/firebase/8.2.6/firebase-database.js"></script>
<script defer src="/__/firebase/8.2.6/firebase-firestore.js"></script>
<script defer src="/__/firebase/8.2.6/firebase-functions.js"></script>
<script defer src="/__/firebase/8.2.6/firebase-messaging.js"></script>
<script defer src="/__/firebase/8.2.6/firebase-storage.js"></script>
<script defer src="/__/firebase/8.2.6/firebase-analytics.js"></script>
<script defer src="/__/firebase/8.2.6/firebase-remote-config.js"></script>
<script defer src="/__/firebase/8.2.6/firebase-performance.js"></script>
<!--
initialize the SDK after all desired features are loaded, set useEmulator to false
to avoid connecting the SDK to running emulators.
-->
<script defer src="/__/firebase/init.js?useEmulator=true"></script>
<style>
.text-focus-in {
-webkit-animation: text-focus-in 1s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
animation: text-focus-in 1s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
}
@-webkit-keyframes text-focus-in {
0% {
-webkit-filter: blur(12px);
filter: blur(12px);
opacity: 0;
}
100% {
-webkit-filter: blur(0px);
filter: blur(0px);
opacity: 1;
}
}
@keyframes text-focus-in {
0% {
-webkit-filter: blur(12px);
filter: blur(12px);
opacity: 0;
}
100% {
-webkit-filter: blur(0px);
filter: blur(0px);
opacity: 1;
}
}
</style>
</head>
<body class="p-4 ">
<div class="container text-left">
<div class="display-3 mb-5 text-focus-in "><b>Bedrock</b> Manifest Generator</div>
<div class="row my-5">
<h4 class="col-12">Choose a pack type:</h4>
<div class="col-sm-12 col-md-6 col-xl-3 p-3 ">
<button id="1" class="btn btn-light btn-block border p-4 pack-type rounded-0"
onclick="packType(this.id)">
<h4>Behaviour Pack</h4>
Functions, Animations
</button>
</div>
<div class="col-sm-12 col-md-6 col-xl-3 p-3 ">
<button id="2" class="btn btn-light btn-block border p-4 pack-type rounded-0"
onclick="packType(this.id)">
<h4>Resource Pack</h4>
Textures, Langs
</button>
</div>
<div class="col-sm-12 col-md-6 col-xl-3 p-3 ">
<button id="3" class="btn btn-light btn-block border p-4 pack-type rounded-0"
onclick="packType(this.id)">
<h4>Dependent Packs</h4>
Behaviour and Resource
</button>
</div>
<div class="col-sm-12 col-md-6 col-xl-3 p-3 ">
<button id="4" class="btn btn-light btn-block border p-4 pack-type rounded-0"
onclick="packType(this.id)">
<h4>Skin Pack</h4>
For skin (lol)
</button>
</div>
</div>
<div class="row">
<form class="col-12">
<div class="form-group">
<label for="packName">
<h4>Pack Name:</h4>
</label>
<input type="text" class="form-control form-control-lg" id="packName"
oninput="name_of_the_pack = this.value; validate();" aria-describedby="packName"
placeholder="Rotten Tomatoes Addon">
</div>
<div class="form-group">
<label for="packDesc">
<h4>Pack Description</h4>
</label>
<input type="text" class="form-control form-control-lg" id="packDesc"
oninput="desc_of_the_pack = this.value; validate();"
placeholder="Briefly describe what your pack is about">
</div>
</form>
<p>
<button class="btn text-dark btn-link" type="button" data-toggle="collapse"
data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
<h4>Optional Settings
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-caret-down-fill" viewBox="0 0 16 16">
<path
d="M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z" />
</svg>
</h4>
</button>
</p>
<div class="collapse col-12" id="collapseExample">
<div class="card card-body col-8">
<input type="text" class="form-control mb-3" placeholder="Author(s)"
oninput="authors = this.value;">
<input type="url" class="form-control mb-3" placeholder="URL" oninput="url=this.value;">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="defaultCheck1"
onchange="experimental_ui = checked;">
<label class="form-check-label" for="defaultCheck1">
Experimental UI
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="defaultCheck2"
onchange="chemistry = checked;">
<label class="form-check-label" for="defaultCheck2">
Chemistry
</label>
</div>
</div>
</div>
</div>
<div class="row mt-4">
<div class="col-sm-0 col-md-3 col-lg-4"></div>
<div class="col-sm-12 col-md-6 col-lg-4 text-center">
<button id="btnCreate" class="btn btn-primary p-4 btn-block rounded-0" disabled onclick="getUUID()">
<h3>Create Manifest</h3>
</button>
<small id="smallComplete" class="text-muted">Choose a type, name, desc, and <b>then</b> create</small>
</div>
<div class="col-sm-0 col-md-3 col-lg-4"></div>
</div>
<div id="manifest-show" class="row my-5 d-none">
<h4 class="col-12 text-muted text-center">Copy this to your manifest file</h4>
<div class="col-3 hideCenterers"></div>
<div class="col-6">
<pre id="jsonView" class="border" style="font-size:medium;">
teste de pre code
</pre>
</div>
<div class="col-3 hideCenterers"></div>
<div id="json2div" class="col-6">
<pre id="jsonView2" class="border" style="font-size: medium;">
teste de pre code
</pre>
</div>
</div>
<div class="fixed-bottom text-right p-1 pr-5 bg-dark text-white">
by
<svg xmlns="http://www.w3.org/2000/svg" id="Bold" enable-background="new 0 0 24 24" height="20" width="20"
style="fill:white" viewBox="0 0 24 24">
<path
d="m3.58 21.196h14.259l-.681-2.205 1.629 1.398 1.493 1.338 2.72 2.273v-21.525c-.068-1.338-1.22-2.475-2.648-2.475l-16.767.003c-1.427 0-2.585 1.139-2.585 2.477v16.24c0 1.411 1.156 2.476 2.58 2.476zm10.548-15.513-.033.012.012-.012zm-7.631 1.269c1.833-1.334 3.532-1.27 3.532-1.27l.137.135c-2.243.535-3.26 1.537-3.26 1.537s.272-.133.747-.336c3.021-1.188 6.32-1.102 9.374.402 0 0-1.019-.937-3.124-1.537l.186-.183c.291.001 1.831.055 3.479 1.26 0 0 1.844 3.15 1.844 7.02-.061-.074-1.144 1.666-3.931 1.726 0 0-.472-.534-.808-1 1.63-.468 2.24-1.404 2.24-1.404-.535.337-1.023.537-1.419.737-.609.268-1.219.4-1.828.535-2.884.468-4.503-.315-6.033-.936l-.523-.266s.609.936 2.174 1.404c-.411.469-.818 1.002-.818 1.002-2.786-.066-3.802-1.806-3.802-1.806 0-3.876 1.833-7.02 1.833-7.02z" />
<path
d="m14.308 12.771c.711 0 1.29-.6 1.29-1.34 0-.735-.576-1.335-1.29-1.335v.003c-.708 0-1.288.598-1.29 1.338 0 .734.579 1.334 1.29 1.334z" />
<path
d="m9.69 12.771c.711 0 1.29-.6 1.29-1.34 0-.735-.575-1.335-1.286-1.335l-.004.003c-.711 0-1.29.598-1.29 1.338 0 .734.579 1.334 1.29 1.334z" />
</svg>
<b>Calimero#2948</b>
</div>
</div>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin="anonymous"></script>
<script>
// check de cenas para criar o manifesto
var isTypeSelected = false;
var name_of_the_pack = " ";
var desc_of_the_pack = " ";
var data_type = " ";
var uuid_BP = " ";
var uuid_BP_module = " ";
var uuid_RP = " ";
var uuid_RP_module = " ";
var authors = " ";
var url = " ";
var experimental_ui = false;
var chemistry = false;
// Create a request variable and assign a new XMLHttpRequest object to it.
var request = new XMLHttpRequest()
function getUUID() {
// Open a new connection, using the GET request on the URL endpoint
request.open('GET', 'https://www.uuidtools.com/api/generate/v4/count/4', true)
request.onload = function (data) {
var data = JSON.parse(this.response)
if (request.status >= 200 && request.status < 400) {
console.log(data[0]);
console.log(data[1]);
console.log(data[2]);
console.log(data[3]);
console.log('---')
uuid_BP = data[0];
uuid_BP_module = data[1];
uuid_RP = data[2];
uuid_RP_module = data[3];
createManifest();
} else {
console.log('error')
}
}
// Send request
request.send()
}
$(function () { $('[data-toggle="tooltip"]').tooltip() })
// legacy, not used
function clipboard(manifest_id, btn_id) {
var copyText = document.getElementById(manifest_id);
copyText.select();
copyText.setSelectionRange(0, 99999);
document.execCommand("copy");
let sel = document.getSelection();
sel.removeAllRanges();
document.getElementById(btn_id).classList.add('btn-success');
document.getElementById(btn_id).classList.remove('btn-primary');
document.getElementById(btn_id).innerHTML = "Copied!";
setTimeout(() => {
document.getElementById(btn_id).innerHTML = "Copy to clipboard";
document.getElementById(btn_id).classList.add('btn-primary');
document.getElementById(btn_id).classList.remove('btn-success');
}, 1000);
}
//legacy. doesnt work, isnt used
function download(ta_id, filename) {
var text = document.getElementById(ta_id).value;
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
// to choose the pack type
function packType(buttonID) {
var buttons = document.getElementsByClassName("pack-type");
for (var i = 0; i < buttons.length; i++) {
try {
buttons[i].classList.remove("btn-primary");
buttons[i].classList.add("btn-light");
}
catch { }
}
var button = document.getElementById(buttonID);
button.classList.remove("btn-light");
button.classList.add("btn-primary");
isTypeSelected = true;
validate();
if (buttonID == "1") { data_type = "data" }
if (buttonID == "2") { data_type = "resource" }
if (buttonID == "3") { data_type = "dependant" }
if (buttonID == "4") { data_type = "skin" }
}
function validate() {
if (isTypeSelected && name_of_the_pack != " " && desc_of_the_pack != " ") {
document.getElementById('btnCreate').removeAttribute('disabled');
document.getElementById('smallComplete').classList.add('d-none');
}
}
function createManifest() {
//defining manifests here cause js is silly
// manifest for behaviour
var manifestB = {
"format_version": 2,
"header": {
"name": name_of_the_pack,
"description": desc_of_the_pack,
"uuid": uuid_BP,
"version": [1, 0, 0],
"min_engine_version": [1, 16, 0]
},
"modules": [
{
"type": "data",
"description": "_",
"uuid": uuid_BP_module,
"version": [1, 0, 0]
}
],
"capabilities": {
"experimental_custom_ui": experimental_ui,
"chemistry": chemistry
},
"metadata": {
"authors": authors,
"url": url
}
}
// manifest for resource
var manifestR = {
"format_version": 2,
"header": {
"name": name_of_the_pack,
"description": desc_of_the_pack,
"uuid": uuid_RP,
"version": [1, 0, 0],
"min_engine_version": [1, 16, 0]
},
"modules": [
{
"type": "resource",
"description": "_",
"uuid": uuid_RP_module,
"version": [1, 0, 0]
}
],
"capabilities": {
"experimental_custom_ui": experimental_ui,
"chemistry": chemistry
},
"metadata": {
"authors": authors,
"url": url
}
}
// manifest for dependant (bev + res)
var manifestD1 = {
"format_version": 2,
"header": {
"name": name_of_the_pack + " BP",
"description": desc_of_the_pack,
"uuid": uuid_BP,
"version": [1, 0, 0],
"min_engine_version": [1, 16, 0]
},
"modules": [
{
"type": "data",
"description": "_",
"uuid": uuid_BP_module,
"version": [1, 0, 0]
}
],
"dependencies": [
{
"uuid": uuid_RP,
"version": [1, 0, 0]
}
],
"capabilities": {
"experimental_custom_ui": experimental_ui,
"chemistry": chemistry
},
"metadata": {
"authors": authors,
"url": url
}
}
// manifest for dependant (bev + res)
var manifestD2 = {
"format_version": 2,
"header": {
"name": name_of_the_pack + " RP",
"description": desc_of_the_pack,
"uuid": uuid_RP,
"version": [1, 0, 0],
"min_engine_version": [1, 16, 0]
},
"modules": [
{
"type": "resource",
"description": "_",
"uuid": uuid_RP_module,
"version": [1, 0, 0]
}
],
"capabilities": {
"experimental_custom_ui": experimental_ui,
"chemistry": chemistry
},
"metadata": {
"authors": authors,
"url": url
}
}
// manifest for skin
var manifestS = {
"format_version": 2,
"header": {
"name": name_of_the_pack,
"description": desc_of_the_pack,
"uuid": uuid_BP,
"version": [1, 0, 0],
"min_engine_version": [1, 16, 0]
},
"modules": [
{
"type": "skin_pack",
"description": "_",
"uuid": uuid_RP,
"version": [1, 0, 0]
}
],
"capabilities": {
"experimental_custom_ui": experimental_ui,
"chemistry": chemistry
},
"metadata": {
"authors": authors,
"url": url
}
}
var cent = document.getElementsByClassName('hideCenterers');
var secondView = document.getElementById('json2div');
if (data_type == "data") {
document.getElementById('jsonView').textContent = JSON.stringify(manifestB, undefined, 2)
for (let i = 0; i < cent.length; i++) {
cent[i].style.display = "initial";
}
secondView.style.display = "none";
}
if (data_type == "resource") {
document.getElementById('jsonView').textContent = JSON.stringify(manifestR, undefined, 2)
for (let i = 0; i < cent.length; i++) {
cent[i].style.display = "initial";
}
secondView.style.display = "none";
}
if (data_type == "dependant") {
document.getElementById('jsonView').textContent = JSON.stringify(manifestD1, undefined, 2);
document.getElementById('jsonView2').textContent = JSON.stringify(manifestD2, undefined, 2);
for (let i = 0; i < cent.length; i++) {
cent[i].style.display = "none";
}
secondView.style.display = "block";
}
if (data_type == "skin") {
document.getElementById('jsonView').textContent = JSON.stringify(manifestS, undefined, 2)
for (let i = 0; i < cent.length; i++) {
cent[i].style.display = "initial";
}
secondView.style.display = "none";
}
document.getElementById('manifest-show').classList.remove('d-none');
}
</script>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/8.2.6/firebase-app.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="https://www.gstatic.com/firebasejs/8.2.6/firebase-analytics.js"></script>
<script>
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
var firebaseConfig = {
apiKey: "AIzaSyDR-VrHg29vGSUj4imiCophvf8LRJbgk2k",
authDomain: "bedrock-manifest.firebaseapp.com",
projectId: "bedrock-manifest",
storageBucket: "bedrock-manifest.appspot.com",
messagingSenderId: "809644085474",
appId: "1:809644085474:web:1e9faad84284763eeb4ebb",
measurementId: "G-FQ13RF4L28"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
</script>
</body>
</html>