-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
472 lines (412 loc) · 16.6 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
<!-- corpse_regex.html -->
<html>
<head>
<title>Corpse Regex</title>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap" rel="stylesheet">
<script src='https://storage.ko-fi.com/cdn/scripts/overlay-widget.js'></script>
<style>
header {
background-color: #333; /* Dark gray background color */
color: #fff; /* White text color */
padding: 10px; /* Add padding for spacing */
}
header h1 {
font-size: 2em; /* Large font size */
margin: 0; /* Remove default margin */
font-weight: bold;
}
body {
font-family: 'Montserrat', sans-serif;
margin: 0; /* Remove default margin */
padding: 10px;
}
.section {
display: flex;
align-items: center;
padding: 1px;
border-bottom: 1px solid #ccc;
margin-bottom :0
}
.section:last-child {
border-bottom: none; /* Remove border from the last section */
}
.section select, .section button {
margin-right: 20px;
padding: 2px;
}
.section h5 {
margin-right: 10px;
}
.message {
visibility: hidden;
color: rgb(54, 120, 54);
margin-left: 10px;
}
.base_filter_background{
background-color: #c0c0c0;
}
.content-container {
display: flex;
align-items: center;
width: 500px;
}
footer {
background-color: #333;
color: #fff;
padding: 10px;
text-align: left;
align-items: center;
}
.dark-mode {
background-color: #333;
color: #fff;
}
</style>
</head>
<body>
<header>
<h1>Corpse Regex v0.2</h1>
<button onclick="toggleDarkMode()">Toggle Dark/Light Mode</button>
</header>
<div class="section base_filter_background">
<div class="content-container">
<h5>Item Level</h5>
<select name="item_level" required></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section base_filter_background">
<h5>Monster Category</h5>
<select name="monster_category" required></select>
</div>
<div class="section">
<div class="content-container">
<h5>Modifiers</h5>
<select name="mod"></select>
<h5>Effect</h5>
<select name="add_rem"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,mod,add_rem" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section">
<div class="content-container">
<h5>Row Column Effect</h5>
<select name="row_col"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,row_col" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section">
<div class="content-container">
<h5>NPCs</h5>
<select name="npcs"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,npcs" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section">
<div class="content-container">
<h5>Increase Affixes</h5>
<select name="affixes"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,affixes" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section">
<div class="content-container">
<h5>Explicit +1 / - 1</h5>
<select name="explicit"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,explicit" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section">
<div class="content-container">
<h5>+ Modifier Tier</h5>
<select name="tier"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,tier" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section">
<div class="content-container">
<h5>+ Item Level</h5>
<select name="item_level_mod"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,item_level_mod" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section">
<div class="content-container">
<h5>+ Quality</h5>
<select name="quality"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,quality" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section">
<div class="content-container">
<h5>Adjacent Corpses</h5>
<select name="adjacent"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,adjacent" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section">
<div class="content-container">
<h5>Consumed Excorcise</h5>
<select name="consumed"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,consumed" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section">
<div class="content-container">
<h5>20% Additional Craft</h5>
<select name="additional"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,additional" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section">
<div class="content-container">
<h5>25% Fracture</h5>
<select name="fracture"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,fracture" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<div class="section">
<div class="content-container">
<h5>Haunted Modifiers</h5>
<select name="haunted"></select>
</div>
<div class="button-container">
<button onclick="copyData(this)" data-selects="item_level,monster_category,haunted" data-function="formatComplex">Copy</button>
<span class="message">Copied!</span>
</div>
</div>
<footer>
<script type='text/javascript' src='https://storage.ko-fi.com/cdn/widget/Widget_2.js'></script>
<script type='text/javascript'>kofiwidget2.init('Support Me on Ko-fi', '#de9516', 'Z8Z7Y38YY');kofiwidget2.draw();</script>
<small>This site is fan-made and not affiliated with Grinding Gear Games in any way.</small>
</footer>
<script>
const ItemLevel = [
{ name: "ANY", value: "" },
{ name: "ILVL80+", value: '"level: 8[0-9]"' },
{ name: "ILVL70+", value: '"level: 7[0-9]"' }
];
const MonsterCategory = [
{ name: "ANY", value: '"cat.*: *"' },
{ name: "HUMANOID", value: '"cat.*: hum"' },
{ name: "UNDEAD", value: '"cat.*: und"' },
{ name: "BEAST", value: '"cat.*: bea"' },
{ name: "DEMON", value: '"cat.*: dem"' },
{ name: "CONSTRUCT", value: '"cat.*: const"' }
];
const Mod = [
{ name: "ATTACK", value: '"attack"' },
{ name: "ATTRIBUTE", value: '"attr"' },
{ name: "CASTER", value: '"caster"' },
{ name: "CHAOS", value: '"chaos"' },
{ name: "COLD", value: '"cold"' },
{ name: "CRITICAL", value: '"crit"' },
{ name: "DEFENCE", value: '"def"' },
{ name: "ELEMENTAL", value: '"ele"' },
{ name: "FIRE", value: '"fire"' },
{ name: "GEM", value: '"gem"' },
{ name: "LIFE", value: '"life"' },
{ name: "LIGHTNING", value: '"light"' },
{ name: "MANA", value: '"mana"' },
{ name: "MINION", value: '"minion"' },
{ name: "PHYSICAL", value: '"phys"' },
{ name: "RESISTANCE", value: '"resist"' },
{ name: "SPEED", value: '"speed"' }
];
const Haunted = [
{ name: "HAUNTED", value: '"haunted mod"' }
];
const AddRem = [
{ name: "INCREASE", value: '"inc"' },
{ name: "SCARCER", value: '"scar"' }
];
const RowCol = [
{ name: "ROW", value: '"grave row"' },
{ name: "COLUMN", value: '"grave col"' }
];
const NPC = [
{ name: "ANY", value: "haunted by" },
{ name: "Albanus", value: '"alba"' },
{ name: "Asinia", value: '"asin"' },
{ name: "Claudia", value: '"clau"' },
{ name: "Draven", value: '"drav"' },
{ name: "Drusia", value: '"drus"' },
{ name: "Fabricia", value: '"fabr"' },
{ name: "Fausta", value: '"faus"' },
{ name: "Hadrius", value: '"hadr"' },
{ name: "Iris", value: '"iris"' },
{ name: "Julianis", value: '"juli"' },
{ name: "Kostian", value: '"kost"' },
{ name: "Legius", value: '"legi"' },
{ name: "Lilius", value: '"lili"' },
{ name: "Lucillus", value: '"luci"' },
{ name: "Marius", value: '"mari"' },
{ name: "Octavius", value: '"octa"' },
{ name: "Quintio", value: '"quint"' },
{ name: "Titiana", value: '"titi"' },
{ name: "Tyche", value: '"tyche"' },
{ name: "Valerius", value: '"vale"' }
];
const Affix = [
{ name: "PREFIX", value: '"prefix"' },
{ name: "SUFFIX", value: '"suffix"' }
];
const Explicit = [
{ name: "ADD", value: '"+1" "explicit"' },
{ name: "MINUS", value: '"-1" "explicit"' }
];
const Tier = [
{ name: "TIER", value: '"+50" "tier"' }
];
const Additional = [
{ name: "ADDITIONAL", value: '"20%" "craft"' }
];
const ItemLevelMod = [
{ name: "ITEMLEVEL", value: '"+1" "item level"' }
];
const Quality = [
{ name: "QUALITY", value: '"+5" "q"' }
];
const Fracture = [
{ name: "FRACTURE", value: '"25%" "frac"' }
];
const Consumed = [
{ name: "ANY", value: '".exor"' },
{ name: "HUMAN", value: '"hum.*exor"' },
{ name: "UNDEAD", value: '"und.*exor"' },
{ name: "BEAST", value: '"bea.*exor"' },
{ name: "DEMON", value: '"dem.*exor"' },
{ name: "CONSTRUCT", value: '"const.*exor"' }
];
const Adjacent = [
{ name: "ANY", value: '"of.*adj.* to"' },
{ name: "HUMAN", value: '"of.*hum.*adj.* to"' },
{ name: "UNDEAD", value: '"of.*und.*adj.* to"' },
{ name: "BEAST", value: '"of.*bea.*adj.* to"' },
{ name: "DEMON", value: '"of.*dem.*adj.* to"' },
{ name: "CONSTRUCT", value: '"of.*const.*adj.* to"' }
];
function populateDropdown(selector, options) {
const selectElement = document.querySelector(selector);
options.forEach(option => {
const opt = document.createElement('option');
opt.value = option.value;
opt.textContent = option.name;
selectElement.appendChild(opt);
});
}
document.addEventListener('DOMContentLoaded', () => {
populateDropdown('select[name="item_level"]', ItemLevel);
populateDropdown('select[name="monster_category"]', MonsterCategory);
populateDropdown('select[name="mod"]', Mod);
populateDropdown('select[name="add_rem"]', AddRem);
populateDropdown('select[name="row_col"]', RowCol);
populateDropdown('select[name="npcs"]', NPC);
populateDropdown('select[name="affixes"]', Affix);
populateDropdown('select[name="explicit"]', Explicit);
populateDropdown('select[name="tier"]', Tier);
populateDropdown('select[name="item_level_mod"]', ItemLevelMod);
populateDropdown('select[name="quality"]', Quality);
populateDropdown('select[name="adjacent"]', Adjacent);
populateDropdown('select[name="haunted"]', Haunted);
populateDropdown('select[name="additional"]', Additional);
populateDropdown('select[name="fracture"]', Fracture);
populateDropdown('select[name="consumed"]', Consumed);
// Add this event listener
document.querySelector('select[name="item_level"]').addEventListener('change', function() {
toggleItemLevelCopyButton();
});
// Initial toggle on page load
toggleItemLevelCopyButton();
toggleDarkMode();
});
function copyData(button) {
const selects = button.getAttribute('data-selects').split(',');
const funcName = button.getAttribute('data-function');
const values = selects.map(selectName => getSelectedValue(selectName.trim()));
const finalString = window[funcName](values); // Call the function dynamically
const messageElement = button.nextElementSibling; // Directly next to the button
copyToClipboard(finalString, messageElement);
}
function formatSingle(values) {
return values[0];
}
function formatComplex(values) {
// Join all values with a space or any other delimiter as needed
return values.join(' ');
}
function toggleItemLevelCopyButton() {
const itemLevelSelect = document.querySelector('select[name="item_level"]');
const sectionDiv = itemLevelSelect.closest('.section'); // Find the nearest parent with class 'section'
const copyButton = sectionDiv.querySelector('button'); // Find the first button within that section
if (itemLevelSelect.value === "") {
copyButton.style.display = 'none';
} else {
copyButton.style.display = 'inline-block';
}
}
function getSelectedValue(selectName) {
return document.querySelector(`select[name="${selectName}"]`).value;
}
function copyToClipboard(textToCopy, messageElement) {
navigator.clipboard.writeText(textToCopy).then(() => {
messageElement.style.visibility = 'visible';
setTimeout(() => {
messageElement.style.visibility = 'hidden';
}, 2000);
});
}
function toggleDarkMode() {
const body = document.body;
const sections = document.querySelectorAll('.base_filter_background');
body.classList.toggle('dark-mode');
sections.forEach(section => {
if (body.classList.contains('dark-mode')) {
section.style.backgroundColor = '#8d9499'; // Change to blue background color in dark mode
} else {
section.style.backgroundColor = '#c0c0c0'; // Change to gray background color in light mode
}
});
}
</script>
</body>
</html>