@sjtdev/koishi-plugin-dota2tracker 1.3.1 → 1.4.1

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