Showing
3 changed files
with
60 additions
and
38 deletions
... | @@ -57,3 +57,16 @@ body{ | ... | @@ -57,3 +57,16 @@ body{ |
57 | .fontsizeup{ | 57 | .fontsizeup{ |
58 | font-size: 15px; | 58 | font-size: 15px; |
59 | } | 59 | } |
60 | + | ||
61 | + | ||
62 | +table.basic | ||
63 | +{ | ||
64 | + margin:0; padding: 0;line-height: 21px; | ||
65 | + border-collapse: collapse; | ||
66 | +} | ||
67 | +table.basic td{ | ||
68 | + margin: 0; padding: 3px; width:200px; | ||
69 | + text-align: center; | ||
70 | + border-right: 1px solid black; | ||
71 | + border-bottom: 1px solid black; | ||
72 | +} | ... | ... |
... | @@ -10,7 +10,7 @@ var id; //소환사ID | ... | @@ -10,7 +10,7 @@ var id; //소환사ID |
10 | var accountId; //계정Id | 10 | var accountId; //계정Id |
11 | var name; //소환사 이름 | 11 | var name; //소환사 이름 |
12 | var summonerLevel; //소환사 | 12 | var summonerLevel; //소환사 |
13 | -var lotation_champ = new Array(); | 13 | +var rotation_champ = new Array(); |
14 | 14 | ||
15 | app.get('/', function(req, res) { | 15 | app.get('/', function(req, res) { |
16 | res.render('main', { title: 'R U TROLL?' }); | 16 | res.render('main', { title: 'R U TROLL?' }); |
... | @@ -46,9 +46,9 @@ var lotation_champ = new Array(); | ... | @@ -46,9 +46,9 @@ var lotation_champ = new Array(); |
46 | var champ_point = new Array(); | 46 | var champ_point = new Array(); |
47 | var champ_id = new Array(); | 47 | var champ_id = new Array(); |
48 | var champ_name = new Array(); | 48 | var champ_name = new Array(); |
49 | - var lotation_name = new Array(); | 49 | + var rotation_name = new Array(); |
50 | var champ_pic = new Array(); | 50 | var champ_pic = new Array(); |
51 | - var lotation_pic =new Array(); | 51 | + var rotation_pic =new Array(); |
52 | var champions_length = Object.keys(info_champ_json).length; | 52 | var champions_length = Object.keys(info_champ_json).length; |
53 | 53 | ||
54 | //console.log("\n\ninfo_champ_json\n\n", info_champ_json); | 54 | //console.log("\n\ninfo_champ_json\n\n", info_champ_json); |
... | @@ -67,15 +67,15 @@ var lotation_champ = new Array(); | ... | @@ -67,15 +67,15 @@ var lotation_champ = new Array(); |
67 | champ_id[i] = info_champ_json[i]["championId"]; | 67 | champ_id[i] = info_champ_json[i]["championId"]; |
68 | 68 | ||
69 | } | 69 | } |
70 | - var lotationUrl = "https://kr.api.riotgames.com/lol/platform/v3/champion-rotations?api_key="+apikey; | 70 | + var rotationUrl = "https://kr.api.riotgames.com/lol/platform/v3/champion-rotations?api_key="+apikey; |
71 | - request(lotationUrl,function(error,response,body){ | 71 | + request(rotationUrl,function(error,response,body){ |
72 | - var info_lotation = JSON.parse(body); | 72 | + var info_rotation = JSON.parse(body); |
73 | - var keys = Object.keys(info_lotation); | 73 | + var keys = Object.keys(info_rotation); |
74 | - for(var k =0; k < info_lotation[keys[0]].length;k++) | 74 | + for(var k =0; k < info_rotation[keys[0]].length;k++) |
75 | { | 75 | { |
76 | - lotation_champ[k] =info_lotation[keys[0]][k] | 76 | + rotation_champ[k] =info_rotation[keys[0]][k] |
77 | - console.log("lotation_champ:"+lotation_champ[k]); | 77 | + console.log("rotation_champ:"+rotation_champ[k]); |
78 | - console.log("로테길이:"+lotation_champ.length); | 78 | + console.log("로테길이:"+rotation_champ.length); |
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
... | @@ -100,9 +100,9 @@ var lotation_champ = new Array(); | ... | @@ -100,9 +100,9 @@ var lotation_champ = new Array(); |
100 | for(var i=0; i < champ_id.length; i++){ | 100 | for(var i=0; i < champ_id.length; i++){ |
101 | for(js in champion){ | 101 | for(js in champion){ |
102 | for(j in champion[js]){ | 102 | for(j in champion[js]){ |
103 | - if(champion[js]["key"] == lotation_champ[i]){ | 103 | + if(champion[js]["key"] == rotation_champ[i]){ |
104 | - lotation_name[i] = champion[js]["id"]; | 104 | + rotation_name[i] = champion[js]["id"]; |
105 | - lotation_pic[i] = "http://ddragon.leagueoflegends.com/cdn/9.23.1/img/champion/"+lotation_name[i]+".png"; | 105 | + rotation_pic[i] = "http://ddragon.leagueoflegends.com/cdn/9.23.1/img/champion/"+rotation_name[i]+".png"; |
106 | 106 | ||
107 | } | 107 | } |
108 | } | 108 | } |
... | @@ -202,7 +202,7 @@ var lotation_champ = new Array(); | ... | @@ -202,7 +202,7 @@ var lotation_champ = new Array(); |
202 | c_name: champ_name, | 202 | c_name: champ_name, |
203 | c_point: champ_point, | 203 | c_point: champ_point, |
204 | c_pic: champ_pic, | 204 | c_pic: champ_pic, |
205 | - c_lotation : lotation_pic, | 205 | + c_rotation : rotation_pic, |
206 | c_summoner: summoner, | 206 | c_summoner: summoner, |
207 | c_wins: wins, | 207 | c_wins: wins, |
208 | c_losses: losses, | 208 | c_losses: losses, | ... | ... |
... | @@ -21,34 +21,40 @@ | ... | @@ -21,34 +21,40 @@ |
21 | </script> | 21 | </script> |
22 | </head> | 22 | </head> |
23 | <body> | 23 | <body> |
24 | - <div class="imgOpacity"> | 24 | + |
25 | - <div class="center"> | 25 | + |
26 | - <img src= "FindMelogo.png" width = 300, height = 300/> | 26 | + <div class="imgOpacity"> |
27 | - </div> | 27 | + <div class="center"> |
28 | - <div class="center"> | 28 | + <img src= "/FindMelogo.png" width = 150, height = 150/> |
29 | - <input type="text" class="input_text" placeholder="소환사 이름"> | 29 | + </div> |
30 | + <div class="center2"> | ||
31 | + <input type="text" class="input_text" placeholder="소환사 이름"> | ||
30 | <span class="input-group-btn"> | 32 | <span class="input-group-btn"> |
31 | - <button id="searchButton" class="btn btn-primary" type="button" onclick="search(name)">click!</button> | 33 | + <button id="searchButton" class="btn btn-primary" type="button" onclick="search(name)">click!</button> |
32 | - </span> | 34 | + </span> |
33 | - </div> | 35 | + </div> |
36 | + </div> | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | ||
34 | <br></br> | 41 | <br></br> |
35 | <font size=10em> | 42 | <font size=10em> |
36 | <strong> | 43 | <strong> |
37 | <%= c_summoner + "\n"%> | 44 | <%= c_summoner + "\n"%> |
38 | </strong> | 45 | </strong> |
39 | </font> | 46 | </font> |
40 | - <div class="center"> | 47 | + |
41 | - <img src= <%=c_imgtier%> width=120, height=120> | 48 | + <table class="basic"> |
42 | - <span class="center"> | 49 | + <tbody> |
43 | - <%= "Tier : " + c_tier + " " + c_rank + " / " + c_leaguePoint + "점"%> | 50 | + <tr><td><%= "Tier : " + c_tier + " " + c_rank + " / " + c_leaguePoint + "점"%></td></tr> |
44 | - </span> | 51 | + <tr><td><%= "Win : " + c_wins + " / Lose : " + c_losses%></td></tr> |
45 | - <br class="center"> | 52 | + <tr><td><%= "승률 : " + ((c_wins/(c_wins+c_losses))*100).toFixed(2) + "%" %></td></tr> |
46 | - <%= "Win : " + c_wins + " / Lose : " + c_losses%> | 53 | + <tr><td><%= "캐리력 : " + (c_wins/c_losses*2).toFixed(2) %></td></tr> |
47 | - </br> | 54 | + </tbody> |
48 | - </div> | 55 | + </table> |
49 | - <div class="center"> | 56 | + |
50 | - <%= "승률 : " + ((c_wins/(c_wins+c_losses))*100).toFixed(2) + "%" %> | 57 | + |
51 | - </div> | ||
52 | <br></br> | 58 | <br></br> |
53 | <div class="center"> | 59 | <div class="center"> |
54 | <strong> | 60 | <strong> |
... | @@ -60,10 +66,13 @@ | ... | @@ -60,10 +66,13 @@ |
60 | <strong> | 66 | <strong> |
61 | <%= "로테이션 챔피언: " %> | 67 | <%= "로테이션 챔피언: " %> |
62 | </strong> | 68 | </strong> |
63 | - <% for (var i=0; i<c_lotation.length-1; i++){ %> | 69 | + <% for (var i=0; i<c_rotation.length-1; i++){ %> |
64 | - <img src= <%=c_lotation[i]%> width=50, height=50> | 70 | + <img src= <%=c_rotation[i]%> width=50, height=50> |
65 | <% } %> | 71 | <% } %> |
66 | </div> | 72 | </div> |
73 | + | ||
74 | + <br></br> | ||
75 | + | ||
67 | <% for (var i=0; i<c_id.length-1; i++){ %> | 76 | <% for (var i=0; i<c_id.length-1; i++){ %> |
68 | <div class="champImage"> | 77 | <div class="champImage"> |
69 | <div class="center"> | 78 | <div class="center"> | ... | ... |
-
Please register or login to post a comment