-
Notifications
You must be signed in to change notification settings - Fork 0
/
collectibles.html
488 lines (462 loc) · 23.5 KB
/
collectibles.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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<!-- Bootstrap CSS -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N"
crossorigin="anonymous"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/bootstrap-table.min.css" />
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"
integrity="sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct"
crossorigin="anonymous"
></script>
<script defer src="js/dist/json-formatter.umd.js" charset="UTF-8"></script>
<script src="https://unpkg.com/[email protected]/dist/bootstrap-table.min.js"></script>
<title>Splatoon 3 - Collectibles Database</title>
<style>
body {
background-color: #e9ecef;
}
footer {
border-top: 1px solid rgba(86, 61, 124, 0.2);
}
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
.themed-grid-col {
padding-top: 15px;
padding-bottom: 15px;
background-color: rgba(86, 61, 124, 0.15);
border: 1px solid rgba(86, 61, 124, 0.2);
}
.parameterContent {
margin-top: 1em;
border: 1px solid rgba(54, 38, 78, 0.2);
background-color: rgba(34, 19, 56, 0.2);
}
h2 {
margin: 1rem;
}
h3 {
margin: 1rem;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<a class="navbar-brand" href="#">Collectibles Database</a>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarCollapse"
aria-controls="navbarCollapse"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse"></div>
</nav>
<main role="main">
<div class="jumbotron">
<div class="col-sm-8 mx-auto">
<h1>Splatoon 3 - Collectibles Database</h1>
<select class="form-control" id="language"></select>
<select class="form-control" id="version"></select>
<ul class="nav nav-tabs" id="modes" role="tablist"></ul>
<div class="tab-content" id="modeTabControl"></div>
</div>
</div>
<script type="module">
import {
generateHeader,
get_prefix,
localize,
get_image_tag,
format_img,
add_tab,
add_table,
uroko_array_formatter,
languages,
detectSplatoonLanguage,
mush_url,
byname_adjective_formatter,
byname_subject_simple_formatter,
convert_to_dict,
nameplate_formatter,
color_formatter,
badge_image_format,
badge_description_formatter,
locker_figure_image_formatter,
locker_figure_name_formatter,
emote_image_formatter,
emote_name_formatter,
} from "./js/Utility.js"
generateHeader($("#navbarCollapse"))
const prefix = get_prefix()
let version = "100"
window.lang_dict = {}
window.weapon_dict = {}
window.special_dict = {}
window.languages = languages
window.byname_adjective_formatter = byname_adjective_formatter
window.byname_subject_formatter = byname_subject_simple_formatter
window.nameplate_formatter = nameplate_formatter
window.color_formatter = color_formatter
window.uroko_array_formatter = uroko_array_formatter
window.badge_image_format = badge_image_format
window.badge_description_formatter = badge_description_formatter
window.locker_figure_image_formatter = locker_figure_image_formatter
window.locker_figure_name_formatter = locker_figure_name_formatter
window.emote_image_formatter = emote_image_formatter
window.emote_name_formatter = emote_name_formatter
$.getJSON(prefix + "versions.json", vers => {
let last = 0
vers.forEach(ver => {
if (ver === "099") {
$("#version").append(new Option("Testfire", ver))
} else {
$("#version").append(new Option(ver[0] + "." + ver[1] + "." + ver[2], ver))
}
last = ver
})
$("#version").val(last)
version = last
load_data()
})
for (const lang of Object.values(languages)) {
$("#language").append(new Option(lang["name"], lang["ext"]))
}
let current_lang = detectSplatoonLanguage()
if (typeof current_lang === "undefined") {
current_lang = "EUen"
}
window.change_lang = lang => {
current_lang = lang
load_data()
}
function load_lang() {
$.getJSON(`${prefix}data/language/${current_lang}.json`, d => {
for (const [key, value] of Object.entries(d)) {
lang_dict[key] = value
}
translate_menu()
})
}
function translate_menu() {
$("#title-tab").text(capitalizeFirstLetter(localize("CommonMsg/Glossary", "Byname")))
$("#nameplate-tab").text(capitalizeFirstLetter(localize("CommonMsg/Glossary", "NamePlateBg")))
//$("#badge-tab").text
//capitalizeFirstLetter(localize("LayoutMsg/Cmn_NmpEdit_00", "L_Tab_01-T_Text_00"))()
$("#locker-tab").text(capitalizeFirstLetter(localize("CommonMsg/Glossary", "NamePlateBg")))
$("#emote-tab").text(capitalizeFirstLetter(localize("CommonMsg/Glossary", "Emote")))
}
const capitalizeFirstLetter = string => string.charAt(0).toUpperCase() + string.slice(1)
const getNum = string => Number(string)
const getNum2 = string => getNum(string.slice(0, -2))
function load_data() {
load_lang()
$.getJSON(mush_url(version, "BynameAdjectiveInfo"), data_dict => {
const all_titles = convert_to_dict(data_dict, "Id")
$.getJSON(
`${prefix}data/parameter/${version}/byname/Adjective_${current_lang}.json`,
new_data_dict => {
const all_labels = []
new_data_dict.Labels.forEach(element => {
if (getNum(element) in all_titles) {
const e = all_titles[getNum(element)]
const row = {
Id: element,
HowToGet: e.HowToGet,
Season: e.Season,
}
all_labels.push(row)
}
})
$("#title-adjective-table").bootstrapTable("refreshOptions", {
data: all_labels,
})
}
)
})
$.getJSON(mush_url(version, "BynameSubjectInfo"), data_dict => {
const all_subs = convert_to_dict(data_dict, "Id")
$.getJSON(
`${prefix}data/parameter/${version}/byname/Subject_${current_lang}.json`,
subject_dict => {
const all_labels = []
subject_dict.Labels.forEach(element => {
if (getNum2(element) in all_subs) {
const e = all_subs[getNum2(element)]
const row = {
Id: element,
HowToGet: e.HowToGet,
Season: e.Season,
}
all_labels.push(row)
}
})
$("#title-subjective-table").bootstrapTable("refreshOptions", {
data: all_labels,
})
}
)
})
$.getJSON(mush_url(version, "NamePlateBgInfo"), data_dict => {
$("#nameplates-table").bootstrapTable("refreshOptions", { data: data_dict })
})
$.getJSON(mush_url(version, "WeaponInfoMain"), weapon_list => {
weapon_dict = convert_to_dict(weapon_list, "Id")
$.getJSON(mush_url(version, "WeaponInfoSpecial"), special_list => {
special_dict = convert_to_dict(special_list, "Id")
$.getJSON(mush_url(version, "BadgeInfo"), data_dict => {
data_dict.forEach(row => {
row["Description"] = { ...row }
})
$("#badge-table").bootstrapTable("refreshOptions", {
data: data_dict,
})
})
})
})
$.getJSON(mush_url(version, "LockerGoodsFigureInfo"), data_dict => {
$("#zakka-figure-table").bootstrapTable("refreshOptions", { data: data_dict })
})
$.getJSON(mush_url(version, "LockerGoodsMainPartInfo"), data_dict => {
$("#zakka-mainpart-table").bootstrapTable("refreshOptions", { data: data_dict })
})
$.getJSON(mush_url(version, "LockerGoodsStickerInfo"), data_dict => {
$("#zakka-sticker-table").bootstrapTable("refreshOptions", { data: data_dict })
})
$.getJSON(mush_url(version, "LockerGoodsSubPartInfo"), data_dict => {
$("#zakka-subpart-table").bootstrapTable("refreshOptions", { data: data_dict })
})
$.getJSON(mush_url(version, "EmoteInfo"), data_dict => {
$("#emote-table").bootstrapTable("refreshOptions", { data: data_dict })
})
}
$(function () {
$("#version").change(function () {
version = $(this).val()
load_data()
})
$("#language").val(current_lang)
$("#language").change(function () {
change_lang($(this).val())
})
add_tab("title", "Title")
add_tab("nameplate", "Namplate")
add_tab("badge", "Badge")
add_tab("zakka", "Locker")
add_tab("emote", "Emotes")
add_table(
"title",
"title-adjective-table",
[
{ Field: "Id", Label: "Internal ID", visible: "false", sortable: "true" },
{ Field: "Id", Label: "Name", formatter: "byname_adjective_formatter", sortable: "true" },
{ Field: "HowToGet", Label: "How To Get", sortable: "true" },
{ Field: "Season", Label: "Season", sortable: "true" },
],
"Adjectives"
)
add_table(
"title",
"title-subjective-table",
[
{ Field: "Id", Label: "Internal ID", visible: "false", sortable: "true" },
{ Field: "Id", Label: "Name", formatter: "byname_subject_formatter", sortable: "true" },
{ Field: "HowToGet", Label: "How To Get", sortable: "true" },
{ Field: "Season", Label: "Season", sortable: "true" },
],
"Subjects"
)
add_table("nameplate", "nameplates-table", [
{ Field: "Id", Label: "Internal ID", visible: "false", sortable: "true" },
{ Field: "__RowId", Label: "Image", formatter: "nameplate_formatter" },
{ Field: "TextColor", Label: "Text Color", formatter: "color_formatter" },
{ Field: "HowToGet", Label: "How To Get", sortable: "true" },
{ Field: "Season", Label: "Season", sortable: "true" },
{ Field: "UrokoPrice", Label: "Fish Scale Price", formatter: "uroko_array_formatter" },
{ Field: "UrokoUhlockLevel", Label: "Fish Scale Price", sortable: "true" },
])
add_table("badge", "badge-table", [
{ Field: "Id", Label: "Internal ID", visible: "false", sortable: "true" },
{ Field: "__RowId", Label: "Image", formatter: "badge_image_format" },
{ Field: "Category", Label: "Category", visible: "false", sortable: "true" },
{ Field: "Description", Label: "How To Unlock", formatter: "badge_description_formatter" },
])
add_table(
"zakka",
"zakka-figure-table",
[
{ Field: "Id", Label: "Internal ID", visible: "false", sortable: "true" },
{ Field: "__RowId", Label: "Image", formatter: "locker_figure_image_formatter" },
{
Field: "__RowId",
Label: "Name",
formatter: "locker_figure_name_formatter",
sortable: "true",
},
{ Field: "HowToGet", Label: "How To Get", sortable: "true" },
{ Field: "MaxNumberOfPossessions", Label: "Max Number Of Possessions", sortable: "true" },
{ Field: "Price", Label: "Price", sortable: "true" },
{ Field: "Rarity", Label: "Rarity", sortable: "true" },
{ Field: "Season", Label: "Season", sortable: "true" },
{
Field: "UrokoPrice",
Label: "Fish Scale Price",
sortable: "true",
formatter: "uroko_array_formatter",
},
{
Field: "UrokoUnlockLevel",
Label: "Fish Scale Unlock Level",
sortable: "true",
},
],
"Figures"
)
add_table(
"zakka",
"zakka-mainpart-table",
[
{ Field: "Id", Label: "Internal ID", visible: "false", sortable: "true" },
{ Field: "__RowId", Label: "Image", formatter: "locker_figure_image_formatter" },
{
Field: "__RowId",
Label: "Name",
formatter: "locker_figure_name_formatter",
sortable: "true",
},
{ Field: "HowToGet", Label: "How To Get", sortable: "true" },
{ Field: "MaxNumberOfPossessions", Label: "Max Number Of Possessions", sortable: "true" },
{ Field: "Price", Label: "Price", sortable: "true" },
{ Field: "Rarity", Label: "Rarity", sortable: "true" },
{ Field: "Season", Label: "Season", sortable: "true" },
{
Field: "UrokoPrice",
Label: "Fish Scale Price",
sortable: "true",
formatter: "uroko_array_formatter",
},
{
Field: "UrokoUnlockLevel",
Label: "Fish Scale Unlock Level",
sortable: "true",
},
],
"Main Parts"
)
add_table(
"zakka",
"zakka-sticker-table",
[
{ Field: "Id", Label: "Internal ID", visible: "false", sortable: "true" },
{ Field: "__RowId", Label: "Image", formatter: "locker_figure_image_formatter" },
{
Field: "__RowId",
Label: "Name",
formatter: "locker_figure_name_formatter",
sortable: "true",
},
{ Field: "HowToGet", Label: "How To Get", sortable: "true" },
{ Field: "MaxNumberOfPossessions", Label: "Max Number Of Possessions", sortable: "true" },
{ Field: "Price", Label: "Price", sortable: "true" },
{ Field: "Rarity", Label: "Rarity", sortable: "true" },
{ Field: "Season", Label: "Season", sortable: "true" },
{
Field: "UrokoPrice",
Label: "Fish Scale Price",
sortable: "true",
formatter: "uroko_array_formatter",
},
{
Field: "UrokoUnlockLevel",
Label: "Fish Scale Unlock Level",
sortable: "true",
},
],
"Sticker"
)
add_table(
"zakka",
"zakka-subpart-table",
[
{ Field: "Id", Label: "Internal ID", visible: "false", sortable: "true" },
{ Field: "__RowId", Label: "Image", formatter: "locker_figure_image_formatter" },
{
Field: "__RowId",
Label: "Name",
formatter: "locker_figure_name_formatter",
sortable: "true",
},
{ Field: "HowToGet", Label: "How To Get", sortable: "true" },
{ Field: "MaxNumberOfPossessions", Label: "Max Number Of Possessions", sortable: "true" },
{ Field: "Price", Label: "Price", sortable: "true" },
{ Field: "Rarity", Label: "Rarity", sortable: "true" },
{ Field: "Season", Label: "Season", sortable: "true" },
{
Field: "UrokoPrice",
Label: "Fish Scale Price",
sortable: "true",
formatter: "uroko_array_formatter",
},
{
Field: "UrokoUnlockLevel",
Label: "Fish Scale Unlock Level",
sortable: "true",
},
],
"Sub Parts"
)
add_table(
"emote",
"emote-table",
[
{ Field: "Id", Label: "Internal ID", visible: "false", sortable: "true" },
{ Field: "__RowId", Label: "Image", formatter: "emote_image_formatter" },
{ Field: "__RowId", Label: "Name", formatter: "emote_name_formatter", sortable: "true" },
{ Field: "HowToGet", Label: "How To Get", sortable: "true" },
{ Field: "Season", Label: "Season", sortable: "true" },
],
"Adjectives"
)
})
</script>
</main>
<footer class="footer" id="footer">
<script type="module">
import { generateFooter } from "./js/Utility.js"
generateFooter($("#footer"))
</script>
</footer>
</body>
</html>