@sjtdev/koishi-plugin-dota2tracker 2.2.2 → 2.3.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.
Files changed (106) hide show
  1. package/changelog.md +32 -0
  2. package/dist/index.js +1 -1
  3. package/lib/index.js +128 -94
  4. package/{queries → lib/queries}/MatchInfo.graphql +13 -0
  5. package/lib/templates/common/components/building_icons.ejs +20 -0
  6. package/lib/templates/common/styles/normalize.min.css +1 -0
  7. package/lib/templates/hero/hero_1.ejs +69 -0
  8. package/lib/templates/images/7.38_simple_minimap.png +0 -0
  9. package/lib/templates/item/item/recipe.ejs +9 -0
  10. package/lib/templates/item/item/style.css +1 -0
  11. package/lib/templates/item/item.ejs +52 -0
  12. package/lib/templates/item/itemlist.ejs +11 -0
  13. package/lib/templates/match/match_1/base.css +1 -0
  14. package/lib/templates/match/match_1/item.ejs +1 -0
  15. package/lib/templates/match/match_1/main.ejs +8 -0
  16. package/lib/templates/match/match_1/player.ejs +1 -0
  17. package/lib/templates/match/match_1/style.css +1 -0
  18. package/lib/templates/match/match_1.ejs +18 -0
  19. package/lib/templates/match/match_2/original.css +1 -0
  20. package/lib/templates/match/match_2/original.ejs +10 -0
  21. package/lib/templates/match/match_2+/charts.ejs +1 -0
  22. package/lib/templates/match/match_2+/extra.css +1 -0
  23. package/lib/templates/match/match_2+/lane_outcome.ejs +56 -0
  24. package/lib/templates/match/match_2+/map.ejs +160 -0
  25. package/lib/templates/match/match_2+.ejs +1 -0
  26. package/lib/templates/match/match_2.ejs +1 -0
  27. package/lib/templates/player/player_1/base.css +1 -0
  28. package/lib/templates/player/player_1/private.ejs +1 -0
  29. package/lib/templates/player/player_1.ejs +78 -0
  30. package/lib/templates/rank/rank_fun.ejs +1 -0
  31. package/lib/templates/report/daily/base.css +1 -0
  32. package/lib/templates/report/daily.ejs +29 -0
  33. package/package.json +2 -2
  34. package/template/hero/hero_1.ejs +0 -900
  35. package/template/item/item/recipe.ejs +0 -51
  36. package/template/item/item/style.css +0 -244
  37. package/template/item/item.ejs +0 -140
  38. package/template/item/itemlist.ejs +0 -99
  39. package/template/match/match_1/item.ejs +0 -11
  40. package/template/match/match_1/main.ejs +0 -37
  41. package/template/match/match_1/player.ejs +0 -154
  42. package/template/match/match_1/style.css +0 -764
  43. package/template/match/match_1.ejs +0 -56
  44. package/template/match/match_2/original.css +0 -463
  45. package/template/match/match_2/original.ejs +0 -192
  46. package/template/match/match_2+/charts.ejs +0 -261
  47. package/template/match/match_2+/extra.css +0 -143
  48. package/template/match/match_2+/lane_outcome.ejs +0 -157
  49. package/template/match/match_2+.ejs +0 -27
  50. package/template/match/match_2.ejs +0 -18
  51. package/template/player/player_1/private.ejs +0 -5
  52. package/template/player/player_1.ejs +0 -654
  53. package/template/rank/rank_fun.ejs +0 -131
  54. package/template/report/daily.ejs +0 -191
  55. /package/{queries → lib/queries}/Constants.graphql +0 -0
  56. /package/{queries → lib/queries}/GetWeeklyMetaByPosition.graphql +0 -0
  57. /package/{queries → lib/queries}/PlayerExtraInfo.graphql +0 -0
  58. /package/{queries → lib/queries}/PlayerInfoWith25Matches.graphql +0 -0
  59. /package/{queries → lib/queries}/PlayerPerformanceForHeroRecommendation.graphql +0 -0
  60. /package/{queries → lib/queries}/PlayersInfoWith10MatchesForGuild.graphql +0 -0
  61. /package/{queries → lib/queries}/PlayersLastmatchRankinfo.graphql +0 -0
  62. /package/{queries → lib/queries}/PlayersMatchesForDaily.graphql +0 -0
  63. /package/{queries → lib/queries}/RequestMatchDataAnalysis.graphql +0 -0
  64. /package/{queries → lib/queries}/VerifyingPlayer.graphql +0 -0
  65. /package/{template → lib/templates}/images/bei.jpg +0 -0
  66. /package/{template → lib/templates}/images/disconnected.png +0 -0
  67. /package/{template → lib/templates}/images/flag_dire.png +0 -0
  68. /package/{template → lib/templates}/images/flag_radiant.png +0 -0
  69. /package/{template → lib/templates}/images/hero_badge_1.png +0 -0
  70. /package/{template → lib/templates}/images/hero_badge_2.png +0 -0
  71. /package/{template → lib/templates}/images/hero_badge_3.png +0 -0
  72. /package/{template → lib/templates}/images/hero_badge_4.png +0 -0
  73. /package/{template → lib/templates}/images/hero_badge_5.png +0 -0
  74. /package/{template → lib/templates}/images/hero_badge_6.png +0 -0
  75. /package/{template → lib/templates}/images/lane_fail.svg +0 -0
  76. /package/{template → lib/templates}/images/lane_jungle.svg +0 -0
  77. /package/{template → lib/templates}/images/lane_stomp.svg +0 -0
  78. /package/{template → lib/templates}/images/lane_stomped.svg +0 -0
  79. /package/{template → lib/templates}/images/lane_tie.svg +0 -0
  80. /package/{template → lib/templates}/images/lane_victory.svg +0 -0
  81. /package/{template → lib/templates}/images/logo_dire.png +0 -0
  82. /package/{template → lib/templates}/images/logo_radiant.png +0 -0
  83. /package/{template → lib/templates}/images/medal_0.png +0 -0
  84. /package/{template → lib/templates}/images/medal_1.png +0 -0
  85. /package/{template → lib/templates}/images/medal_2.png +0 -0
  86. /package/{template → lib/templates}/images/medal_3.png +0 -0
  87. /package/{template → lib/templates}/images/medal_4.png +0 -0
  88. /package/{template → lib/templates}/images/medal_5.png +0 -0
  89. /package/{template → lib/templates}/images/medal_6.png +0 -0
  90. /package/{template → lib/templates}/images/medal_7.png +0 -0
  91. /package/{template → lib/templates}/images/medal_8.png +0 -0
  92. /package/{template → lib/templates}/images/medal_8b.png +0 -0
  93. /package/{template → lib/templates}/images/medal_8c.png +0 -0
  94. /package/{template → lib/templates}/images/scepter.png +0 -0
  95. /package/{template → lib/templates}/images/scepter_0.png +0 -0
  96. /package/{template → lib/templates}/images/scepter_1.png +0 -0
  97. /package/{template → lib/templates}/images/shard.png +0 -0
  98. /package/{template → lib/templates}/images/shard_0.png +0 -0
  99. /package/{template → lib/templates}/images/shard_1.png +0 -0
  100. /package/{template → lib/templates}/images/star_0.png +0 -0
  101. /package/{template → lib/templates}/images/star_1.png +0 -0
  102. /package/{template → lib/templates}/images/star_2.png +0 -0
  103. /package/{template → lib/templates}/images/star_3.png +0 -0
  104. /package/{template → lib/templates}/images/star_4.png +0 -0
  105. /package/{template → lib/templates}/images/star_5.png +0 -0
  106. /package/{template → lib/templates}/images/xi.jpg +0 -0
