-
Notifications
You must be signed in to change notification settings - Fork 0
/
testalb.html
687 lines (674 loc) · 27.5 KB
/
testalb.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
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Demo app</title>
<link href="https://fonts.googleapis.com/css?family=Titillium+Web:300,400,600" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mini.css/3.0.1/mini-dark.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.css" p />
<style>
body {
width: 84vw;
margin: auto;
}
#disc,
#ig {
display: none;
}
.rawOrTrans > div {
padding: 14px;
}
.rawOrTrans {
flex-wrap: nowrap;
}
.rawOrTrans > .row {
border: 1px solid black;
background-color: #fbfbfb24;
margin: 5px;
}
.row.img {
width: 100px;
}
.img > img {
width: 100%;
}
form {
background: none;
border: none;
border-radius: none;
}
.raw > .col > .cost {
margin: -11px 11px 3px 7px;
padding: 0 12px;
border-bottom: 1px solid #6b6b6b;
}
.trans > .col > .cost {
padding: 0 12px;
margin: 0px 11px -5px 7px;
border-top: 1px solid #6b6b6b;
}
.cost {
justify-content: center;
border-radius: 5px;
}
h5 {
margin: 0;
}
.rawOrTrans .button-group:last-child {
width: 50%;
justify-content: end;
}
input[type="number"] {
-moz-appearance: textfield;
max-width: 108px !important;
}
input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div id="disc" class="col responsive-margin"><mark style="margin: 0 10px;">Sur Discord:</mark><span></span></div>
<div id="ig" class="col responsive-margin"><mark style="margin: 0 10px;" class="tertiary">Sur Albion:</mark><span></span></div>
</div>
<div class="row" style="justify-content: center;">
<form>
<select name="loc">
<option>Bridgewatch </option>
<option>Carleon </option>
<option>Martlock </option>
<option>Lymhurst </option>
<option>Fort Sterling </option>
<option>Thetford </option>
</select>
</form>
</div>
<div class="row">
<div class="col-6"></div>
<div class="col-6 rawOrTrans">
<div class="row" style="background: none; border:none;justify-content: space-between;padding:0;">
<div class="button-group">
<span class="tooltip" aria-label="Lock or not the number of materials needed for each object"
><button id="lock"><i class="fas fa-lock"></i></button
></span>
<input class="number" type="number" placeholder="Nombre" style="border:none;" />
</div>
<div class="button-group" id="enchant">
<button value="">0</button>
<button value="_LEVEL1">.1</button>
<button value="_LEVEL2">.2</button>
<button value="_LEVEL3">.3</button>
</div>
</div>
<div class="row tailoring" name="tailoring">
<div class="col T4">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T4_FIBER" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T4_CLOTH" /></div>
</div>
</div>
</div>
<div class="col T5">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T5_FIBER" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T5_CLOTH" /></div>
</div>
</div>
</div>
<div class="col T6">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T6_FIBER" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T6_CLOTH" /></div>
</div>
</div>
</div>
<div class="col T7">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T7_FIBER" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T7_CLOTH" /></div>
</div>
</div>
</div>
<div class="col T8">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T8_FIBER" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T8_CLOTH" /></div>
</div>
</div>
</div>
</div>
<div class="row leatherworking" name="leatherworking">
<div class="col T4">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T4_HIDE" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T4_LEATHER" />
</div>
</div>
</div>
</div>
<div class="col T5">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T5_HIDE" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T5_LEATHER" />
</div>
</div>
</div>
</div>
<div class="col T6">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T6_HIDE" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T6_LEATHER" />
</div>
</div>
</div>
</div>
<div class="col T7">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T7_HIDE" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T7_LEATHER" />
</div>
</div>
</div>
</div>
<div class="col T8">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T8_HIDE" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T8_LEATHER" />
</div>
</div>
</div>
</div>
</div>
<div class="row refining" name="refining">
<div class="col T4">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T4_ORE" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T4_METALBAR" />
</div>
</div>
</div>
</div>
<div class="col T5">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T5_ORE" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T5_METALBAR" />
</div>
</div>
</div>
</div>
<div class="col T6">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T6_ORE" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T6_METALBAR" />
</div>
</div>
</div>
</div>
<div class="col T7">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T7_ORE" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T7_METALBAR" />
</div>
</div>
</div>
</div>
<div class="col T8">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T8_ORE" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T8_METALBAR" />
</div>
</div>
</div>
</div>
</div>
<div class="row woodworking" name="woodworking">
<div class="col T4">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T4_WOOD" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T4_PLANKS" />
</div>
</div>
</div>
</div>
<div class="col T5">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T5_WOOD" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T5_PLANKS" />
</div>
</div>
</div>
</div>
<div class="col T6">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T6_WOOD" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T6_PLANKS" />
</div>
</div>
</div>
</div>
<div class="col T7">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T7_WOOD" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T7_PLANKS" />
</div>
</div>
</div>
</div>
<div class="col T8">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T8_WOOD" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T8_PLANKS" />
</div>
</div>
</div>
</div>
</div>
<div class="row stoneworking" name="stoneworking">
<div class="col T4">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T4_ROCK" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T4_STONEBLOCK" />
</div>
</div>
</div>
</div>
<div class="col T5">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T5_ROCK" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T5_STONEBLOCK" />
</div>
</div>
</div>
</div>
<div class="col T6">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T6_ROCK" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T6_STONEBLOCK" />
</div>
</div>
</div>
</div>
<div class="col T7">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T7_ROCK" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T7_STONEBLOCK" />
</div>
</div>
</div>
</div>
<div class="col T8">
<div class="row raw">
<div class="col">
<div class="row img"><img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T8_ROCK" /></div>
<div class="row cost"><h5></h5></div>
</div>
</div>
<div class="row trans">
<div class="col">
<div class="row cost"><h5></h5></div>
<div class="row img">
<img src="https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/T8_STONEBLOCK" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script>
const api = "https://www.albion-online-data.com/api/v1/stats/prices/";
const disc = "https://discordapp.com/api/servers/562300005944393738/widget.json";
var img = "https://albiononline2d.ams3.cdn.digitaloceanspaces.com/thumbnails/orig/";
var fiber = ["T4_FIBER", "T5_FIBER", "T6_FIBER", "T7_FIBER", "T8_FIBER"];
var cloth = ["T4_CLOTH", "T5_CLOTH", "T6_CLOTH", "T7_CLOTH", "T8_CLOTH"];
var hide = ["T4_HIDE", "T5_HIDE", "T6_HIDE", "T7_HIDE", "T8_HIDE"];
var leather = ["T4_LEATHER", "T5_LEATHER", "T6_LEATHER", "T7_LEATHER", "T8_LEATHER"];
var ore = ["T4_ORE", "T5_ORE", "T6_ORE", "T7_ORE", "T8_ORE"];
var metalbar = ["T4_METALBAR", "T5_METALBAR", "T6_METALBAR", "T7_METALBAR", "T8_METALBAR"];
var wood = ["T4_WOOD", "T5_WOOD", "T6_WOOD", "T7_WOOD", "T8_WOOD"];
var planks = ["T4_PLANKS", "T5_PLANKS", "T6_PLANKS", "T7_PLANKS", "T8_PLANKS"];
var rock = ["T4_ROCK", "T5_ROCK", "T6_ROCK", "T7_ROCK", "T8_ROCK"];
var stoneblock = ["T4_STONEBLOCK", "T5_STONEBLOCK", "T6_STONEBLOCK", "T7_STONEBLOCK", "T8_STONEBLOCK"];
var tailoring = ".tailoring";
var leatherworking = ".leatherworking";
var refining = ".refining";
var woodworking = ".woodworking";
var stoneworking = ".stoneworking";
var number, loc, enchant;
var enchantFix; // api should return _LEVELx for imgs. Possible issue.
$("[name=loc], .number").change(function() {
number = $(".number").val();
loc = $("[name=loc]")
.children("option:selected")
.val();
getAllRawTrans("");
});
// READY
$(document).ready(function() {
//// init raw/trans as FLAT
getAllRawTrans("");
getDiscord();
});
// FUNCTIONS
//// Discord
function getDiscord() {
var settingsDisc = {
async: true,
crossDomain: true,
url: disc,
method: "GET"
};
$.ajax(settingsDisc).done(function(res) {
var users = [];
var ig = [];
for (let i = 0; i < res.members.length; i++) {
if (res.members[i].channel_id) {
users.push(res.members[i].username);
$("#disc").show();
$("#disc span").text(users.join(", "));
}
if (res.members[i].game.name === "Albion Online") {
ig.push(res.members[i].username);
$("#ig").show();
$("#ig span").text(ig.join(", "));
} else {
$("#ig, #disc").hide();
}
}
});
}
//// Get ALL raw/trans
function getAllRawTrans(enchantFix) {
getRawTrans(fiber, cloth, enchantFix, tailoring);
getRawTrans(hide, leather, enchantFix, leatherworking);
getRawTrans(ore, metalbar, enchantFix, refining);
getRawTrans(wood, planks, enchantFix, woodworking);
getRawTrans(rock, stoneblock, enchantFix, stoneworking);
}
//// Raw/trans
var max;
function getRawTrans(raw, trans, enchantFix, job) {
loc = $("[name=loc]")
.children("option:selected")
.val();
number = $(".number").val();
var array = [];
for (let i = 0; i < raw.length; i++) {
$.ajax(api + raw[i] + enchantFix + "?locations=" + loc).done(function(res) {
array = [$(job + " .raw .cost")[i]];
$(array).each(function(index) {
if ($("#lock > i").hasClass("fa-lock")) {
max = Math.min(Math.max(parseInt(i + 2), 1), 5);
} else {
max = 1;
}
$(this).text(formatNumber(res[0].sell_price_min * max * number));
// DEBUG i = tier
console.log(
i + " " + raw[i] + " " + res[0].sell_price_min + " x " + max + " x " + number + " = " + formatNumber(res[0].sell_price_min * max * number)
);
});
});
}
for (let i = 0; i < trans.length; i++) {
$.ajax(api + trans[i] + enchantFix + "?locations=" + loc).done(function(res) {
array = [$(job + " .trans .cost")[i]];
$(array).each(function(index) {
$(this).text(formatNumber(res[0].sell_price_min * number));
});
});
}
}
//// Misc
function formatNumber(num) {
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1 ");
}
$("#enchant > button").click(function() {
enchant = $(this).val();
if (enchant === "_LEVEL1") {
enchantFix = "_LEVEL1@1";
$(".rawOrTrans > .row").css("border-color", "#7BC985");
} else if (enchant === "_LEVEL2") {
enchantFix = "_LEVEL2@2";
$(".rawOrTrans > .row").css("border-color", "#84DDE4");
} else if (enchant === "_LEVEL3") {
enchantFix = "_LEVEL3@3";
$(".rawOrTrans > .row").css("border-color", "#705599");
} else if (enchant === "") {
enchantFix = "";
$(".rawOrTrans > .row").css("border-color", "black");
}
getAllRawTrans(enchantFix);
});
/* $("#enchant > button").click(function() {
enchant = $(this).val();
if (enchant === "_LEVEL1") {
enchantFix = "_LEVEL1@1";
} else if (enchant === "_LEVEL2") {
enchantFix = "_LEVEL2@2";
} else if (enchant === "_LEVEL3") {
enchantFix = "_LEVEL3@3";
} else if (enchant === "") {
enchantFix = "";
}
getAllRawTrans(enchantFix);
var level = $("img");
const base = [];
for (let i = 0; i < level.length; i++) {
base.push($(level[i]).attr("src", $(level[i]).attr("src")));
if ($(level[i]).attr("src") === $(base[i]).attr("src")) {
$(base[i]).attr("src", $(base[i]).attr("src") + enchant);
}
console.log(base[i]);
}
}); */
$("#lock").on("click", function() {
if ($("#lock > i").hasClass("fa-lock")) {
$("#lock > i")
.addClass("fa-lock-open")
.removeClass("fa-lock");
} else if ($("#lock > i").hasClass("fa-lock-open")) {
$("#lock > i")
.addClass("fa-lock")
.removeClass("fa-lock-open");
}
getAllRawTrans(enchantFix);
});
</script>
</body>
</html>