@sjtdev/koishi-plugin-dota2tracker 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,303 +6,344 @@
6
6
  <title>Document</title>
7
7
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" />
8
8
  <style>
9
- html,
10
- body {
11
- background-color: black;
12
- color: white;
13
- width: 800px;
14
- }
15
-
16
- .wrapper > * {
17
- margin: 5px;
18
- box-shadow: 0 0 5px #fff;
19
- width: 790px;
20
- border-radius: 5px;
21
- overflow: hidden;
22
- }
23
-
24
- img {
25
- width: auto;
26
- vertical-align: middle;
27
- }
28
-
29
- p {
30
- margin: 0;
31
- }
32
-
33
- .player {
34
- display: flex;
35
- position: relative;
36
- height: 128px;
37
- }
38
-
39
- .player .avatar {
40
- width: 128px;
41
- height: 128px;
42
- position: absolute;
43
- }
44
-
45
- .player .avatar img {
46
- width: 100%;
47
- border-radius: 5px;
48
- }
49
-
50
- .player .name {
51
- font-size: 24px;
52
- }
53
- .player .name .guild::before {
54
- content: "[";
55
- color: #fff;
56
- }
57
- .player .name .guild::after {
58
- content: "]";
59
- color: #fff;
60
- }
61
- .player .name .hero_name::before {
62
- content: ">";
63
- color: #fff;
64
- }
65
- .player .name .hero_name::after {
66
- content: "<";
67
- color: #fff;
68
- }
69
-
70
- .player .info {
71
- width: 100%;
72
- display: flex;
73
- flex-direction: column;
74
- align-items: center;
75
- /* line-height: 2; */
76
- justify-content: space-around;
77
- }
78
-
79
- .player .info .guild.Copper {
80
- color: #b4775f;
81
- }
82
- .player .info .guild.Silver {
83
- color: #9a9593;
84
- }
85
- .player .info .guild.Gold {
86
- color: #bda97f;
87
- }
88
- .player .info .guild.Diamond {
89
- color: #a5cbcf;
90
- }
91
-
92
- .player .info .matches span.win {
93
- color: #007A00;
94
- }
95
- .player .info .matches span.lose {
96
- color: #B30000;
97
- }
98
-
99
- .player .info .matches span.victory {
100
- color: lightgreen;
101
- }
102
- .player .info .matches span.stomp {
103
- color: green;
104
- /* font-size: 8px; */
105
- }
106
- .player .info .matches span.fail {
107
- color: #ff6961;
108
- }
109
- .player .info .matches span.stomped {
110
- color: red;
111
- /* font-size: 8px; */
112
- }
113
-
114
- .player .rank {
115
- width: 64px;
116
- height: 64px;
117
- flex-grow: 1;
118
- position: absolute;
119
- top: 0;
120
- right: 0;
121
- }
122
-
123
- .player .rank .medal {
124
- z-index: 1;
125
- }
126
-
127
- .player .rank .star {
128
- z-index: 2;
129
- }
130
-
131
- .player .rank p {
132
- z-index: 4;
133
- }
134
-
135
- .player .rank div {
136
- height: 100%;
137
- width: 100%;
138
- top: 0;
139
- right: 0;
140
- position: absolute;
141
- }
142
-
143
- .player .rank img {
144
- top: 0;
145
- right: 0;
146
- position: absolute;
147
- height: 64px;
148
- }
149
-
150
- .player .rank p {
151
- font-size: 12px;
152
- line-height: 1;
153
- position: absolute;
154
- text-align: center;
155
- width: 64px;
156
- bottom: 4px;
157
- right: 0;
158
- /* background-color: #222; */
159
- /* border: black 1px solid; */
160
- box-sizing: border-box;
161
- text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; /* 描边效果 */
162
- }
163
-
164
- .hero_winrate > *:not(:last-child) {
165
- /* margin-bottom: 10px; */
166
- }
167
-
168
- .hero_winrate .heroes {
169
- display: grid;
170
- /* line-height: 2; */
171
- grid-template-columns: 32px auto auto auto auto auto;
172
- /* grid-template-rows: repeat(auto-fill, 1fr); */
173
- justify-content: start;
174
- align-items: center;
175
- }
176
-
177
- .hero_winrate .heroes .hero {
178
- width: 100%;
179
- display: flex;
180
- align-items: center;
181
- }
182
-
183
- .hero_winrate .heroes img {
184
- width: 100%;
185
- /* height: 32px; */
186
- border-radius: 6px;
187
- overflow: hidden;
188
- }
189
-
190
- .hero_winrate .heroes span.imp {
191
- margin: 0 4px;
192
- }
193
-
194
- .hero_winrate .heroes span {
195
- text-align: center;
196
- }
197
-
198
- .hero_winrate .heroes .tip.row {
199
- grid-column: 1/-1;
200
- }
201
-
202
- .hero_winrate .heroes .win {
203
- /* color: #000; */
204
- text-align: right;
205
- padding-right: 8px;
206
- background-color: #006400;
207
- border-radius: 16px 0 0 16px;
208
- height: 16px;
209
- justify-self: end;
210
- }
211
- .hero_winrate .heroes .lose {
212
- /* color: #000; */
213
- text-align: left;
214
- padding-left: 8px;
215
- background-color: #8b0000;
216
- border-radius: 0 16px 16px 0;
217
- height: 16px;
218
- justify-self: start;
219
- }
220
-
221
- .matches {
222
- table-layout: fixed;
223
- }
224
-
225
- .matches .match.win {
226
- background-color: #006400;
227
- }
228
- .matches .match.lose {
229
- background-color: #8b0000;
230
- }
231
-
232
- .matches .match td {
233
- text-align: center;
234
- /* line-height: 40px; */
235
- height: 40px;
236
- overflow: hidden;
237
- }
238
-
239
- .matches .match .player_lane {
240
- width: 100%;
241
- height: 100%;
242
- justify-content: center; /* 水平居中 */
243
- align-items: center; /* 垂直居中 */
244
- display: flex;
245
- }
246
-
247
- .matches .match .player_lane:not(.tie) {
248
- /* background-color: #000; */
249
- }
250
-
251
- .matches .match .player_lane svg {
252
- width: 36px;
253
- height: 36px;
254
- }
255
- .player_lane.victory svg path {
256
- fill: lightgreen;
257
- }
258
-
259
- .player_lane.stomp svg path {
260
- fill: green;
261
- }
262
-
263
- .player_lane.stomped svg path {
264
- fill: red;
265
- }
266
-
267
- .plus {
268
- display: grid;
269
- grid-template-columns: repeat(4, 1fr);
270
- gap: 10px;
271
- }
272
-
273
- .plus .hero {
274
- width: 190px;
275
- height: 190px;
276
- border-radius: 5px;
277
- position: relative;
278
- display: grid;
279
- grid-template-columns: repeat(2, 1fr);
280
- grid-template-rows: 118.75px auto;
281
- justify-items: center;
282
- align-items: center;
283
- }
284
- .plus .hero img {
285
- width: 100%;
286
- grid-column: 1/-1;
287
- }
288
-
289
- .plus .level {
290
- position: absolute;
291
- width: 50px;
292
- height: 50px;
293
- left: calc(50% - 25px);
294
- top: calc(118.75px - 25px);
295
- }
296
-
297
- .plus .level span {
298
- position: absolute;
299
- width: 100%;
300
- text-align: center;
301
- left: 0;
302
- bottom: 18px;
303
- font-size: 14px;
304
- text-shadow: -1px -1px 1px #000, 1px -1px 1px #000, -1px 1px 1px #000, 1px 1px 1px #000;
305
- }
9
+ html,
10
+ body {
11
+ background-color: black;
12
+ color: white;
13
+ width: 800px;
14
+ }
15
+
16
+ .wrapper > * {
17
+ margin: 5px;
18
+ box-shadow: 0 0 5px #fff;
19
+ width: 790px;
20
+ border-radius: 5px;
21
+ overflow: hidden;
22
+ position: relative;
23
+ }
24
+
25
+ img {
26
+ width: auto;
27
+ vertical-align: middle;
28
+ }
29
+
30
+ p {
31
+ margin: 0;
32
+ }
33
+
34
+ .player {
35
+ display: flex;
36
+ position: relative;
37
+ height: 128px;
38
+ }
39
+
40
+ .player .avatar {
41
+ width: 128px;
42
+ height: 128px;
43
+ position: absolute;
44
+ }
45
+
46
+ .player .avatar img {
47
+ width: 100%;
48
+ border-radius: 5px;
49
+ }
50
+
51
+ .player .name {
52
+ font-size: 24px;
53
+ }
54
+ .player .name .guild::before {
55
+ content: "[";
56
+ color: #fff;
57
+ }
58
+ .player .name .guild::after {
59
+ content: "]";
60
+ color: #fff;
61
+ }
62
+ .player .name .hero_name::before {
63
+ content: ">";
64
+ color: #fff;
65
+ }
66
+ .player .name .hero_name::after {
67
+ content: "<";
68
+ color: #fff;
69
+ }
70
+
71
+ .player .info {
72
+ width: 100%;
73
+ display: flex;
74
+ flex-direction: column;
75
+ align-items: center;
76
+ /* line-height: 2; */
77
+ justify-content: space-around;
78
+ }
79
+
80
+ .player .info .guild.Copper {
81
+ color: #b4775f;
82
+ }
83
+ .player .info .guild.Silver {
84
+ color: #9a9593;
85
+ }
86
+ .player .info .guild.Gold {
87
+ color: #bda97f;
88
+ }
89
+ .player .info .guild.Diamond {
90
+ color: #a5cbcf;
91
+ }
92
+
93
+ .player .info .matches span.win {
94
+ color: #007a00;
95
+ }
96
+ .player .info .matches span.lose {
97
+ color: #b30000;
98
+ }
99
+
100
+ .player .info .matches span.victory {
101
+ color: lightgreen;
102
+ }
103
+ .player .info .matches span.stomp {
104
+ color: green;
105
+ /* font-size: 8px; */
106
+ }
107
+ .player .info .matches span.fail {
108
+ color: #ff6961;
109
+ }
110
+ .player .info .matches span.stomped {
111
+ color: red;
112
+ /* font-size: 8px; */
113
+ }
114
+ .player .info .matches.blur {
115
+ filter: blur(10px);
116
+ }
117
+
118
+ .player .rank {
119
+ width: 64px;
120
+ height: 64px;
121
+ flex-grow: 1;
122
+ position: absolute;
123
+ top: 0;
124
+ right: 0;
125
+ }
126
+
127
+ .player .rank.estimated {
128
+ filter: grayscale(100%);
129
+ }
130
+
131
+ .player .rank .medal {
132
+ z-index: 1;
133
+ }
134
+
135
+ .player .rank .star {
136
+ z-index: 2;
137
+ }
138
+
139
+ .player .rank p {
140
+ z-index: 4;
141
+ }
142
+
143
+ .player .rank div {
144
+ height: 100%;
145
+ width: 100%;
146
+ top: 0;
147
+ right: 0;
148
+ position: absolute;
149
+ }
150
+
151
+ .player .rank img {
152
+ top: 0;
153
+ right: 0;
154
+ position: absolute;
155
+ height: 64px;
156
+ }
157
+
158
+ .player .rank p {
159
+ font-size: 12px;
160
+ line-height: 1;
161
+ position: absolute;
162
+ text-align: center;
163
+ width: 64px;
164
+ bottom: 4px;
165
+ right: 0;
166
+ /* background-color: #222; */
167
+ /* border: black 1px solid; */
168
+ box-sizing: border-box;
169
+ text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; /* 描边效果 */
170
+ }
171
+
172
+ .hero_winrate > *:not(:last-child) {
173
+ /* margin-bottom: 10px; */
174
+ }
175
+
176
+ .hero_winrate {
177
+ }
178
+
179
+ .hero_winrate .heroes {
180
+ display: grid;
181
+ /* line-height: 2; */
182
+ grid-template-columns: 32px auto auto auto auto auto;
183
+ /* grid-template-rows: repeat(auto-fill, 1fr); */
184
+ justify-content: start;
185
+ align-items: center;
186
+ }
187
+
188
+ .hero_winrate .heroes .hero {
189
+ width: 100%;
190
+ display: flex;
191
+ align-items: center;
192
+ }
193
+
194
+ .hero_winrate .heroes img {
195
+ width: 100%;
196
+ /* height: 32px; */
197
+ border-radius: 6px;
198
+ overflow: hidden;
199
+ }
200
+
201
+ .hero_winrate .heroes span.imp {
202
+ margin: 0 4px;
203
+ }
204
+
205
+ .hero_winrate .heroes span {
206
+ text-align: center;
207
+ }
208
+
209
+ .hero_winrate .heroes .tip.row {
210
+ grid-column: 1/-1;
211
+ }
212
+
213
+ .hero_winrate .heroes .win {
214
+ /* color: #000; */
215
+ text-align: right;
216
+ padding-right: 8px;
217
+ background-color: #006400;
218
+ border-radius: 16px 0 0 16px;
219
+ height: 16px;
220
+ justify-self: end;
221
+ }
222
+ .hero_winrate .heroes .lose {
223
+ /* color: #000; */
224
+ text-align: left;
225
+ padding-left: 8px;
226
+ background-color: #8b0000;
227
+ border-radius: 0 16px 16px 0;
228
+ height: 16px;
229
+ justify-self: start;
230
+ }
231
+
232
+ table.matches {
233
+ table-layout: fixed;
234
+ width: 100%;
235
+ }
236
+
237
+ .matches .match.win {
238
+ background-color: #006400;
239
+ }
240
+ .matches .match.lose {
241
+ background-color: #8b0000;
242
+ }
243
+
244
+ .matches .match td {
245
+ text-align: center;
246
+ /* line-height: 40px; */
247
+ height: 40px;
248
+ overflow: hidden;
249
+ }
250
+
251
+ .matches .match .player_lane {
252
+ width: 100%;
253
+ height: 100%;
254
+ justify-content: center; /* 水平居中 */
255
+ align-items: center; /* 垂直居中 */
256
+ display: flex;
257
+ }
258
+
259
+ .matches .match .player_lane:not(.tie) {
260
+ /* background-color: #000; */
261
+ }
262
+
263
+ .matches .match .player_lane svg {
264
+ width: 36px;
265
+ height: 36px;
266
+ }
267
+ .player_lane.victory svg path {
268
+ fill: lightgreen;
269
+ }
270
+
271
+ .player_lane.stomp svg path {
272
+ fill: green;
273
+ }
274
+
275
+ .player_lane.stomped svg path {
276
+ fill: red;
277
+ }
278
+
279
+ .plus {
280
+ display: grid;
281
+ grid-template-columns: repeat(4, 1fr);
282
+ gap: 10px;
283
+ }
284
+
285
+ .plus .hero {
286
+ width: 190px;
287
+ height: 190px;
288
+ border-radius: 5px;
289
+ position: relative;
290
+ display: grid;
291
+ grid-template-columns: repeat(2, 1fr);
292
+ grid-template-rows: 118.75px auto;
293
+ justify-items: center;
294
+ align-items: center;
295
+ }
296
+ .plus .hero img {
297
+ width: 100%;
298
+ grid-column: 1/-1;
299
+ }
300
+
301
+ .plus .level {
302
+ position: absolute;
303
+ width: 50px;
304
+ height: 50px;
305
+ left: calc(50% - 25px);
306
+ top: calc(118.75px - 25px);
307
+ }
308
+
309
+ .plus .level span {
310
+ position: absolute;
311
+ width: 100%;
312
+ text-align: center;
313
+ left: 0;
314
+ bottom: 18px;
315
+ font-size: 14px;
316
+ text-shadow: -1px -1px 1px #000, 1px -1px 1px #000, -1px 1px 1px #000, 1px 1px 1px #000;
317
+ }
318
+
319
+ .blur-overlay {
320
+ position: absolute;
321
+ top: 0;
322
+ left: 0;
323
+ width: 100%;
324
+ height: 100%;
325
+ background: #00000050;
326
+ backdrop-filter: blur(10px);
327
+ display: flex;
328
+ flex-direction: column;
329
+ justify-content: center;
330
+ align-items: center;
331
+ }
332
+
333
+ .lock-icon {
334
+ font-size: 24px;
335
+ margin-bottom: 10px;
336
+ }
337
+
338
+ .lock-text {
339
+ font-size: 18px;
340
+ font-weight: bold;
341
+ }
342
+ .lock-sub {
343
+ line-height: 3;
344
+ font-size: 14px;
345
+ color: #aaa;
346
+ }
306
347
  </style>