@@ -1,56 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Document</title>
7
- <%- `<style>` %>
8
- <%- include(`./match_1/style.css`) %>
9
- <% if (fontFamily) { %>
10
- <%- `body { font-family: ${fontFamily}; }` %>
11
- <% } %>
12
- <%- "</style>" %>
13
- <style>
14
- .box {
15
- border-radius: 5px;
16
- border: 2px solid rgba(255, 255, 255, 0.25);
17
- overflow: hidden;
18
- }
19
- </style>
20
- </head>
21
- <% const match = data; %>
22
- <%
23
- const partyColor = ["#caffe5","#ffe484","#e19be2","#ccdaf4"]
24
- const facetColor = {
25
- Red: "from-[#9f3c3c] to-[#4a2026]",
26
- Yellow: "from-[#c8a45c] to-[#6f3d21]",
27
- Green: "from-[#a2b23e] to-[#2d5a18]",
28
- Blue: "from-[#547ea6] to-[#2a385e]",
29
- Purple: "from-[#675cae] to-[#261c44]",
30
- Gray: "from-[#adb6be] to-[#4e5557]",
31
- Black: "from-[#2d2d2d] to-[#000000]"
32
- }
33
- let kcndcStyle = {
34
- kc: function (num) {
35
- let red = (255 - (num * 255) / 100).toFixed(2);
36
- return `rgb(255,${red},${red})`;
37
- },
38
- dc: function (num) {
39
- let gray = ((50 - Math.min(num, 50)) * (255 / 50)).toFixed(2);
40
- return `rgb(${gray},${gray},${gray})`;
41
- },
42
- };
43
- // 对线结果的图标(来自免费SVG素材网)
44
- const laneSVG = {
45
- stomp: getImageUrl("lane_stomp", undefined, ImageFormat.svg),
46
- advantage: getImageUrl("lane_victory", undefined, ImageFormat.svg),
47
- disadvantage: getImageUrl("lane_fail", undefined, ImageFormat.svg),
48
- stomped: getImageUrl("lane_stomped", undefined, ImageFormat.svg),
49
- tie: getImageUrl("lane_tie", undefined, ImageFormat.svg),
50
- jungle: getImageUrl("lane_jungle", undefined, ImageFormat.svg),
51
- };
52
- %>
53
- <body class="bg-black w-[800px] text-white">
54
- <%- include(`./match_1/main.ejs`, { match, partyColor, facetColor, kcndcStyle, laneSVG }) %>
55
- </body>
56
- </html>
@@ -1,463 +0,0 @@
1
- p {
2
- margin: 0;
3
- }
4
-
5
- img {
6
- width: 100%;
7
- vertical-align: middle;
8
- }
9
-
10
- html,
11
- body {
12
- overflow: hidden;
13
- width: 800px;
14
- }
15
-
16
- nav {
17
- font-size: 14px;
18
- line-height: 1.8;
19
- height: 72px;
20
- color: #fff;
21
- background-color: #000;
22
- display: flex;
23
- flex-direction: row;
24
- justify-content: space-around;
25
- align-items: center;
26
- }
27
-
28
- nav > div > p:first-of-type {
29
- font-weight: bold;
30
- }
31
-
32
- nav .match_id p:first-of-type {
33
- font-size: 16px;
34
- }
35
-
36
- nav > div.match_id > p.success::after {
37
- content: "※<%= $t('dota2tracker.template.analysis_successful') %>";
38
- color: #7ba334;
39
- }
40
- nav > div.match_id > p.fail::after {
41
- content: "※<%= $t('dota2tracker.template.analysis_incomplete') %>";
42
- color: #ffb400;
43
- }
44
- nav > div.match_id > p.opendota::after {
45
- content: "※<%= $t('dota2tracker.template.analysis_by_opendota') %>";
46
- color: #34a39a;
47
- }
48
-
49
- nav > .rank {
50
- width: 48px;
51
- height: 48px;
52
- position: relative;
53
- }
54
-
55
- nav > .rank > img {
56
- width: 48px;
57
- height: 48px;
58
- position: absolute;
59
- }
60
-
61
- .radiant {
62
- color: #3c9028;
63
- }
64
-
65
- .dire {
66
- color: #9c3628;
67
- }
68
-
69
- .match_result {
70
- font-weight: bold;
71
- height: 49px;
72
- display: flex;
73
- justify-content: center;
74
- align-items: center;
75
- }
76
-
77
- .match_result .win {
78
- margin: 0 25px;
79
- }
80
-
81
- .match_result .win.radiant::after {
82
- content: "<%=$t('dota2tracker.template.radiant_won')%>";
83
- }
84
-
85
- .match_result .win.dire::after {
86
- content: "<%=$t('dota2tracker.template.dire_won')%>";
87
- }
88
-
89
- .players {
90
- display: flex;
91
- flex-direction: column;
92
- }
93
-
94
- .players .panel {
95
- padding: 0 10px;
96
- }
97
-
98
- .players .panel {
99
- padding-top: 4px;
100
- height: 40px;
101
- border-top: 3px solid #fff;
102
- font-size: 13.3px;
103
- display: grid;
104
- grid-template-columns: 32px 56px 378px repeat(4, 1fr);
105
- }
106
- .players .panel.radiant {
107
- border-color: #3c9028;
108
- }
109
- .players .panel.dire {
110
- border-color: #9c3628;
111
- }
112
- .players .panel p {
113
- line-height: 16px;
114
- margin-left: 8px;
115
- }
116
- .players .panel .win {
117
- font-size: 20px;
118
- line-height: 32px;
119
- }
120
- .players .panel .data {
121
- color: #aaa;
122
- }
123
-
124
- .player:not(:last-child) {
125
- border-bottom: 1px solid #e1e1e1; /* 示例边框样式 */
126
- }
127
-
128
- .player {
129
- color: #000;
130
- width: 100%;
131
- display: grid;
132
- grid-template-columns: 64px 48px 88px 160px 112px 252px 36px 20px;
133
- grid-template-rows: 19px 14px 14px 14px;
134
- padding-bottom: 3px;
135
- font-size: 12px;
136
- line-height: 14px;
137
- overflow: hidden;
138
- justify-content: center;
139
- }
140
-
141
- .player > .row-1 {
142
- margin-top: 6px;
143
- }
144
-
145
- .player > .hero_avatar {
146
- margin-bottom: 5px;
147
- width: 64px;
148
- grid-row: 1 / span 3;
149
- grid-column: 1;
150
- position: relative;
151
- }
152
- .player > .hero_avatar > .level {
153
- width: 20px;
154
- height: 15px;
155
- background-color: #323232;
156
- position: absolute;
157
- bottom: 0;
158
- right: 0;
159
- font-size: 12px;
160
- line-height: 15px;
161
- color: #fff;
162
- text-align: center;
163
- }
164
-
165
- .player > .hero_avatar > .party_line {
166
- position: absolute;
167
- height: 2px;
168
- top: 0;
169
- width: 100%;
170
- }
171
-
172
- .player > .hero_avatar > .party_mark {
173
- position: absolute;
174
- line-height: 1.5;
175
- text-align: center;
176
- width: 16px;
177
- font-size: 10px;
178
- top: 3px;
179
- left: 1px;
180
- background-color: rgba(0, 0, 0, 0.8);
181
- }
182
-
183
- .player > .hero_avatar.party_I > .party_line {
184
- background-color: #caffe5;
185
- }
186
-
187
- .player > .hero_avatar.party_I > .party_mark {
188
- color: #caffe5;
189
- }
190
-
191
- .player > .hero_avatar.party_I > .party_mark::after {
192
- content: "I";
193
- }
194
-
195
- .player > .hero_avatar.party_II > .party_line {
196
- background-color: #ffe484;
197
- }
198
-
199
- .player > .hero_avatar.party_II > .party_mark {
200
- color: #ffe484;
201
- }
202
-
203
- .player > .hero_avatar.party_II > .party_mark::after {
204
- content: "II";
205
- }
206
-
207
- .player > .hero_avatar.party_III > .party_line {
208
- background-color: #e19be2;
209
- }
210
-
211
- .player > .hero_avatar.party_III > .party_mark {
212
- color: #e19be2;
213
- }
214
-
215
- .player > .hero_avatar.party_III > .party_mark::after {
216
- content: "III";
217
- }
218
-
219
- .player > .hero_avatar.party_IV > .party_line {
220
- background-color: #ccdaf4;
221
- }
222
-
223
- .player > .hero_avatar.party_IV > .party_mark {
224
- color: #ccdaf4;
225
- }
226
-
227
- .player > .hero_avatar.party_IV > .party_mark::after {
228
- content: "IV";
229
- }
230
-
231
- .player > .facet {
232
- color: #fff;
233
- width: 100%;
234
- height: 16px;
235
- grid-row: 4;
236
- grid-column: 1;
237
- display: grid;
238
- grid-template-columns: 16px auto;
239
- z-index: 1;
240
- position: relative;
241
- top: -5px;
242
- }
243
- .player > .facet > img {
244
- padding: 2px;
245
- width: 12px;
246
- height: 12px;
247
- background-color: #4444;
248
- }
249
- .player > .facet > span {
250
- padding: 0 2px;
251
- line-height: 1;
252
- display: grid;
253
- place-items: center;
254
- align-items: center;
255
- justify-content: center;
256
- height: 100%;
257
- }
258
- .player > .facet > span > * {
259
- max-width: 100%;
260
- overflow: hidden;
261
- text-overflow: ellipsis;
262
- white-space: nowrap;
263
- }
264
- .player > .facet.Red {
265
- background: linear-gradient(to right, #9f3c3c, #4a2026);
266
- }
267
- .player > .facet.Yellow {
268
- background: linear-gradient(to right, #c8a45c, #6f3d21);
269
- }
270
- .player > .facet.Green {
271
- background: linear-gradient(to right, #a2b23e, #2d5a18);
272
- }
273
- .player > .facet.Blue {
274
- background: linear-gradient(to right, #547ea6, #2a385e);
275
- }
276
- .player > .facet.Purple {
277
- background: linear-gradient(to right, #675cae, #261c44);
278
- }
279
- .player > .facet.Gray {
280
- background: linear-gradient(to right, #adb6be, #4e5557);
281
- }
282
- .player > .facet.Black {
283
- background: linear-gradient(to right, #2d2d2d, #000000);
284
- display: flex;
285
- justify-content: center;
286
- }
287
-
288
- .player > .rank {
289
- position: relative;
290
- grid-row: 1 / span 3;
291
- grid-column: 2;
292
- width: 48px;
293
- height: 48px;
294
- }
295
- .player > .rank > img {
296
- position: absolute;
297
- }
298
- .player > .rank > p {
299
- position: absolute;
300
- width: 100%;
301
- bottom: 1.5px;
302
- text-align: center;
303
- font-size: 8px;
304
- color: #fff;
305
- text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; /* 文字描边 */
306
- }
307
-
308
- .player > .titles {
309
- grid-row: 4;
310
- grid-column: 2/4;
311
- margin-left: 6px;
312
- /* text-shadow: 1px 1px 0 #333; 设置阴影颜色及偏移 */
313
- }
314
-
315
- .player > .player_name {
316
- grid-row: 1;
317
- grid-column: 3 / span 2;
318
- white-space: nowrap; /* 禁止换行 */
319
- overflow: hidden; /* 隐藏溢出部分 */
320
- text-overflow: ellipsis; /* 用省略号表示溢出的文本 */
321
- }
322
- .player > .player_name > .rank {
323
- color: #aaa;
324
- }
325
- .player.radiant > .player_name > .name {
326
- color: #3c9028;
327
- }
328
- .player.dire > .player_name > .name {
329
- color: #9c3628;
330
- }
331
-
332
- .player .pick {
333
- grid-column: 3;
334
- }
335
-
336
- .player .networth {
337
- grid-column: 3;
338
- }
339
- .player .networth .gold {
340
- color: rgb(203, 176, 42);
341
- text-shadow: 1px 1px 0 #000; /* 设置阴影颜色及偏移 */
342
- }
343
-
344
- .player .hero_damage {
345
- grid-row: 2;
346
- grid-column: 4;
347
- }
348
- .player .damage_received {
349
- grid-row: 3;
350
- grid-column: 4;
351
- }
352
- .player .tower_damage {
353
- grid-row: 4;
354
- grid-column: 4;
355
- }
356
- .player .kda {
357
- grid-row: 1;
358
- grid-column: 5;
359
- }
360
- .player .kill_contribution {
361
- grid-row: 2;
362
- grid-column: 5;
363
- }
364
- .player .stun_duration {
365
- grid-row: 3;
366
- grid-column: 5;
367
- }
368
- .player .heal {
369
- grid-row: 4;
370
- grid-column: 5;
371
- }
372
-
373
- .player .items {
374
- grid-row: 1 / span 4;
375
- grid-column: 6;
376
- display: grid;
377
- grid-template-columns: 24px 192px auto;
378
- grid-template-rows: 32px 24px;
379
- }
380
- .player .items > div {
381
- display: flex;
382
- background-color: #c0c0c0;
383
- }
384
- .player .items .normal {
385
- height: 32px;
386
- grid-column: 1/-1;
387
- grid-row: 1;
388
- }
389
- .player .items .backpack {
390
- height: 24px;
391
- width: 96px;
392
- grid-row: 2;
393
- /* grid-column: 1; */
394
- }
395
- .player .items .normal .item {
396
- width: 40px;
397
- height: 30px;
398
- margin: 1px;
399
- position: relative;
400
- }
401
- .player .items .time {
402
- position: absolute;
403
- width: 100%;
404
- text-align: center;
405
- bottom: 0;
406
- height: 11px;
407
- line-height: 11px;
408
- color: #ccc;
409
- background-color: #323232;
410
- }
411
- .player .items .backpack {
412
- filter: grayscale(100%);
413
- }
414
- .player .items .backpack .item,
415
- .player .items .bear .item {
416
- width: 30px;
417
- height: 22px;
418
- margin: 1px;
419
- position: relative;
420
- }
421
- .player .neutral_item {
422
- grid-row: 1 / span 3;
423
- grid-column: 7;
424
- overflow: hidden;
425
- height: 32px;
426
- width: 32px;
427
- border-radius: 50%;
428
- background-size: auto 100%;
429
- background-position: center;
430
- margin-left: 2px;
431
- }
432
- .player .items .item.recipe {
433
- background-image: url("https://cdn.cloudflare.steamstatic.com/apps/dota2/images/dota_react/items/recipe.png");
434
- background-size: 100%;
435
- }
436
-
437
- .player .ahgs {
438
- grid-row: 1 / span 3;
439
- grid-column: 8;
440
- }
441
- .player .items .bear {
442
- height: 24px;
443
- width: 192px;
444
- grid-row: 2;
445
- grid-column: 2;
446
- }
447
- .player.bear .items .bear .time {
448
- font-size: 10px;
449
- }
450
- .player.bear .items .bear_icon {
451
- grid-row: 2;
452
- grid-column: 1;
453
- }
454
- .player.bear .items .neutral_item {
455
- height: 24px;
456
- width: 24px;
457
- grid-row: 2;
458
- grid-column: 3;
459
- }
460
- /* .player .items .backpack .item img{
461
- height: 22px;
462
- width: auto;
463
- } */
@@ -1,192 +0,0 @@
1
-
2
- <% const match = data; %>
3
- <% function darkenHexColor(hex, percentage) {
4
- // 移除前缀 #
5
- hex = hex.replace(/^#/, '');
6
-
7
- // 处理三位 hex 颜色值
8
- if (hex.length === 3) {
9
- hex = hex.split('').map(char => char + char).join('');
10
- }
11
-
12
- // 将 hex 转换为 RGB
13
- let r = parseInt(hex.substring(0, 2), 16);
14
- let g = parseInt(hex.substring(2, 4), 16);
15
- let b = parseInt(hex.substring(4, 6), 16);
16
-
17
- // 将 RGB 变暗
18
- r = Math.floor(r * (1 - percentage / 100));
19
- g = Math.floor(g * (1 - percentage / 100));
20
- b = Math.floor(b * (1 - percentage / 100));
21
-
22
- // 将 RGB 转换回 hex
23
- const darkenedHex = `#${((1 << 24) + (r << 16) + (g << 8) + b)
24
- .toString(16)
25
- .slice(1)
26
- .toUpperCase()}`;
27
-
28
- return darkenedHex;
29
- } %>
30
- <% function calcFacetNameFontSize(name) {
31
- if (name) {
32
- if (name.length <= 4) return "11px";
33
- else if (name.length == 5) return "8px";
34
- else if (name.length >= 6) return "7px";
35
- }
36
- return "10px"
37
- }
38
- %>
39
- <nav>
40
- <div class="match_id">
41
- <p><%= $t("dota2tracker.template.match_id_").slice(0, -1) %> <%-match.id%></p>
42
- <p class="<%-match.odParsed?"opendota":(match.parsedDateTime?'success':'fail')%>"><!--伪类赋值:类名输入success时此处为※录像分析成功,fail为※分析结果不完整,同时自动应用字体颜色样式。--></p>
43
- </div>
44
- <div class="start_time">
45
- <p><%= $t("dota2tracker.template.start_time_").slice(0, -1) %></p>
46
- <p><%-DateTime.fromSeconds(match.startDateTime).toFormat("yyyy-MM-dd HH:mm:ss").slice(2)%></p>
47
- </div>
48
- <div class="duration">
49
- <p><%= $t("dota2tracker.template.duration_").slice(0, -1) %></p>
50
- <p><%-match.durationTime%></p>
51
- </div>
52
- <div class="region">
53
- <p><%= $t("dota2tracker.template.region_").slice(0, -1) %></p>
54
- <p><%-$t("dota2tracker.template.regions." + match.regionId)%></p>
55
- </div>
56
- <div class="mode">
57
- <p><%= $t("dota2tracker.template.game_mode_").slice(0, -1) %></p>
58
- <p><%-$t("dota2tracker.template.lobby_types."+match.lobbyType) || match.lobbyType%>/<%-$t("dota2tracker.template.game_modes."+match.gameMode) || match.gameMode%></p>
59
- </div>
60
- <div class="rank"<%- match.odParsed && match.lobbyType !== "RANKED" ? ` style="filter:grayscale(1)"` : "" %>>
61
- <img src="<%-getImageUrl('medal_' + (match.rank?.toString().split('')[0] ?? '0'))%>" alt="" />
62
- <img style="z-index: 1;" src="<%-getImageUrl('star_' + (match.rank?.toString().split('')[1] ?? '0'))%>" alt="" />
63
- </div>
64
- </nav>
65
- <section class="match_result">
66
- <span class="kills radiant"><%-match.radiant.killsCount%></span>
67
- <span class="win <%-match.didRadiantWin?'radiant':'dire'%>"><!--伪类赋值:类名输入radiant此处为天辉获胜,dire为夜魇获胜,同时自动应用字体颜色样式。--></span>
68
- <span class="kills dire"><%-match.dire.killsCount%></span>
69
- </section>
70
- <section class="players">
71
- <% ['radiant','dire'].forEach(function(team) { %>
72
- <section class="panel <%= team %>" <%- `style="order: ${team === 'radiant' ? 0 : 50 }"`%>>
73
- <img src="<%- getImageUrl('logo_' + team) %>">
74
- <p><%- (team === 'radiant' ? ['Radiant','天辉'] : ['Dire','夜魇']).join('<br>') %></p>
75
- <% if ((team === 'radiant') === match.didRadiantWin) { %>
76
- <p class="win"><%= $t('dota2tracker.template.won') %></p>
77
- <% } else { %>
78
- <p></p>
79
- <% } %>
80
- <p class="data"><%= $t('dota2tracker.template.kill') %><br><%= match[team].killsCount %></p>
81
- <p class="data"><%= $t('dota2tracker.template.total_damage') %><br><%= match[team].heroDamage %></p>
82
- <p class="data"><%= $t('dota2tracker.template.total_gold') %><br><%= match[team].networth %></p>
83
- <p class="data"><%= $t('dota2tracker.template.total_experience') %><br><%= match[team].experience %></p>
84
- </section>
85
- <% }); %>
86
-
87
- <% match.players.forEach(function(player) { %>
88
- <div class="player <%= player.team %><%= player.hero.id == 80 ? ' bear' : '' %>" <%- `style="order: ${player.team === 'radiant' ? 1 : 100}"` %>;>
89
- <div class="hero_avatar row-1<%= player.partyId != null ? ' party_' + match.party[player.partyId] : '' %>">
90
- <img src="<%- getImageUrl(player.hero.shortName, ImageType.Heroes) %>" />
91
- <p class="level"><%= player.level %></p>
92
- <p class="party_line"></p>
93
- <p class="party_mark"></p>
94
- </div>
95
- <div class="facet <%= player.facet?.color ?? 'Black' %>">
96
- <% if (player.facet) { %>
97
- <img src="<%- getImageUrl(player.facet.icon, ImageType.IconsFacets) %>">
98
- <% } %>
99
- <span <%- `style="font-size: ${calcFacetNameFontSize(player.facet?.displayName)};"`%>>
100
- <p><%= player.facet?.displayName ?? '?' %></p>
101
- </span>
102
- </div>
103
- <div class="rank">
104
- <img src="<%- getImageUrl('medal_' + (player.rank.inTop100 ?? player.rank.medal)) %>" class="medal" />
105
- <img src="<%- getImageUrl('star_' + player.rank.star) %>" class="stars" />
106
- <p><%= player.steamAccount.seasonLeaderboardRank ?? '' %></p>
107
- </div>
108
- <div class="titles">
109
- <% player.titles.forEach(function(item) {
110
- const [title, color] = $t(item).split('-'); %>
111
- <span <%- `style="color: ${darkenHexColor(color, 25)};"` %>><%= title %></span>
112
- <% }); %>
113
- </div>
114
- <div class="player_name row-1">
115
- <span class="rank">[<%= $t('dota2tracker.template.ranks.' + player.rank.medal) %><%= player.rank.star || '' %>]</span>
116
- <span class="name"><%= player.steamAccount.name %></span>
117
- </div>
118
- <p class="pick">
119
- <%- player.isRandom ? $t('dota2tracker.template.random') : $t('dota2tracker.template.pick_order', [player.order == null ? '?' : player.order + 1]) %>
120
- <%= $t('dota2tracker.template.position_' + player.position?.slice(-1)) ?? '' %>
121
- </p>
122
- <p class="networth">
123
- <span class="gold"><%= player.formattedNetworth %></span>
124
- (<%= (player.heroDamage / player.networth)?.toFixed(2) %>)
125
- </p>
126
- <p class="hero_damage">
127
- <%= $t('dota2tracker.template.hero_damage_') %><%= player.heroDamage %>
128
- (<%= (player.heroDamage / match[player.team].heroDamage * 100).toFixed(2) %>%)
129
- </p>
130
- <p class="damage_received">
131
- <%= $t('dota2tracker.template.damage_received_') %><%= player.damageReceived %>
132
- (<%= match[player.team].damageReceived > 0 ? ((player.damageReceived / match[player.team].damageReceived * 100).toFixed(2)) : '0.00' %>%)
133
- </p>
134
- <p class="tower_damage">
135
- <%= $t('dota2tracker.template.building_damage_') %><%= player.towerDamage %>
136
- </p>
137
- <p class="kda row-1">
138
- <%= player.kills %>/<%= player.deaths %>/<%= player.assists %>
139
- (<%= ((player.kills + player.assists) / (player.deaths || 1)).toFixed(2) %>)
140
- </p>
141
- <p class="kill_contribution">
142
- <%= $t('dota2tracker.template.kill_contribution_') %><%= (player.killContribution * 100).toFixed(2) %>%
143
- </p>
144
- <p class="stun_duration">
145
- <%= $t('dota2tracker.template.crowd_control_duration_') %>
146
- <%= ((player.stats.heroDamageReport?.dealtTotal.stunDuration ?? 0) / 100).toFixed(2) %>s
147
- </p>
148
- <p class="heal">
149
- <%= $t('dota2tracker.template.heal_') %><%= player.heroHealing %>
150
- </p>
151
- <div class="items row-1">
152
- <div class="normal">
153
- <% player.items.forEach(function(item) { %>
154
- <div class="item<%= item?.isRecipe ? ' recipe' : '' %>" data-id="<%= item?.id ?? 0 %>">
155
- <img src="<%- item ? getImageUrl(item.name, ImageType.Items) : '' %>" alt="" />
156
- <% if (item) { %>
157
- <p class="time"><%= item?.time ?? '' %></p>
158
- <% } %>
159
- </div>
160
- <% }); %>
161
- </div>
162
- <% if (player.hero.id != 80) { %>
163
- <div class="backpack">
164
- <% player.backpacks.forEach(function(item) { %>
165
- <div class="item<%= item?.isRecipe ? ' recipe' : '' %>">
166
- <img src="<%- item ? getImageUrl(item.name, ImageType.Items) : '' %>" alt="" />
167
- </div>
168
- <% }); %>
169
- </div>
170
- <% } else { %>
171
- <img class="bear_icon" src="<%- getImageUrl('lone_druid_spirit_bear', ImageType.Abilities) %>" alt="">
172
- <div class="bear">
173
- <% player.unitItems.forEach(function(item) { %>
174
- <div class="item<%= item?.isRecipe ? ' recipe' : '' %>" data-id="<%= item?.id ?? 0 %>">
175
- <img src="<%- item ? getImageUrl(item.name, ImageType.Items) : '' %>" alt="" />
176
- <% if (item) { %>
177
- <p class="time"><%= item?.time ?? '' %></p>
178
- <% } %>
179
- </div>
180
- <% }); %>
181
- </div>
182
- <div class="neutral_item" <%- `style="background-image: url(${getImageUrl(dotaconstants.item_ids[player.additionalUnit.neutral0Id], ImageType.Items)})"` %>></div>
183
- <% } %>
184
- </div>
185
- <div class="neutral_item row-1" <%- `style="background-image: url(${getImageUrl(dotaconstants.item_ids[player.neutral0Id], ImageType.Items)})"` %>></div>
186
- <div class="ahgs row-1">
187
- <img src="<%- getImageUrl('scepter_' + ((player.items.concat(player.backpacks).find(item => item?.id == 108) || (player.stats?.matchPlayerBuffEvent || []).find(buff => buff.itemId == 108)) ? 1 : 0)) %>" alt="" />
188
- <img src="<%- getImageUrl('shard_' + ((player.stats?.matchPlayerBuffEvent || []).find(buff => buff.itemId == 609) ? 1 : 0)) %>" alt="" />
189
- </div>
190
- </div>
191
- <% }); %>
192
- </section>