-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
469 lines (452 loc) · 26.8 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
<!--
Modified from https://illuminate.dotasphere.com/
I don't claim to be a good web developer but this was mainly done as
a test to see how you can host on Github a link to your own domain.
This code started as a copy of Bongikairu's so many thanks to him ;D
-->
<!doctype html>
<html lang="en">
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-120833732-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-127734786-4');
</script>
<!--Site icon-->
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.png" />
<meta charset="utf-8">
<!--OpenGraph metas-->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta property='og:type' content='website'/>
<meta property='og:site_name' content='Artifact History - JoshLmao'/>
<meta property='og:image' content='https://i.imgur.com/nG1EYOu.png'/>
<title>Artifact Game History | JoshLmao</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script defer src="https://pro.fontawesome.com/releases/v5.6.1/js/all.js" integrity="sha384-ncMWtRMSOo+cLmfdaa6vmMGzBJKysBDF9tq5YK1MAnAjcyipdW2vgTS1jOntY4fs" crossorigin="anonymous"></script>
<link href="https://stackpath.bootstrapcdn.com/bootswatch/4.2.1/darkly/bootstrap.min.css" rel="stylesheet" integrity="sha384-F7cPHYSdE3FzBKvdxDKyFow9Y28Yq7KGHQOKpOI+rwc8s6jJnp///mpEJAib2EM6" crossorigin="anonymous">
<!--Styling-->
<link rel="stylesheet" type="text/css" href="css/style.css"></link>
<!--Github Buttons-->
<script async defer src="https://buttons.github.io/buttons.js"></script>
<!--Twitter-->
<script>window.twttr = (function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
t = window.twttr || {};
if (d.getElementById(id)) return t;
js = d.createElement(s);
js.id = id;
js.src = "https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
t._e = [];
t.ready = function(f) {
t._e.push(f);
};
return t;
}(document, "script", "twitter-wjs"));</script>
<style id="filter_style">
</style>
</head>
<body>
<div class="container">
<div class="page-header">
<img src="images/artifact_logo_top.png" property="og:image" title="Hi Reddit! Or whoever found this :p" class="float-right" height="75"/>
<h1>Artifact Game History</h1>
<h3>View your Artifact game history</h3>
<!--Github Buttons, View, Star & Follow-->
<a class="github-button" href="https://github.com/JoshLmao/ArtifactAPI.MatchHistory" data-size="large" aria-label="View JoshLmao/ArtifactAPI.MatchHistory on GitHub">View on Github</a>
<a class="github-button" href="https://github.com/JoshLmao/ArtifactAPI.MatchHistory" data-icon="octicon-star" data-size="large" aria-label="Star JoshLmao/ArtifactAPI.MatchHistory on GitHub">Star</a>
<div class="mr-2 float-right">
<!--Twitter follow button-->
<a class="twitter-follow-button" href="https://twitter.com/JoshLmao" data-size="large" data-show-count="false">Follow</a>
</div>
<div class="mr-2 float-right">
<a class="github-button" href="https://github.com/JoshLmao" data-size="large" aria-label="Follow @JoshLmao on GitHub">Follow</a>
</div>
</div>
<hr/>
<div id="output" style="display: none" class="mt-3">
<div class="card">
<div class="card-body">
<div class="container-fluid">
<!--Title row-->
<div class="row">
<div class="col-sm">
<div class="card-title float-left" id="output_title"></div>
</div>
<div class="col-sm">
<button class="btn btn-primary float-right" id="btnResetData">Reset Data</button>
</div>
</div>
<!--Stats row-->
<div class="row mt-1">
<!--Lifetime stats column-->
<div class="col-sm">
<h4 class="font-weight-bold">Lifetime Stats</h4>
<table class="table">
<tbody>
<tr>
<td><h5 class="font-weight-bold">Overview</h5></td>
<td><h5 class="font-weight-bold">Matches</h5></td>
<td><h5 class="font-weight-bold">Win Rate</h5></td>
</tr>
<tr>
<td>Total Games</td>
<td id="life_totalGames">?</td>
<td id="life_totalGamesWR">?%</td>
</tr>
<tr>
<td>Matchmaking</td>
<td id="life_totalMM">?</td>
<td id="life_totalMMWR">?%</td>
</tr>
<tr>
<td>Gauntlet</td>
<td id="life_totalGau">?</td>
<td id="life_totalGauWR">?%</td>
</tr>
<tr>
<td>Bot Match</td>
<td id="life_totalBM">?</td>
<td id="life_totalBMWR">?%</td>
</tr>
<tr>
<td><h5 class="font-weight-bold">Gauntlet Type</h5></td>
<td><h5 class="font-weight-bold">Matches</h5></td>
<td><h5 class="font-weight-bold">Win Rate</h5></td>
</tr>
<tr>
<td>Call to Arms</td>
<td id="life_totalCTA">?</td>
<td id="life_totalCTAWR">?%</td>
</tr>
<tr>
<td>Constructed</td>
<td id="life_totalConst">?</td>
<td id="life_totalConstWR">?%</td>
</tr>
<tr>
<td>Phantom's Draft</td>
<td id="life_totalPD">?</td>
<td id="life_totalPDWR">?%</td>
</tr>
<tr>
<td>Expert Constructed</td>
<td id="life_totalEConst">?</td>
<td id="life_totalEConstWR">?%</td>
</tr>
<tr>
<td>Expert Phantom's Draft</td>
<td id="life_totalEPD">?</td>
<td id="life_totalEPDWR">?%</td>
</tr>
<tr>
<td>Keeper's Draft</td>
<td id="life_totalKD">?</td>
<td id="life_totalKDWR">?%</td>
</tr>
<tr>
<td><h5 class="font-weight-bold">Faction</h5></td>
<td><h5 class="font-weight-bold">Total Matches</h5></td>
<td><h5 class="font-weight-bold">Win Rate</h5></td>
</tr>
<tr>
<td>Radiant</td>
<td id="life_rGames">?</td>
<td id="life_rWR">?%</td>
</tr>
<tr>
<td>Dire</td>
<td id="life_dGames">?</td>
<td id="life_dWR">?%</td>
</tr>
</tbody>
</table>
</div>
<!--Casual Stats column-->
<div class="col-sm">
<h4 class="font-weight-bold">Casual Stats</h4>
<table class="table">
<thead>
<th data-field="overview">Overview</th>
<th data-field="matches">Matches</th>
<th data-field="win_rate">Win Rate</th>
</thead>
<tbody>
<tr>
<td>Total Games</td>
<td id="cas_totalGames">?</td>
<td id="cas_totalWR">?%</td>
</tr>
<tr>
<td>Radiant</td>
<td id="cas_rGames">?</td>
<td id="cas_rWR">?%</td>
</tr>
<tr>
<td>Dire</td>
<td id="cas_dGames">?</td>
<td id="cas_dWR">?%</td>
</tr>
<tr>
<td><h5 class="font-weight-bold">Record</h5></td>
<td><h5 class="font-weight-bold">Hero</h5></td>
<td><h5 class="font-weight-bold">Pick Amount</h5></td>
</tr>
<tr>
<td>Most Picked Hero</td>
<td id="cas_mph">?</td>
<td id="cas_mphpa">?%</td>
</tr>
<tr>
<td><h5 class="font-weight-bold">Record</h5></td>
<td><h5 class="font-weight-bold">Value</h5></td>
<td><h5 class="font-weight-bold">Game ID</h5></td>
</tr>
<tr>
<td>Most turns in game</td>
<td id="cas_rec_turns_val">?</td>
<td id="cas_rec_turns_id">?%</td>
</tr>
<tr>
<td>Shortest Game</td>
<td id="cas_rec_SG_Time">?</td>
<td id="cas_rec_SG_ID">?%</td>
</tr>
<tr>
<td>Longest Game</td>
<td id="cas_rec_LG_Time">?</td>
<td id="cas_rec_LG_ID">?%</td>
</tr>
</tbody>
</table>
</div>
<!--Expert Stats column-->
<div class="col-sm">
<h4 class="font-weight-bold">Expert Stats</h4>
<table class="table">
<thead>
<th data-field="overview">Overview</th>
<th data-field="matches">Matches</th>
<th data-field="win_rate">Win Rate</th>
</thead>
<tbody>
<tr>
<td>Total Games</td>
<td id="exp_totalGames">?</td>
<td id="exp_totalWR">?%</td>
</tr>
<tr>
<td>Radiant</td>
<td id="exp_rGames">?</td>
<td id="exp_rWR">?%</td>
</tbody>
<tr>
<td>Dire</td>
<td id="exp_dGames">?</td>
<td id="exp_dWR">?%</td>
</tr>
<tr>
<td><h5 class="font-weight-bold">Record</h5></td>
<td><h5 class="font-weight-bold">Hero</h5></td>
<td><h5 class="font-weight-bold">Pick Amount</h5></td>
</tr>
<tr>
<td>Most Picked Hero</td>
<td id="exp_mph">?</td>
<td id="exp_mphpa">?%</td>
</tr>
<tr>
<td><h5 class="font-weight-bold">Record</h5></td>
<td><h5 class="font-weight-bold">Value</h5></td>
<td><h5 class="font-weight-bold">Game ID</h5></td>
</tr>
<tr>
<td>Most turns in game</td>
<td id="exp_rec_turns_val">?</td>
<td id="exp_rec_turns_id">?%</td>
</tr>
<tr>
<td>Shortest Game</td>
<td id="exp_rec_SG_Time">?</td>
<td id="exp_rec_SG_ID">?%</td>
</tr>
<tr>
<td>Longest Game</td>
<td id="exp_rec_LG_Time">?</td>
<td id="exp_rec_LG_ID">?%</td>
</tr>
</tbody>
</table>
</div>
</div>
<hr />
<!--Match Mode filter row-->
<div class="row">
<h5 id="filter_title" class="card-title float-right mr-3">Modes:</h5>
<div class="float-left">
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<!--All matches-->
<label class="btn btn-secondary active">
<input type="radio" name="filter_matchType" autocomplete="off" id="filter_all" value="all" checked>
All
</label>
<!--Normal Matchmaking-->
<label class="btn btn-secondary">
<input type="radio" name="filter_matchType" autocomplete="off" id="filter_match_matchmaking" value="matchmaking">
Matchmaking
</label>
<!--Bot Matches-->
<label class="btn btn-secondary">
<input type="radio" name="filter_matchType" autocomplete="off" id="filter_match_botMatch" value="botMatch">
Bot Match
</label>
<!--Gauntlets-->
<!--Call to Arms-->
<label class="btn btn-secondary">
<input type="radio" name="filter_matchType" autocomplete="off" id="filter_match_c2a" value="callToArms">
Call to Arms
</label>
<!--Expert Constructed-->
<label class="btn btn-secondary">
<input type="radio" name="filter_matchType" autocomplete="off" id="filter_match_expConst" value="expConstructed">
Expert Constructed
</label>
<!--Expert Phantom's Draft-->
<label class="btn btn-secondary">
<input type="radio" name="filter_matchType" autocomplete="off" id="filter_match_exppd" value="exppd">
Expert Phantom's Draft
</label>
<!--Expert Keeper's Draft-->
<label class="btn btn-secondary">
<input type="radio" name="filter_matchType" autocomplete="off" id="filter_match_expkd" value="expkd">
Expert Keeper's Draft
</label>
<!--Constructed-->
<label class="btn btn-secondary">
<input type="radio" name="filter_matchType" autocomplete="off" id="filter_match_const" value="constructed">
Constructed
</label>
<!--Casual Phantoms Draft-->
<label class="btn btn-secondary">
<input type="radio" name="filter_matchType" autocomplete="off" id="filter_match_pd" value="pd">
Phantom's Draft
</label>
</div>
</div>
</div>
<!--Match outcome filter row-->
<div class="row">
<h5 id="filter_title" class="card-title mr-3">Outcome: </h5>
<div class="mr-3">
<!--Matches Result filter buttons-->
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary active">
<input type="radio" name="filter_outcome" autocomplete="off" checked
id="filter_outcome_all" value="all">
All
</label>
<label class="btn btn-secondary">
<input type="radio" name="filter_outcome" autocomplete="off" id="filter_outcome_win"
value="win">
Win
</label>
<label class="btn btn-secondary">
<input type="radio" name="filter_outcome" autocomplete="off" id="filter_outcome_lose"
value="lose">
Lose
</label>
</div>
</div>
</div>
</div>
<p class="card-text" id="output_data">
</p>
</div>
<div id="loading" class="card-footer">
<i class="far fa-spinner fa-spin"></i> Loading ...
</div>
</div>
</div>
<div id="whatis" class="hideondata">
<h3>What is this?</h3>
This site will display all your current Artifact game history and statistics from the data you insert.
I previously developed this as a <a href="https://github.com/JoshLmao/ArtifactAPI.MatchHistory">WPF application</a> and now
have an online version!
<br/>
If you'd like to see the full source code, it's available online on my Github (or click <a href="https://github.com/JoshLmao/ArtifactAPI.MatchHistory.Website">here</a>)
</div>
<div class="mt-3 hideondata">
<h3>How does it work?</h3>
Simple! The javascript down below is used to gather all your game data from your webpage and then redirects you to a page on this site to view it all and the stats.
The script builds the data into a format that can be deconstructed easily and then simply tells your browser to come back to this url and adds all your data on the end.
The data never leaves your browser and has aboslutely no chance of being stolen, <i>used</i>, or <b>sold</b> (unlike some other Artifact Game History sites) 😉
<br/>
<button type="submit" class="btn btn-primary mt-2" id="btnExampleData" type="button" title="Click already... Come on!">Click here to see the history page with example data</button>
</div>
<div id="instruction" class="mt-3 hideondata">
<h3>Instructions</h3>
<ol>
<li>
Open <a href="https://steamcommunity.com/my/gcpd/583950/?category=Games&tab=MatchPlayers" target="_blank">this link</a> to view your current Artifact game history
</li>
<li>
<div>Type <b>javascript:</b> into your url and paste the following code after it
</div>
<textarea id="script_box" class="form-control textAreaStyle" readonly>(()=>{let matchIds=[];const read_data=()=>{const player_name=document.getElementsByClassName("profile_small_header_name")[0].children[0].textContent;const row_list=document.getElementById("personaldata_elements_container").querySelectorAll("tr");let all_output="";for(let i=1;i<row_list.length;i++){const col_list=row_list[i].querySelectorAll("td");let output="";for(let j=0;j<col_list.length;j++){if(j==0){if(!matchIds.includes(col_list[j].textContent)){matchIds.push(col_list[j].textContent)}else{break}}
output+=col_list[j].textContent+(j==col_list.length-1?"":"|")}
if(output!="")
all_output+=output+(i==row_list.length-1?"":",")}
window.location="https://artifacthistory.joshlmao.com/#"+all_output};const b1=document.getElementById("load_more_button");const b2=document.getElementById("inventory_history_loading");const has_more=()=>{return(b1&&b1.style.display!=="none")||(b2&&b2.style.display!=="none")};const has_load_more=()=>b1&&b1.style.display!=="none";const load_more=()=>b1.click();const watch_load_more=()=>{const interval=setInterval(()=>{if(has_load_more()){load_more()}else{if(!has_more()){clearInterval(interval);console.log(`done`);read_data()}}},100)};const b3=document.getElementById("personaldata_elements_container");const h1=document.createElement("h1");const h1text=document.createTextNode("Loading more data ");const h1spinner=document.createElement("img");h1spinner.src="https://steamcommunity-a.akamaihd.net/public/images/login/throbber.gif";h1.appendChild(h1text);h1.appendChild(h1spinner);b3.insertBefore(h1,b3.childNodes[0]);watch_load_more()})()
</textarea>
</li>
<li>
Wait until you're redirected to another page <b>(should be "artifacthistory.joshlmao.com/#...")</b> which will display all your game history and statistics!
</li>
</ol>
</div>
<div class="mt-3 hideondata">
<h3>Github Repository</h3>
<span>
If you're interested in how this works, want to download the source code or help fix issues, check out the repo!
<br/>
WPF App: <a href="https://github.com/JoshLmao/ArtifactAPI.MatchHistory">https://github.com/JoshLmao/ArtifactAPI.MatchHistory</a>
<br/>
Website: <a href="https://github.com/JoshLmao/ArtifactAPI.MatchHistory.Website">https://github.com/JoshLmao/ArtifactAPI.MatchHistory.Website</a>
</span>
</div>
<div class="mt-3 hideondata">
<h3>Thank you!</h3>
Finally, thank you for using this! If you appreciate what I do, then please consider following me on Twitter (<a href="https://twitter.com/JoshLmao">@JoshLmao</a>),
or on <a href="https://github.com/JoshLmao">Github</a>
<br/>
Or please consider supporting me and buying me a coffee (or two!) 😊
<br/>
<div class="row mt-2">
<div class="col-sm text-right">
<a href="https://ko-fi.com/joshlmao" title="Thank you! <3">
<img src="images/kofiDonateBtn.png" alt="KoFiDonate.png" height="50">
</a>
</div>
<div class="col-sm text-left">
<a href="https://paypal.me/ijoshlmao?locale.x=en_GB" title="Thank you! <3">
<img src="images/donateBtn.png" height="50">
</a>
</div>
</div>
</div>
<hr/>
<div class="mt-3 text-center text-muted">
<div>by <a href="https://github.com/joshlmao">@joshlmao</a></div>
<div>Code derived from <a href="https://github.com/bongikairu">@bongikairu</a></div>
</div>
</div>
</body>
<script src="js/stats.js"></script>
<script src="js/analyzeData.js"></script>
<script src="js/heroesMap.js"></script>
</html>