@sjtdev/koishi-plugin-dota2tracker 1.1.0 → 1.1.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.
Binary file
Binary file
@@ -664,7 +664,8 @@
664
664
  </script>
665
665
  </head>
666
666
  <body>
667
- <% let kcndcStyle = {
667
+ <% const match = data;
668
+ let kcndcStyle = {
668
669
  kc: function (num) {
669
670
  let red = (255 - (num * 255) / 100).toFixed(2);
670
671
  return `rgb(255,${red},${red})`;
@@ -703,7 +704,7 @@
703
704
  .slice(2)}</span></p>
704
705
  <div class="score">
705
706
  <p class="score radiant">${match.radiant.killsCount}</p>
706
- <p class="time">${sec2time(match.durationSeconds)}</p>
707
+ <p class="time">${utils.sec2time(match.durationSeconds)}</p>
707
708
  <p class="score dire">${match.dire.killsCount}</p>
708
709
  </div>
709
710
  </div>
@@ -764,7 +765,7 @@
764
765
  ? `
765
766
  <div class="item${item.isRecipe ? " recipe" : ""}">
766
767
  <img src="${utils.getImageUrl(item.name, ImageType.Items)}" alt="" />
767
- <p class="time">${sec2time(item.time)}</p>
768
+ <p class="time">${utils.sec2time(item.time)}</p>
768
769
  </div>`
769
770
  : `
770
771
  <div class="item" style="visibility:hidden"}">
@@ -781,7 +782,7 @@
781
782
  ? `
782
783
  <div class="item back${item.isRecipe ? " recipe" : ""}">
783
784
  <img src="${utils.getImageUrl(item.name, ImageType.Items)}" alt="" />
784
- <p class="time">${sec2time(item.time)}</p>
785
+ <p class="time">${utils.sec2time(item.time)}</p>
785
786
  </div>`
786
787
  : `
787
788
  <div class="item back" style="visibility:hidden"}">
@@ -837,7 +838,7 @@
837
838
  ? `
838
839
  <div class="item${item.isRecipe ? " recipe" : ""}">
839
840
  <img src="${utils.getImageUrl(item.name, ImageType.Items)}" alt="" />
840
- <p class="time">${sec2time(item.time)}</p>
841
+ <p class="time">${utils.sec2time(item.time)}</p>
841
842
  </div>`
842
843
  : `
843
844
  <div class="item" style="visibility:hidden"}">
@@ -852,7 +853,7 @@
852
853
  ? `
853
854
  <div class="item back${item.isRecipe ? " recipe" : ""}">
854
855
  <img src="${utils.getImageUrl(item.name, ImageType.Items)}" alt="" />
855
- <p class="time">${sec2time(item.time)}</p>
856
+ <p class="time">${utils.sec2time(item.time)}</p>
856
857
  </div>`
857
858
  : `
858
859
  <div class="item back" style="visibility:hidden"}">
@@ -885,7 +886,7 @@
885
886
  ? `
886
887
  <div class="item${item.isRecipe ? " recipe" : ""}">
887
888
  <img src="${utils.getImageUrl(item.name, ImageType.Items)}" alt="" />
888
- <p class="time">${sec2time(item.time)}</p>
889
+ <p class="time">${utils.sec2time(item.time)}</p>
889
890
  </div>`
890
891
  : `
891
892
  <div class="item" style="visibility:hidden"}">
@@ -900,7 +901,7 @@
900
901
  ? `
901
902
  <div class="item back${item.isRecipe ? " recipe" : ""}">
902
903
  <img src="${utils.getImageUrl(item.name, ImageType.Items)}" alt="" />
903
- <p class="time">${sec2time(item.time)}</p>
904
+ <p class="time">${utils.sec2time(item.time)}</p>
904
905
  </div>`
905
906
  : `
906
907
  <div class="item back" style="visibility:hidden"}">
@@ -176,6 +176,7 @@
176
176
  .player > .titles {
177
177
  grid-row: 4;
178
178
  grid-column: 1 / span 3;
179
+ text-shadow: 1px 1px 0 #333; /* 设置阴影颜色及偏移 */
179
180
  }
180
181
 
181
182
  .player > .player_name {
@@ -201,7 +202,7 @@
201
202
  }
202
203
  .player .networth .gold {
203
204
  color: rgb(203, 176, 42);
204
- text-shadow: 1px 1px 0 #888; /* 设置阴影颜色及偏移 */
205
+ text-shadow: 1px 1px 0 #000; /* 设置阴影颜色及偏移 */
205
206
  }
206
207
 
207
208
  .player .hero_damage {
@@ -327,6 +328,7 @@
327
328
  </style>
328
329
  </head>
329
330
  <body>
331
+ <% const match = data; %>
330
332
  <nav>
331
333
  <div class="match_id">
332
334
  <p>比赛 <%-match.id%></p>
@@ -338,7 +340,7 @@
338
340
  </div>
339
341
  <div class="duration">
340
342
  <p>持续时间</p>
341
- <p><%-sec2time(match.durationSeconds)%></p>
343
+ <p><%-utils.sec2time(match.durationSeconds)%></p>
342
344
  </div>
343
345
  <div class="region">
344
346
  <p>地区</p>
@@ -390,7 +392,7 @@
390
392
  </div>
391
393
  <p class="pick">${player.isRandom?'随机':`第${player.order == null ? "-" : player.order + 1}手`} ${d2a.position[player.position?.slice(-1)]??''}</p>
392
394
  <p class="networth">
393
- <span class="gold">${formatNumber(player.networth)}</span>
395
+ <span class="gold">${utils.formatNumber(player.networth)}</span>
394
396
  (${(player.heroDamage / player.networth)?.toFixed(2)})
395
397
  </p>
396
398
  <p class="hero_damage">造成伤害:${player.heroDamage} (${(player.heroDamage/match[player.team].heroDamage*100).toFixed(2)}%)</p>
@@ -405,7 +407,7 @@
405
407
  ${player.items.map((item) =>`
406
408
  <div class="item${item?.isRecipe ? " recipe" : ""}" data-id="${item?.id??0}">
407
409
  <img src="${item ? utils.getImageUrl(item.name, ImageType.Items) : ""}" alt="" />
408
- ${item ? `<p class="time">${sec2time(item?.time) ?? ""}</p>` : ""}
410
+ ${item ? `<p class="time">${utils.sec2time(item?.time) ?? ""}</p>` : ""}
409
411
  </div>`).join("")}
410
412
  </div>
411
413
  ${player.hero.id != 80?`
@@ -420,7 +422,7 @@
420
422
  ${player.unitItems.map((item) =>`
421
423
  <div class="item${item?.isRecipe ? " recipe" : ""}" data-id="${item?.id??0}">
422
424
  <img src="${item ? utils.getImageUrl(item.name, ImageType.Items) : ""}" alt="" />
423
- ${item ? `<p class="time">${sec2time(item?.time) ?? ""}</p>` : ""}
425
+ ${item ? `<p class="time">${utils.sec2time(item?.time) ?? ""}</p>` : ""}
424
426
  </div>`).join("")}
425
427
  </div>
426
428
  <div class="neutral_item" style="background-image: url(${utils.getImageUrl(dotaconstants.item_ids[player.additionalUnit.neutral0Id], ImageType.Items)})"></div>`