@sjtdev/koishi-plugin-dota2tracker 1.5.4 → 2.0.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.
- package/lib/index.js +2429 -1625
- package/package.json +7 -3
- package/queries/GetWeeklyMetaByPosition.graphql +29 -0
- package/queries/PlayerExtraInfo.graphql +2 -2
- package/queries/PlayerPerformanceForHeroRecommendation.graphql +23 -0
- package/template/hero/hero_1.ejs +29 -29
- package/template/item/item/recipe.ejs +3 -3
- package/template/item/item.ejs +3 -3
- package/template/item/itemlist.ejs +1 -1
- package/template/match/match_1/item.ejs +4 -4
- package/template/match/match_1/main.ejs +8 -8
- package/template/match/match_1/player.ejs +10 -10
- package/template/match/match_1/style.css +12 -0
- package/template/match/match_1.ejs +6 -6
- package/template/match/match_2/original.ejs +122 -82
- package/template/match/match_2+/charts.ejs +3 -3
- package/template/match/match_2+/lane_outcome.ejs +2 -2
- package/template/player/player_1.ejs +49 -23
- package/template/rank/rank_fun.ejs +6 -6
- package/queries/HeroMatchupWinrate.graphql +0 -25
- package/template/guild_member/guild_member.ejs +0 -176
|
@@ -1,176 +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
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" />
|
|
7
|
-
<title>Document</title>
|
|
8
|
-
<style>
|
|
9
|
-
html,
|
|
10
|
-
body {
|
|
11
|
-
background-color: black;
|
|
12
|
-
color: white;
|
|
13
|
-
width: 800px;
|
|
14
|
-
}
|
|
15
|
-
p {
|
|
16
|
-
margin: 0;
|
|
17
|
-
}
|
|
18
|
-
img {
|
|
19
|
-
width: 100%;
|
|
20
|
-
vertical-align: middle;
|
|
21
|
-
}
|
|
22
|
-
.player.full {
|
|
23
|
-
width: 100%;
|
|
24
|
-
border: 1px #fff solid;
|
|
25
|
-
border-radius: 5px;
|
|
26
|
-
box-sizing: border-box;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.player.full .info {
|
|
30
|
-
display: grid;
|
|
31
|
-
grid-template-columns: 64px auto 64px;
|
|
32
|
-
align-items: center;
|
|
33
|
-
/* border-bottom: #fff 1px solid; */
|
|
34
|
-
position: relative;
|
|
35
|
-
padding-bottom: 1px;
|
|
36
|
-
}
|
|
37
|
-
.player.full .info > .name {
|
|
38
|
-
line-height: 20px;
|
|
39
|
-
display: grid;
|
|
40
|
-
grid-template-rows: 24px 18px 14px;
|
|
41
|
-
grid-template-columns: repeat(2, 1fr);
|
|
42
|
-
gap: 2px;
|
|
43
|
-
text-align: center;
|
|
44
|
-
padding: 2px 0;
|
|
45
|
-
}
|
|
46
|
-
.player.full .info > .name > .nick_name {
|
|
47
|
-
font-size: 20px;
|
|
48
|
-
line-height: 24px;
|
|
49
|
-
grid-column: 1/-1;
|
|
50
|
-
}
|
|
51
|
-
.player.full .info > .name > .name {
|
|
52
|
-
line-height: 18px;
|
|
53
|
-
}
|
|
54
|
-
.player.full .info > .name > .id {
|
|
55
|
-
font-size: 12px;
|
|
56
|
-
line-height: 14px;
|
|
57
|
-
color: #888;
|
|
58
|
-
}
|
|
59
|
-
.player.full .info > .name > p {
|
|
60
|
-
display: flex;
|
|
61
|
-
justify-content: space-around;
|
|
62
|
-
}
|
|
63
|
-
.player.full .info > .avatar.steam {
|
|
64
|
-
position: relative;
|
|
65
|
-
}
|
|
66
|
-
.player.full .info > .avatar.steam > .rank {
|
|
67
|
-
top: 0;
|
|
68
|
-
right: 0;
|
|
69
|
-
width: 32px;
|
|
70
|
-
position: absolute;
|
|
71
|
-
}
|
|
72
|
-
.player.full .info > .avatar.steam > p {
|
|
73
|
-
z-index: 1;
|
|
74
|
-
position: absolute;
|
|
75
|
-
bottom: 35px;
|
|
76
|
-
left: 50%;
|
|
77
|
-
width: 32px;
|
|
78
|
-
text-align: center;
|
|
79
|
-
font-size: 4px;
|
|
80
|
-
}
|
|
81
|
-
.player.full .last_match_date {
|
|
82
|
-
position: relative;
|
|
83
|
-
padding-top: 1px;
|
|
84
|
-
}
|
|
85
|
-
.player.full .last_match_date::before {
|
|
86
|
-
content: "";
|
|
87
|
-
position: absolute;
|
|
88
|
-
left: 50%;
|
|
89
|
-
transform: translateX(-50%);
|
|
90
|
-
top: 0;
|
|
91
|
-
width: 80%;
|
|
92
|
-
height: 1px;
|
|
93
|
-
background-color: #666;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.player.full .last10match {
|
|
97
|
-
display: grid;
|
|
98
|
-
gap: 5px;
|
|
99
|
-
grid-template-columns: repeat(5, 1fr);
|
|
100
|
-
grid-template-rows: repeat(2, 1fr);
|
|
101
|
-
align-items: center;
|
|
102
|
-
justify-items: center;
|
|
103
|
-
margin: 4px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.player.full .last10match .match {
|
|
107
|
-
width: 150px;
|
|
108
|
-
height: 36px;
|
|
109
|
-
border-radius: 36px;
|
|
110
|
-
padding: 0 6px;
|
|
111
|
-
display: flex;
|
|
112
|
-
box-sizing: border-box;
|
|
113
|
-
align-items: center;
|
|
114
|
-
flex-direction: row;
|
|
115
|
-
justify-content: space-between;
|
|
116
|
-
}
|
|
117
|
-
.player.full .last10match .match.win {
|
|
118
|
-
background-color: #006400;
|
|
119
|
-
}
|
|
120
|
-
.player.full .last10match .match.lose {
|
|
121
|
-
background-color: #8b0000;
|
|
122
|
-
}
|
|
123
|
-
.player.full .last10match img {
|
|
124
|
-
width: 32px;
|
|
125
|
-
}
|
|
126
|
-
</style>
|
|
127
|
-
|
|
128
|
-
<% if (fontFamily && fontFamily.length > 0) { %>
|
|
129
|
-
<%- "<style>" %>
|
|
130
|
-
<%- `body { font-family: ${fontFamily.map(f => `${f}`).join(", ")}; }` %>
|
|
131
|
-
<%- "</style>" %>
|
|
132
|
-
<% } %>
|
|
133
|
-
</head>
|
|
134
|
-
<body>
|
|
135
|
-
<% const users = data;
|
|
136
|
-
users.forEach(player=>{
|
|
137
|
-
player.rank = {
|
|
138
|
-
medal: parseInt(player.steamAccount.seasonRank?.toString().split("")[0] ?? 0),
|
|
139
|
-
star: parseInt(player.steamAccount.seasonRank?.toString().split("")[1] ?? 0),
|
|
140
|
-
leaderboard: player.steamAccount.seasonLeaderboardRank,
|
|
141
|
-
inTop100: player.steamAccount.seasonLeaderboardRank ? (player.steamAccount.seasonLeaderboardRank <= 10 ? "8c" : player.steamAccount.seasonLeaderboardRank <= 100 ? "8b" : undefined) : undefined,
|
|
142
|
-
}});%>
|
|
143
|
-
<%-users.map(user=>`
|
|
144
|
-
<div class="player full">
|
|
145
|
-
<div class="info">
|
|
146
|
-
<img class="avatar user" src="${user?.user?.avatar}" alt="" />
|
|
147
|
-
<div class="name">
|
|
148
|
-
<span class="nick_name">${eh(user.nickName)}</span>
|
|
149
|
-
<span class="user name">${eh(user.nick || user.user?.name)}</span>
|
|
150
|
-
<span class="steam name">${eh(user.steamAccount.name)}</span>
|
|
151
|
-
<span class="user id">${user.userId}</span>
|
|
152
|
-
<span class="steam id">${user.steamId}</span>
|
|
153
|
-
</div>
|
|
154
|
-
<div class="avatar steam">
|
|
155
|
-
<p>${user.steamAccount.seasonLeaderboardRank??""}</p>
|
|
156
|
-
<img class="rank" src="${utils.getImageUrl('star_' + user.rank.star)}" alt="" />
|
|
157
|
-
<img class="rank" src="${utils.getImageUrl('medal_' +(user.inTop100??user.rank.medal))}" alt="" />
|
|
158
|
-
<img class="avatar" src="${user.steamAccount.avatar}" alt="" />
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
${users.length<10?
|
|
162
|
-
`<div class="last10match">
|
|
163
|
-
${user.matches.map(match=>{
|
|
164
|
-
let playerInMatch = match.players.find(player=>player.steamAccount.id==user.steamId)
|
|
165
|
-
return `
|
|
166
|
-
<div class="match ${match.didRadiantWin==playerInMatch.isRadiant?"win":"lose"}">
|
|
167
|
-
<img src="${utils.getImageUrl(playerInMatch.hero.shortName,ImageType.HeroIcons)}" alt="" />
|
|
168
|
-
<span>${playerInMatch.kills}/${playerInMatch.deaths}/${playerInMatch.assists}</span>
|
|
169
|
-
<span>${(playerInMatch.imp > 0 ? "+" : "") + playerInMatch.imp}</span>
|
|
170
|
-
</div>`}).join("")}
|
|
171
|
-
</div>`:0}
|
|
172
|
-
<div class="last_match_date">最近游戏: ${moment(new Date((user.matches[0]?.startDateTime ?? 0) * 1000)).format("YYYY-MM-DD HH:mm:ss")}</div>
|
|
173
|
-
</div>`).join("")
|
|
174
|
-
%>
|
|
175
|
-
</body>
|
|
176
|
-
</html>
|