307
348
  </head>
308
349
  <body>
@@ -395,7 +436,6 @@
395
436
  const pixelOfPerMatchInNear = (heroesCountPixels / (highestCountsNear?.winCount + highestCountsNear?.loseCount ?? 1)) * nearAdjustmentFactor;
396
437
 
397
438
  player.positionPerformance=[];
398
- // 瞎j8定义的各位置代表物品,以后看情况调整
399
439
  const positionIcons = ["damage","nuke","armor","speed","healing"];
400
440
  for (let index = 0; index < 5; index++) {
401
441
  let currentPositionMatches = player.matches.filter(match=>match.players.find(innerPlayer=>player.steamAccount.id==innerPlayer.steamAccount.id).position == ("POSITION_"+(index+1)))
@@ -427,9 +467,9 @@
427
467
  </p>
428
468
  <p class="matches">
429
469
  <%=$t("dota2tracker.template.match_count_")%><%=player.matchCount%> (<span class="win"><%=player.winCount%></span>/<span class="lose"><%=player.matchCount - player.winCount%></span>) &nbsp;&nbsp;
430
- <%=$t("dota2tracker.template.winrate_")%><span <%=`style="color:${utils.winRateColor(player.winCount / player.matchCount)};"`%>><%=((player.winCount / player.matchCount) * 100).toFixed(2)%>%</span>
470
+ <%=$t("dota2tracker.template.winrate_")%><span <%-`style="color:${utils.winRateColor(player.winCount / player.matchCount)};"`%>><%=((player.winCount / player.matchCount) * 100).toFixed(2)%>%</span>
431
471
  </p>
432
- <p class="matches">
472
+ <p class="matches<%- player.steamAccount.isAnonymous ? " blur" : "" %>">
433
473
  <span><%-$t("dota2tracker.template.last25matches_")%>
434
474
  <span class="win"><%-nearWinCount%></span>/
435
475
  <span class="lose"><%-nearMatchCount - nearWinCount%></span>
@@ -437,19 +477,19 @@
437
477
  <span><%-$t("dota2tracker.template.winrate_")%>
438
478
  <span <%-`style="color:${utils.winRateColor(nearWinCount / nearMatchCount)};"`%>><%-((nearWinCount / nearMatchCount) * 100).toFixed(2)%>%</span>
439
479
  </span>&nbsp;
440
- <span><%-$t("dota2tracker.template.imp_")%><%-(player.performance?.imp > 0 ? "+" : "") + player.performance?.imp%></span>
480
+ <span><%-$t("dota2tracker.template.imp_")%><%-player.steamAccount.isAnonymous?"?":((player.performance?.imp > 0 ? "+" : "") + player.performance?.imp)%></span>
441
481
  </p>
442
- <p class="matches">
482
+ <p class="matches<%- player.steamAccount.isAnonymous ? " blur" : "" %>">
443
483
  <span><%-$t("dota2tracker.template.lane")%>
444
484
  <span class="victory"><%-outcomeCounts.victory + outcomeCounts.stomp%>(<span class="stomp"><%-outcomeCounts.stomp%></span>)</span>-<span class="tie"><%-outcomeCounts.tie%></span>-<span class="fail"><%-outcomeCounts.fail + outcomeCounts.stomped%>(<span class="stomped"><%-outcomeCounts.stomped%></span>)</span>
445
485
  </span>&nbsp;&nbsp;
446
486
  <span><%-$t("dota2tracker.template.lane_advantage_rate_")%>
447
- <span <%-`style="color:${utils.winRateColor((outcomeCounts.victory + outcomeCounts.stomp + outcomeCounts.tie / 2) / (outcomeCounts.victory + outcomeCounts.stomp + outcomeCounts.tie + outcomeCounts.fail + outcomeCounts.stomped))};"`%>><%-(((outcomeCounts.victory + outcomeCounts.stomp) / (outcomeCounts.victory + outcomeCounts.stomp + outcomeCounts.fail + outcomeCounts.stomped)) * 100).toFixed(2)%>%</span>
487
+ <span <%-`style="color:${utils.winRateColor((outcomeCounts.victory + outcomeCounts.stomp + outcomeCounts.tie / 2) / (outcomeCounts.victory + outcomeCounts.stomp + outcomeCounts.tie + outcomeCounts.fail + outcomeCounts.stomped))};"`%>><%-player.steamAccount.isAnonymous?"?":(((outcomeCounts.victory + outcomeCounts.stomp) / (outcomeCounts.victory + outcomeCounts.stomp + outcomeCounts.fail + outcomeCounts.stomped)) * 100).toFixed(2)%>%</span>
448
488
  </span>
449
489
  </p>
450
490
  </div>
451
- <div class="rank">
452
- <img class="medal" src="<%-utils.getImageUrl('medal_' +(player.inTop100??player.rank.medal))%>" alt="" />
491
+ <div class="rank<%= player.isEstimatedRank ? " estimated" : "" %>">
492
+ <img class="medal" src="<%-utils.getImageUrl('medal_' +(player.rank.inTop100??player.rank.medal))%>" alt="" />
453
493
  <img class="star" src="<%-utils.getImageUrl('star_' + player.rank.star)%>" alt="" />
454
494
  <p><%-player.steamAccount.seasonLeaderboardRank ?? ""%></p>
455
495
  </div>
@@ -500,63 +540,71 @@
500
540
  <span class="win" style="${position.winCount == 0 ? "visibility:hidden;" : ""}width: ${position.winCount * pixelOfPerMatchInPosition}px">${position.winCount}</span>
501
541
  <span class="lose" style="${position.matchCount - position.winCount == 0 ? "visibility:hidden;" : ""}width: ${(position.matchCount - position.winCount) * pixelOfPerMatchInPosition}px">${position.matchCount - position.winCount}</span>`).join("") %>
502
542
  </div>
543
+ <% if (player.steamAccount.isAnonymous) { %>
544
+ <%- include("player_1/private", {$t, player}) %>
545
+ <% } %>
503
546
  </div>
504
- <%- Math.abs(player.streak) > 1 ?
547
+ <%- Math.abs(player.streak) > 1 && !player.steamAccount.isAnonymous ?
505
548
  `<div class="streak" style="box-shadow:none;color:${utils.winRateColor((player.streak + 10) / 20)};">${Math.abs(player.streak) + (player.streak > 0 ? $t("dota2tracker.template.winning_streak") : $t("dota2tracker.template.losing_streak"))}</div>`:"" %>
506
- <table class="matches">
507
- <colgroup>
508
- <col style="width: auto" />
509
- <col style="width: auto" />
510
- <col style="width: 40px" />
511
- <col style="width: auto" />
512
- <col style="width: 40px" />
513
- <col style="width: auto" />
514
- <col style="width: auto" />
515
- <col style="width: auto" />
516
- <col style="width: 40px" />
517
- </colgroup>
518
- <thead>
519
- <tr>
520
- <th><%= $t("dota2tracker.template.id") %></th>
521
- <th><%= $t("dota2tracker.template.mode") %></th>
522
- <th><%= $t("dota2tracker.template.hero") %></th>
523
- <th><%= $t("dota2tracker.template.kda_kc") %></th>
524
- <th><%= $t("dota2tracker.template.lane") %></th>
525
- <th><%= $t("dota2tracker.template.time") %></th>
526
- <th><%= $t("dota2tracker.template.duration") %></th>
527
- <th><%= $t("dota2tracker.template.imp") %></th>
528
- <th><%= $t("dota2tracker.template.rank") %></th>
529
- </tr>
530
- </thead>
531
- <tbody>
532
- <%- player.matches.map((match) => {
533
- const innerPlayer = match.players.find(innerPlayer => player.steamAccount.id == innerPlayer.steamAccount.id);
534
- innerPlayer.teamKillsCount = match.parsedDateTime ?
535
- (match[(innerPlayer.isRadiant ? "radiant" : "dire") + "Kills"]?.reduce((acc, cva) => acc + cva, 0) ?? 0) :
536
- match.players
537
- .filter(p => p.isRadiant === innerPlayer.isRadiant)
538
- .reduce((k, p) => k + p.kills, 0);
539
- return `
540
- <tr class="match ${match.didRadiantWin == innerPlayer.isRadiant ? "win" : "lose"}">
541
- <td>${match.parsedDateTime ? match.id : `<p>${match.id}</p><p>${$t("dota2tracker.template.un_parsed")}</p>`}</td>
542
- <td>
543
- <p>${$t("dota2tracker.template.lobby_types."+match.lobbyType) || match.lobbyType}</p>
544
- <p>${$t("dota2tracker.template.game_modes."+match.gameMode) || match.gameMode}</p>
545
- </td>
546
- <td><img alt="" src="${utils.getImageUrl(innerPlayer.hero.shortName, ImageType.HeroIcons)}" /></td>
547
- <td style="line-height: 20px">
548
- <p>${((innerPlayer.kills + innerPlayer.assists) / Math.max(1, innerPlayer.deaths)).toFixed(2)} (${(match.parsedDateTime?"":"≈")+((((innerPlayer.kills + innerPlayer.assists) /
549
- innerPlayer.teamKillsCount) * 100)?.toFixed(0))}%)</p>
550
- <p>${innerPlayer.kills}/${innerPlayer.deaths}/${innerPlayer.assists}</p>
551
- </td>
552
- <td><div class="player_lane ${match.laneResult}">${laneSVG[match.laneResult]}</div></td>
553
- <td style="line-height: 20px">${moment(new Date(match.startDateTime * 1000)).format("YYYY-MM-DD HH:mm:ss").slice(2)}</td>
554
- <td>${utils.sec2time(match.durationSeconds)}</td>
555
- <td>${innerPlayer.imp != null ? ((innerPlayer.imp >= 0 ? "+" : "") + innerPlayer.imp) : "?"}</td>
556
- <td><img class="medal" src="${utils.getImageUrl("medal_" + match.rank?.toString().split("")[0])}" style="width: 100%" /></td>
557
- </tr>`}).join("")%>
558
- </tbody>
559
- </table>
549
+ <div>
550
+ <table class="matches">
551
+ <colgroup>
552
+ <col style="width: auto" />
553
+ <col style="width: auto" />
554
+ <col style="width: 40px" />
555
+ <col style="width: auto" />
556
+ <col style="width: 40px" />
557
+ <col style="width: auto" />
558
+ <col style="width: auto" />
559
+ <col style="width: auto" />
560
+ <col style="width: 40px" />
561
+ </colgroup>
562
+ <thead>
563
+ <tr>
564
+ <th><%= $t("dota2tracker.template.id") %></th>
565
+ <th><%= $t("dota2tracker.template.mode") %></th>
566
+ <th><%= $t("dota2tracker.template.hero") %></th>
567
+ <th><%= $t("dota2tracker.template.kda_kc") %></th>
568
+ <th><%= $t("dota2tracker.template.lane") %></th>
569
+ <th><%= $t("dota2tracker.template.time") %></th>
570
+ <th><%= $t("dota2tracker.template.duration") %></th>
571
+ <th><%= $t("dota2tracker.template.imp") %></th>
572
+ <th><%= $t("dota2tracker.template.rank") %></th>
573
+ </tr>
574
+ </thead>
575
+ <tbody>
576
+ <%- player.matches.map((match) => {
577
+ const innerPlayer = match.players.find(innerPlayer => player.steamAccount.id == innerPlayer.steamAccount.id);
578
+ innerPlayer.teamKillsCount = match.parsedDateTime ?
579
+ (match[(innerPlayer.isRadiant ? "radiant" : "dire") + "Kills"]?.reduce((acc, cva) => acc + cva, 0) ?? 0) :
580
+ match.players
581
+ .filter(p => p.isRadiant === innerPlayer.isRadiant)
582
+ .reduce((k, p) => k + p.kills, 0);
583
+ return `
584
+ <tr class="match ${match.didRadiantWin == innerPlayer.isRadiant ? "win" : "lose"}">
585
+ <td>${match.parsedDateTime ? match.id : `<p>${match.id}</p><p>${$t("dota2tracker.template.un_parsed")}</p>`}</td>
586
+ <td>
587
+ <p>${$t("dota2tracker.template.lobby_types."+match.lobbyType) || match.lobbyType}</p>
588
+ <p>${$t("dota2tracker.template.game_modes."+match.gameMode) || match.gameMode}</p>
589
+ </td>
590
+ <td><img alt="" src="${utils.getImageUrl(innerPlayer.hero.shortName, ImageType.HeroIcons)}" /></td>
591
+ <td style="line-height: 20px">
592
+ <p>${((innerPlayer.kills + innerPlayer.assists) / Math.max(1, innerPlayer.deaths)).toFixed(2)} (${(match.parsedDateTime?"":"≈")+((((innerPlayer.kills + innerPlayer.assists) /
593
+ innerPlayer.teamKillsCount) * 100)?.toFixed(0))}%)</p>
594
+ <p>${innerPlayer.kills}/${innerPlayer.deaths}/${innerPlayer.assists}</p>
595
+ </td>
596
+ <td><div class="player_lane ${match.laneResult}">${laneSVG[match.laneResult]}</div></td>
597
+ <td style="line-height: 20px">${moment(new Date(match.startDateTime * 1000)).format("YYYY-MM-DD HH:mm:ss").slice(2)}</td>
598
+ <td>${utils.sec2time(match.durationSeconds)}</td>
599
+ <td>${innerPlayer.imp != null ? ((innerPlayer.imp >= 0 ? "+" : "") + innerPlayer.imp) : "?"}</td>
600
+ <td><img class="medal" src="${utils.getImageUrl("medal_" + match.rank?.toString().split("")[0])}" style="width: 100%" /></td>
601
+ </tr>`}).join("")%>
602
+ </tbody>
603
+ </table>
604
+ <% if (player.steamAccount.isAnonymous) { %>
605
+ <%- include("player_1/private", {$t, player}) %>
606
+ <% } %>
607
+ </div>
560
608
  <div class="plus">
561
609
  <%- player.dotaPlus.map((hero) => `
562
610
  <div class="hero">
@@ -565,6 +613,9 @@
565
613
  <span>${((hero.winCount / hero.matchCount) * 100).toFixed(2)}%</span>
566
614
  <span>${hero.matchCount}</span>
567
615
  </div>`).join("") %>
616
+ <% if (player.steamAccount.isAnonymous) { %>
617
+ <%- include("player_1/private", {$t, player}) %>
618
+ <% } %>
568
619
  </div>
569
620
  </div>
570
621
  </body>