-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrecommended-backpacks-maker.js
164 lines (160 loc) · 5.65 KB
/
recommended-backpacks-maker.js
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
const pathName = window.location.pathname;
const pathArr = pathName.split('/');
const pageName = pathArr[pathArr.length - 1];
const characterName = pageName.split('.')[0];
const recommendedBackpacks = {
billy: {
"Champion's Backpack": "3344343455",
"Assassin's Starter-Kit": "2244242455",
"Choose Goose's Lootbox": "2211212145",
"Nurse Pound Cake's Medkit": "2255252533",
"Techno Tank": "3355353544"
},
bmo: {
"Champion's Backpack": "3344343455",
"Assassin's Starter-Kit": "2244242455",
"Techno Tank": "3355353544",
"Bily's Bag": "1133131355",
"Sorcerous Satchel": "3344343415"
},
cb: {
"Assassin's Starter-Kit": "2244242455",
"Candy Monarch Regalia": "1122121235",
"Daredevil's Duffel Bag": "1122121244",
"Nearly Ultimate Wizard Wear": "2244242433"
},
finn: {
"Assassin's Starter-Kit": "1133131355",
"Nurse Pound Cake's Medkit": "2255252533",
"Bily's Bag": "1133131355",
"Susan's Shredder": "1133131355"
},
fionna: {
"Assassin's Starter-Kit": "1133131355",
"Bily's Bag": "1133131355",
"Huntress Wizard's Arsenal": "1133131345",
"Susan's Shredder": "1133131355"
},
fp: {
"Assassin's Starter-Kit": "1122121233",
"Susan's Shredder": "1133131355"
},
gunter: {
"Assassin's Starter-Kit": "1133131355",
"Assassin's Starter-Kit": "2244242455",
"Bily's Bag": "1133131355",
"Nearly Ultimate Wizard Wear": "2244242433",
"Huntress Wizard's Arsenal": "1133131345",
"Susan's Shredder": "1133131355"
},
hunson: {
"Champion's Backpack": "3344343455",
"Techno Tank": "3355353544",
},
iceking: {
"Assassin's Starter-Kit": "2244242455",
"Huntress Wizard's Arsenal": "1122121245",
"Candy Monarch Regalia": "1122121235",
"Daredevil's Duffel Bag": "2211212144",
"Nearly Ultimate Wizard Wear": "2244242433"
},
jake: {
"Champion's Backpack": "3344343455",
"Techno Tank": "3355353544",
"Sorcerous Satchel": "3344343415"
},
lemongrab: {
"Champion's Backpack": "3344343455",
"Techno Tank": "3355353544",
"Sorcerous Satchel": "3344343415"
},
lich: {
"Assassin's Starter-Kit": "1133131355",
"Assassin's Starter-Kit": "2244242455",
"Candy Monarch Regalia": "1122121235",
"Daredevil's Duffel Bag": "2211212144",
"Nearly Ultimate Wizard Wear": "2244242433"
},
lsp: {
"Assassin's Starter-Kit": "2244242455",
"Nurse Pound Cake's Medkit": "2255252533",
"Daredevil's Duffel Bag": "2211212144",
"Nearly Ultimate Wizard Wear": "2244242433"
},
magicman: {
"Assassin's Starter-Kit": "1133131355",
"Bily's Bag": "1133131355"
},
marceline: {
"Assassin's Starter-Kit": "2244242455",
"Huntress Wizard's Arsenal": "1122121245",
"Candy Monarch Regalia": "1122121235",
"Daredevil's Duffel Bag": "2211212144",
"Nearly Ultimate Wizard Wear": "2244242433"
},
neptr: {
"Choose Goose's Lootbox": "2211212145",
"Huntress Wizard's Arsenal": "1122121245",
"Candy Monarch Regalia": "1122121235",
"Daredevil's Duffel Bag": "2211212144",
"Nearly Ultimate Wizard Wear": "2244242433"
},
pepbut: {
"Champion's Backpack": "3344343455",
"Techno Tank": "3355353544",
"Huntress Wizard's Arsenal": "1133131345",
},
pb: {
"Huntress Wizard's Arsenal": "1133131345",
"Huntress Wizard's Arsenal": "1122121245",
"Daredevil's Duffel Bag": "2211212144",
"Bily's Bag": "1133131355",
"Nearly Ultimate Wizard Wear": "2244242433"
},
rattleballs: {
"Assassin's Starter-Kit": "1133131355",
"Bily's Bag": "1133131355"
}
}
function getBackpackPageName(displayBagName) {
switch (displayBagName) {
case "Assassin's Starter-Kit":
return "assassin-starter-kit.html";
case "Bily's Bag":
return "billy-bag.html";
case "Champion's Backpack":
return "champions-backpack.html";
case "Choose Goose's Lootbox":
return "choose-goose-lootbox.html";
case "Daredevil's Duffel Bag":
return "daredevil-duffel-bag.html";
case "Huntress Wizard's Arsenal":
return "huntress-wizard-arsenal.html";
case "Nurse Pound Cake's Medkit":
return "nurse-poundcake-medkit.html";
case "Susan's Shredder":
return "susan-shredder.html";
default: return `${displayBagName.toLowerCase().replaceAll(' ', '-')}.html`;
}
}
function buildRecommendedBackpacks(bagData) {
const section = document.getElementById('recommended-backpacks');
const ulElement = document.createElement('ul');
ulElement.classList.add('wiki-list', 'wiki-backpacks-list');
for (const key in bagData) {
let liElement = document.createElement('li');
let aElement = document.createElement('a');
aElement.classList.add('wiki-link');
let backpackPageName = getBackpackPageName(key);
aElement.setAttribute('href', `../backpacks/${backpackPageName}`)
aElement.textContent = key + " ";
let liText = bagData[key].split('').join(' > ');
liElement.appendChild(aElement);
let node = document.createTextNode(liText);
liElement.appendChild(node);
ulElement.appendChild(liElement);
}
section.appendChild(ulElement);
}
let bags = recommendedBackpacks[characterName];
buildRecommendedBackpacks(bags);