-
Notifications
You must be signed in to change notification settings - Fork 0
/
selectChampion.html
308 lines (287 loc) · 10.3 KB
/
selectChampion.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="renderer" content="webkit">
<title>兔玩英雄训练营表情包制作工具</title>
<style>
html{
font-size: 100px;
}
html,body,ul,li,form,p{
padding: 0;
margin:0;
}
body{
/*background-size: contain;*/
font-size: 14px;
background: #06090c url(//res.tuwan.com/templet/weixin/lolhero/images/background.jpg) top no-repeat;
background-size: 100%;
position: relative;
}
.contentBox{
padding-top:16%;
}
.championBox{
width: 78%;
text-align: center;
margin: 2% auto 0;
min-height: 180px;
}
.champion-link{
display: inline-block;
width: 65px;
height: 65px;
margin: 0 5px 10px;
-webkit-clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
background-color: #d3b98a;
font-size: 0;
padding: 5px;
}
.champion-icon{
transform: scale(1.1);
transform-origin: center center;
width: 65px;
height:65px;
-webkit-clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
background-size: 120%;
background-position: -7px -7px;
}
.loading{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 5;
}
.loading img{
position: absolute;
width: 50px;
height: 50px;
top:50%;
margin-top: -25px;
left:50%;
margin-left: -25px;
}
.title{
font-size: 0;
margin:0 auto 0;
width: 70%;
}
.title1{
font-size: 0;
margin:0 auto 0;
width: 70%;
}
.title img,.title1 img{
width: 100%;
display: block;
}
.tips{
width: 78%;
margin:10px auto 0;
display: flex;
align-items: center;
justify-content: center;
}
.tips img{
width: 35px;
}
.tips-text{
font-size: 16px;
color: #eee;
font-weight: bold;
margin-left: 20px;
}
.qrcode{
display: flex;
width: 80%;
margin:0 auto;
justify-content: space-around;
align-items: center;
padding: 20px 0 10px;
margin-top: 30%;
}
.qrcode img{
width:120px;
height: 120px;
}
.qrcode p{
padding:0;
color: #5eb5ea;
}
.summoner{
text-align: center;
}
.summoner .summoner-icon{
border-radius: 50%;
border: 2px solid #D3B98A;
width: 16%;
margin-top: -7%;
}
.summoner p{
font-size: 0.16rem;
color: #D3B98A;
font-weight: bold;
margin-bottom: 2%;
}
.my-btn{
margin-bottom: 15px;
display: block;
max-width:72%;
margin-left: auto;
margin-right: auto;
border-style: solid;
border-width: 4px;
border-color: rgb(23, 58, 143);
border-radius: 0;
box-shadow: 2.828px 2.828px 0 0 #cb4b32;
height: 25px;
line-height: 25px;
background-color: #1ba7f9;
color: #fff;
font-weight: bold;
font-size: 14px;
box-sizing: content-box;
cursor: pointer;
text-align: center;
text-decoration: none;
}
@media (max-width: 370px) {
.qrcode img{
width: 70px;
height: 70px;
}
.championBox{
min-height: 150px;
}
.champion-link,.champion-icon{
width: 50px;
height: 50px;
}
}
@media (max-width: 380px) {
.qrcode {
margin-top: 24%;
}
.tips-text{
font-size: 14px;
}
}
@media (max-width: 330px) {
.qrcode {
margin-top: 20%;
}
.tips-text{
font-size: 12px;
}
}
@media (min-width: 426px) {
.qrcode {
margin-top: 40%;
}
}
@media (min-width: 520px) {
.qrcode {
margin-top: 0%;
}
}
</style>
<script src="//cdn.tgp.qq.com/lol/conf/LOLGameArea.js"></script>
<script src="//res.tuwan.com/templet/weixin/lolhero/js/util.js"></script>
<script>
window.onload=function(){
// 获取需要查询的召唤师名字和大区ID
var urlSearch=window.location.search;
var urlSearchArr=urlSearch.replace(/^\?/,"").split("&");
var urlSearchObj={};
for(var i=0;i<urlSearchArr.length;i++){
var arr=urlSearchArr[i].split("=");
urlSearchObj[arr[0]]=arr[1];
}
util.ajax({
type:"jsonp",
url:"//app.tuwan.com/lolapi/api/getPlayerHeroes.ashx"+urlSearch,
success:function(data){
if(!data.status){
var championList=data;
championList.sort(function(a,b){
return b.win_num*b.win_num/b.use_num-a.win_num*a.win_num/a.use_num;
});
var championLines;
util.ajax({
url: "//res.tuwan.com/templet/weixin/lolhero/js/championLines.json",
type: "GET",
success: function (response) {
championLines=response.data;
var imgHTML="";
var maxLength=6;
var length=championList.length>maxLength?maxLength:championList.length;
for(var i=0;i<length;i++){
var key=championLines[championList[i].champion_id].key;
var title=championLines[championList[i].champion_id].title;
var url="//wx.tuwan.com/events/lolhero_result"+urlSearch+"&championid="+championList[i].champion_id;
imgHTML+='<a href="'+url+'" class="champion-link"><div style="background-image:url(//ossweb-img.qq.com/images/lol/img/champion/'+key+'.png)" alt="'+title+'" data-url="'+url+'" class="champion-icon"></div></a>';
}
document.querySelector("#championBox").innerHTML=imgHTML;
document.querySelector(".loading").style.display="none";
},
failed:function(){
alert("服务器错误或网络过慢,请稍后再试");
}
});
}else if(data.status===1){
alert("你查找的用户不存在,请检查大区或召唤师名称");
window.location.href="//wx.tuwan.com/events/lolhero"
}else if(data.status===4){
alert("服务器暂时无法访问,请稍后再试")
}
}
});
util.ajax({
type:"jsonp",
url:"//app.tuwan.com/lolapi/api/getRank.ashx"+urlSearch,
success:function(data){
if(data.status){
return;
}
document.querySelector("#summonerIcon").setAttribute("src",data.icon);
document.querySelector("#summonerName").innerText=data.name;
},
failed:function(){
alert("服务器错误或网络过慢,请稍后再试");
}
})
}
</script>
</head>
<body>
<div class="loading"><img src="//res.tuwan.com/templet/weixin/lolhero/images/loading.svg" alt="loading"></div>
<div class="contentBox">
<div class="title"><img src="//res.tuwan.com/templet/weixin/lolhero/images/top.png" alt="标题"></div>
<div class="summoner">
<img class="summoner-icon" id="summonerIcon" src="//cdn.tgp.qq.com/lol/images/resources/usericon/2094.png" alt="召唤师头像">
<p id="summonerName">加载中</p>
</div>
<div class="title1"><img src="//res.tuwan.com/templet/weixin/lolhero/images/title2.png" alt="标题">我的本命英雄</div>
<div class="championBox" id="championBox">
</div>
<div class="tips">
<img src="//res.tuwan.com/templet/weixin/lolhero/images/click.png" alt="">
<span class="tips-text">点击头像生成专属表情包</span>
</div>
</div>
<div class="qrcode">
<div><img src="//res.tuwan.com/templet/weixin/lolhero/images/qrcode.jpg" alt=""></div>
<p>排位诊断报告<br>长按扫码立即获取</p>
</div>
<a class="my-btn" id="backToIndex" href="//wx.tuwan.com/events/lolhero" >回到查询页</a>
<!--<label for="selectId">请输入英雄名<select id="selectId" class="selectId form-control"></select></label>-->
</body>
</html>