양윤지

Fix Css and index.js file

......@@ -57,3 +57,16 @@ body{
.fontsizeup{
font-size: 15px;
}
table.basic
{
margin:0; padding: 0;line-height: 21px;
border-collapse: collapse;
}
table.basic td{
margin: 0; padding: 3px; width:200px;
text-align: center;
border-right: 1px solid black;
border-bottom: 1px solid black;
}
......
......@@ -10,7 +10,7 @@ var id; //소환사ID
var accountId; //계정Id
var name; //소환사 이름
var summonerLevel; //소환사
var lotation_champ = new Array();
var rotation_champ = new Array();
app.get('/', function(req, res) {
res.render('main', { title: 'R U TROLL?' });
......@@ -46,9 +46,9 @@ var lotation_champ = new Array();
var champ_point = new Array();
var champ_id = new Array();
var champ_name = new Array();
var lotation_name = new Array();
var rotation_name = new Array();
var champ_pic = new Array();
var lotation_pic =new Array();
var rotation_pic =new Array();
var champions_length = Object.keys(info_champ_json).length;
//console.log("\n\ninfo_champ_json\n\n", info_champ_json);
......@@ -67,15 +67,15 @@ var lotation_champ = new Array();
champ_id[i] = info_champ_json[i]["championId"];
}
var lotationUrl = "https://kr.api.riotgames.com/lol/platform/v3/champion-rotations?api_key="+apikey;
request(lotationUrl,function(error,response,body){
var info_lotation = JSON.parse(body);
var keys = Object.keys(info_lotation);
for(var k =0; k < info_lotation[keys[0]].length;k++)
var rotationUrl = "https://kr.api.riotgames.com/lol/platform/v3/champion-rotations?api_key="+apikey;
request(rotationUrl,function(error,response,body){
var info_rotation = JSON.parse(body);
var keys = Object.keys(info_rotation);
for(var k =0; k < info_rotation[keys[0]].length;k++)
{
lotation_champ[k] =info_lotation[keys[0]][k]
console.log("lotation_champ:"+lotation_champ[k]);
console.log("로테길이:"+lotation_champ.length);
rotation_champ[k] =info_rotation[keys[0]][k]
console.log("rotation_champ:"+rotation_champ[k]);
console.log("로테길이:"+rotation_champ.length);
}
......@@ -100,9 +100,9 @@ var lotation_champ = new Array();
for(var i=0; i < champ_id.length; i++){
for(js in champion){
for(j in champion[js]){
if(champion[js]["key"] == lotation_champ[i]){
lotation_name[i] = champion[js]["id"];
lotation_pic[i] = "http://ddragon.leagueoflegends.com/cdn/9.23.1/img/champion/"+lotation_name[i]+".png";
if(champion[js]["key"] == rotation_champ[i]){
rotation_name[i] = champion[js]["id"];
rotation_pic[i] = "http://ddragon.leagueoflegends.com/cdn/9.23.1/img/champion/"+rotation_name[i]+".png";
}
}
......@@ -202,7 +202,7 @@ var lotation_champ = new Array();
c_name: champ_name,
c_point: champ_point,
c_pic: champ_pic,
c_lotation : lotation_pic,
c_rotation : rotation_pic,
c_summoner: summoner,
c_wins: wins,
c_losses: losses,
......
......@@ -21,34 +21,40 @@
</script>
</head>
<body>
<div class="imgOpacity">
<div class="center">
<img src= "FindMelogo.png" width = 300, height = 300/>
</div>
<div class="center">
<input type="text" class="input_text" placeholder="소환사 이름">
<div class="imgOpacity">
<div class="center">
<img src= "/FindMelogo.png" width = 150, height = 150/>
</div>
<div class="center2">
<input type="text" class="input_text" placeholder="소환사 이름">
<span class="input-group-btn">
<button id="searchButton" class="btn btn-primary" type="button" onclick="search(name)">click!</button>
</span>
</div>
<button id="searchButton" class="btn btn-primary" type="button" onclick="search(name)">click!</button>
</span>
</div>
</div>
<br></br>
<font size=10em>
<strong>
<%= c_summoner + "\n"%>
</strong>
</font>
<div class="center">
<img src= <%=c_imgtier%> width=120, height=120>
<span class="center">
<%= "Tier : " + c_tier + " " + c_rank + " / " + c_leaguePoint + "점"%>
</span>
<br class="center">
<%= "Win : " + c_wins + " / Lose : " + c_losses%>
</br>
</div>
<div class="center">
<%= "승률 : " + ((c_wins/(c_wins+c_losses))*100).toFixed(2) + "%" %>
</div>
<table class="basic">
<tbody>
<tr><td><%= "Tier : " + c_tier + " " + c_rank + " / " + c_leaguePoint + "점"%></td></tr>
<tr><td><%= "Win : " + c_wins + " / Lose : " + c_losses%></td></tr>
<tr><td><%= "승률 : " + ((c_wins/(c_wins+c_losses))*100).toFixed(2) + "%" %></td></tr>
<tr><td><%= "캐리력 : " + (c_wins/c_losses*2).toFixed(2) %></td></tr>
</tbody>
</table>
<br></br>
<div class="center">
<strong>
......@@ -60,10 +66,13 @@
<strong>
<%= "로테이션 챔피언: " %>
</strong>
<% for (var i=0; i<c_lotation.length-1; i++){ %>
<img src= <%=c_lotation[i]%> width=50, height=50>
<% for (var i=0; i<c_rotation.length-1; i++){ %>
<img src= <%=c_rotation[i]%> width=50, height=50>
<% } %>
</div>
<br></br>
<% for (var i=0; i<c_id.length-1; i++){ %>
<div class="champImage">
<div class="center">
......