이정호

final

1 -function func(info_match, championId, win, kills, deaths, assists, largestMultiKill, num) { 1 +function func(info_match, championId, win, kills, deaths, assists, kda, largestMultiKill, temp, firstBloodKill, num) {
2 for (var i = 0; i < 10; i++) { 2 for (var i = 0; i < 10; i++) {
3 if (info_match["participants"][i]["championId"] == championId[num]) { 3 if (info_match["participants"][i]["championId"] == championId[num]) {
4 win[num] = info_match["participants"][i]["stats"]["win"]; 4 win[num] = info_match["participants"][i]["stats"]["win"];
5 kills[num] = info_match["participants"][i]["stats"]["kills"]; 5 kills[num] = info_match["participants"][i]["stats"]["kills"];
6 deaths[num] = info_match["participants"][i]["stats"]["deaths"]; 6 deaths[num] = info_match["participants"][i]["stats"]["deaths"];
7 assists[num] = info_match["participants"][i]["stats"]["assists"]; 7 assists[num] = info_match["participants"][i]["stats"]["assists"];
8 - largestMultiKill[num] = info_match["participants"][i]["stats"]["largestMultiKill"] 8 + kda[num] = (kills[num] + assists[num]) / deaths[num];
9 + largestMultiKill[num] = info_match["participants"][i]["stats"]["largestMultiKill"];
10 + temp[num] = kda[num] * (info_match["participants"][i]["stats"]["totalDamageDealtToChampions"] + info_match["participants"][i]["stats"]["totalDamageTaken"] * info_match["participants"][i]["stats"]["goldEarned"] / info_match["gameDuration"]) / 10000;
11 + firstBloodKill[num] = info_match["participants"][i]["stats"]["firstBloodKill"];
9 } 12 }
10 } 13 }
11 } 14 }
...@@ -14,14 +17,14 @@ module.exports = function(app) { ...@@ -14,14 +17,14 @@ module.exports = function(app) {
14 17
15 var request = require("request"); 18 var request = require("request");
16 var urlenconde = require('urlencode'); 19 var urlenconde = require('urlencode');
17 - var apikey = "RGAPI-8547dfd4-a79e-4392-b60d-f89b0fd1347c"; //api 20 + var apikey = "RGAPI-8547dfd4-a79e-4392-b60d-f89b0fd1347c"; //api key
18 21
19 - var profileIconId; //아이콘 번호 22 + var profileIconId; //프로필 아이콘
20 - var revisionDate; //수정날짜 23 + var revisionDate; //수정 날짜
21 - var id; //소환사ID 24 + var id; //소환사 id
22 - var accountId; //계정Id 25 + var accountId; //계정 id
23 var name; //소환사 이름 26 var name; //소환사 이름
24 - var summonerLevel; //소환사 27 + var summonerLevel; //소환사 레벨
25 var rotation_champ = new Array(); 28 var rotation_champ = new Array();
26 29
27 app.get('/', function(req, res) { 30 app.get('/', function(req, res) {
...@@ -29,12 +32,11 @@ module.exports = function(app) { ...@@ -29,12 +32,11 @@ module.exports = function(app) {
29 }); 32 });
30 33
31 app.get('/search/:username/', function(req, res, next) { 34 app.get('/search/:username/', function(req, res, next) {
32 - // api url 35 + //리그오브레전드 api url
33 name = req.params.username; 36 name = req.params.username;
34 var nameUrl = "https://kr.api.riotgames.com/lol/summoner/v4/summoners/by-name/" + urlenconde(name) + "?api_key=" + apikey; 37 var nameUrl = "https://kr.api.riotgames.com/lol/summoner/v4/summoners/by-name/" + urlenconde(name) + "?api_key=" + apikey;
35 request(nameUrl, function(error, response, body) { 38 request(nameUrl, function(error, response, body) {
36 - // 요청에 대한 응답이 성공적으로 왔는지 검사. 39 + //status code != 200, 함수 종료
37 - // status code가 200이 아니면 오류가 있었던 것으로 간주하고 함수 종료.
38 console.log('response code ', response.statusCode); 40 console.log('response code ', response.statusCode);
39 if (response.statusCode != 200) { 41 if (response.statusCode != 200) {
40 console.log('Error with response code22 ', response.statusCode); 42 console.log('Error with response code22 ', response.statusCode);
...@@ -61,8 +63,7 @@ module.exports = function(app) { ...@@ -61,8 +63,7 @@ module.exports = function(app) {
61 var champ_pic = new Array(); 63 var champ_pic = new Array();
62 var rotation_pic = new Array(); 64 var rotation_pic = new Array();
63 var champions_length = Object.keys(info_champ_json).length; 65 var champions_length = Object.keys(info_champ_json).length;
64 - //console.log("\n\ninfo_champ_json\n\n", info_champ_json); 66 + // status code != 200, 함수 종료
65 - // status code가 200이 아니면 종료.
66 if (info_champ_json["status"] != undefined) { 67 if (info_champ_json["status"] != undefined) {
67 if (info_champ_json["status"]["status_code"] != 200) { 68 if (info_champ_json["status"]["status_code"] != 200) {
68 console.log('Error with response code11 ', info_champ_json["status"]["status_code"]); 69 console.log('Error with response code11 ', info_champ_json["status"]["status_code"]);
...@@ -169,48 +170,51 @@ module.exports = function(app) { ...@@ -169,48 +170,51 @@ module.exports = function(app) {
169 var kills = new Array(); 170 var kills = new Array();
170 var deaths = new Array(); 171 var deaths = new Array();
171 var assists = new Array(); 172 var assists = new Array();
173 + var kda = new Array();
172 var largestMultiKill = new Array(); 174 var largestMultiKill = new Array();
175 + var temp = new Array();
176 + var firstBloodKill = new Array();
173 var matchUrl; 177 var matchUrl;
174 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[0]) + "?api_key=" + apikey; 178 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[0]) + "?api_key=" + apikey;
175 request(matchUrl, function(error, response, body){ 179 request(matchUrl, function(error, response, body){
176 var info_match = JSON.parse(body); 180 var info_match = JSON.parse(body);
177 - func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 0); 181 + func(info_match, championId, win, kills, deaths, assists, kda, largestMultiKill, temp, firstBloodKill, 0);
178 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[1]) + "?api_key=" + apikey; 182 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[1]) + "?api_key=" + apikey;
179 request(matchUrl, function(error, response, body){ 183 request(matchUrl, function(error, response, body){
180 var info_match = JSON.parse(body); 184 var info_match = JSON.parse(body);
181 - func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 1); 185 + func(info_match, championId, win, kills, deaths, assists, kda, largestMultiKill, temp, firstBloodKill, 1);
182 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[2]) + "?api_key=" + apikey; 186 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[2]) + "?api_key=" + apikey;
183 request(matchUrl, function(error, response, body){ 187 request(matchUrl, function(error, response, body){
184 var info_match = JSON.parse(body); 188 var info_match = JSON.parse(body);
185 - func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 2); 189 + func(info_match, championId, win, kills, deaths, assists, kda, largestMultiKill, temp, firstBloodKill, 2);
186 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[3]) + "?api_key=" + apikey; 190 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[3]) + "?api_key=" + apikey;
187 request(matchUrl, function(error, response, body){ 191 request(matchUrl, function(error, response, body){
188 var info_match = JSON.parse(body); 192 var info_match = JSON.parse(body);
189 - func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 3); 193 + func(info_match, championId, win, kills, deaths, assists, kda, largestMultiKill, temp, firstBloodKill, 3);
190 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[4]) + "?api_key=" + apikey; 194 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[4]) + "?api_key=" + apikey;
191 request(matchUrl, function(error, response, body){ 195 request(matchUrl, function(error, response, body){
192 var info_match = JSON.parse(body); 196 var info_match = JSON.parse(body);
193 - func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 4); 197 + func(info_match, championId, win, kills, deaths, assists, kda, largestMultiKill, temp, firstBloodKill, 4);
194 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[5]) + "?api_key=" + apikey; 198 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[5]) + "?api_key=" + apikey;
195 request(matchUrl, function(error, response, body){ 199 request(matchUrl, function(error, response, body){
196 var info_match = JSON.parse(body); 200 var info_match = JSON.parse(body);
197 - func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 5); 201 + func(info_match, championId, win, kills, deaths, assists, kda, largestMultiKill, temp, firstBloodKill, 5);
198 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[6]) + "?api_key=" + apikey; 202 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[6]) + "?api_key=" + apikey;
199 request(matchUrl, function(error, response, body){ 203 request(matchUrl, function(error, response, body){
200 var info_match = JSON.parse(body); 204 var info_match = JSON.parse(body);
201 - func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 6); 205 + func(info_match, championId, win, kills, deaths, assists, kda, largestMultiKill, temp, firstBloodKill, 6);
202 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[7]) + "?api_key=" + apikey; 206 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[7]) + "?api_key=" + apikey;
203 request(matchUrl, function(error, response, body){ 207 request(matchUrl, function(error, response, body){
204 var info_match = JSON.parse(body); 208 var info_match = JSON.parse(body);
205 - func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 7); 209 + func(info_match, championId, win, kills, deaths, assists, kda, largestMultiKill, temp, firstBloodKill, 7);
206 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[8]) + "?api_key=" + apikey; 210 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[8]) + "?api_key=" + apikey;
207 request(matchUrl, function(error, response, body){ 211 request(matchUrl, function(error, response, body){
208 var info_match = JSON.parse(body); 212 var info_match = JSON.parse(body);
209 - func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 8); 213 + func(info_match, championId, win, kills, deaths, assists, kda, largestMultiKill, temp, firstBloodKill, 8);
210 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[9]) + "?api_key=" + apikey; 214 matchUrl = "https://kr.api.riotgames.com/lol/match/v4/matches/" + urlenconde(gameId[9]) + "?api_key=" + apikey;
211 request(matchUrl, function(error, response, body){ 215 request(matchUrl, function(error, response, body){
212 var info_match = JSON.parse(body); 216 var info_match = JSON.parse(body);
213 - func(info_match, championId, win, kills, deaths, assists, largestMultiKill, 9); 217 + func(info_match, championId, win, kills, deaths, assists, kda, largestMultiKill, temp, firstBloodKill, 9);
214 champ_name[champ_name.length] = "total"; 218 champ_name[champ_name.length] = "total";
215 var temp_id; 219 var temp_id;
216 var temp_name; 220 var temp_name;
...@@ -281,8 +285,11 @@ module.exports = function(app) { ...@@ -281,8 +285,11 @@ module.exports = function(app) {
281 c_kills : kills, 285 c_kills : kills,
282 c_deaths : deaths, 286 c_deaths : deaths,
283 c_assists : assists, 287 c_assists : assists,
288 + c_kda : kda,
284 c_largestMultiKill : largestMultiKill, 289 c_largestMultiKill : largestMultiKill,
285 - c_pic : picture 290 + c_pic : picture,
291 + c_temp : temp,
292 + c_firstBloodKill : firstBloodKill
286 }); 293 });
287 }); 294 });
288 }); 295 });
...@@ -301,4 +308,4 @@ module.exports = function(app) { ...@@ -301,4 +308,4 @@ module.exports = function(app) {
301 }); 308 });
302 }); 309 });
303 }); 310 });
304 -}; 311 +};
...\ No newline at end of file ...\ No newline at end of file
......
1 -module.exports = function(app){ 1 +module.exports = function(app) {
2 2
3 -var request = require("request"); 3 + var request = require("request");
4 -var urlenconde = require('urlencode'); 4 + var urlenconde = require('urlencode');
5 -var apikey = "RGAPI-8547dfd4-a79e-4392-b60d-f89b0fd1347c"//api 5 + var apikey = "RGAPI-8547dfd4-a79e-4392-b60d-f89b0fd1347c" //api key
6 6
7 -var profileIconId; //아이콘 번호 7 + var profileIconId; //프로필 아이콘
8 -var revisionDate; //수정날짜 8 + var revisionDate; //수정 날짜
9 -var id; //소환사ID 9 + var id; //소환사 id
10 -var accountId; //계정Id 10 + var accountId; //계정 id
11 -var name; //소환사 이름 11 + var name; //소환사 이름
12 -var summonerLevel; //소환사 레벨 12 + var summonerLevel; //소환사 레벨
13 +
14 + app.get('/', function(req, res) {
15 + res.render('main', { title: 'LOL Helper' });
16 + });
13 17
14 -var startIndex; 18 + app.get('/search/:username/', function(req, res) {
15 -var endIndex; 19 + //리그오브레전드 api url
16 -var totalGames; 20 + name = req.params.username;
17 -var matches; //- 21 + var nameUrl = "https://kr.api.riotgames.com/lol/summoner/v3/summoners/by-name/" + urlenconde(name) + "?api_key=" + apikey;
22 + request(nameUrl, function(error, response, body) {
23 + var info_summoner_json = JSON.parse(body);
18 24
19 - app.get('/', function(req, res) { 25 + accountId = info_summoner_json["accountId"];
20 - res.render('main', { title: 'LOL Helper' }); 26 + id = info_summoner_json["id"];
21 - }); 27 + summoner = info_summoner_json["name"];
28 + profileIconId = info_summoner_json["profileIconId"];
29 + summonerLevel = info_summoner_json["summonerLevel"];
30 + revisionDate = info_summoner_json["revisionDate"];
22 31
23 - app.get('/search/:username/', function(req, res){ 32 + var champUrl = "https://kr.api.pvp.net/api/lol/kr/v1.3/stats/by-summoner/" + urlenconde(id) + "/ranked?api_key=" + apikey;
24 - //롤 api url 33 + request(champUrl, function(error, response, body) {
25 - name = req.params.username; 34 + var info_champ_json = JSON.parse(body);
26 - var nameUrl = "https://kr.api.riotgames.com/lol/summoner/v3/summoners/by-name/" + urlenconde(name)+"?api_key="+ apikey; 35 + var champions = info_champ_json["champions"];
27 - request(nameUrl,function(error,response,body){ 36 + var champ_point = new Array();
28 - var info_summoner_json = JSON.parse(body); 37 + var champ_id = new Array();
38 + var champ_name = new Array();
39 + var champ_pic = new Array();
40 + var champions_length = Object.keys(champions).length;
29 41
30 - accountId = info_summoner_json["accountId"]; 42 + for (var i = 0; i < champions_length; i++) {
31 - id = info_summoner_json["id"]; 43 + champ_point[i] = (champions[i]["stats"]["totalSessionsWon"] / champions[i]["stats"]["totalSessionsPlayed"] * 200)
32 - summoner = info_summoner_json["name"]; 44 + + ((champions[i]["stats"]["totalAssists"] + champions[i]["stats"]["totalChampionKills"]) / champions[i]["stats"]["totalDeathsPerSession"] * 100)
33 - profileIconId = info_summoner_json["profileIconId"]; 45 + + (champions[i]["stats"]["totalSessionsPlayed"] * 3);
34 - summonerLevel = info_summoner_json["summonerLevel"]; 46 + champ_id[i] = champions[i]["id"];
35 - revisionDate = info_summoner_json["revisionDate"]; 47 + }
36 48
37 - var rankedUrl = "https://kr.api.pvp.net/api/lol/kr/v2.5/league/by-summoner/"+ urlenconde(id)+ "?api_key=" + apikey; 49 + var staticUrl = "https://global.api.pvp.net/api/lol/static-data/kr/v1.2/champion/?api_key=" + apikey;
38 - var champUrl = "https://kr.api.pvp.net/api/lol/kr/v1.3/stats/by-summoner/" + urlenconde(id) + "/ranked?api_key=" + apikey; 50 + request(staticUrl, function(error, response, body){
39 - request(champUrl,function(error,response,body){ 51 + var info_static_champ_json = JSON.parse(body);
40 - var info_champ_json = JSON.parse(body); 52 + var champion = info_static_champ_json["data"];
41 - var champions = info_champ_json["champions"]; 53 + for (var i = 0; i < champ_id.length; i++) {
42 - var champ_point = new Array(); 54 + for (js in champion) {
43 - var champ_id = new Array(); 55 + for (j in champion[js]) {
44 - var champ_name = new Array(); 56 + if (champion[js]["id"] == champ_id[i]) {
45 - var champ_pic = new Array(); 57 + champ_name[i] = champion[js]["key"];
46 - var champions_length = Object.keys(champions).length; 58 + champ_pic[i] = "https://opgg-static.akamaized.net/images/lol/champion/" + champ_name[i] + ".png?image=c_scale,w_46";
47 - 59 + }
48 - for(var i=0; i < champions_length; i++){ 60 + }
49 - champ_point[i] = (champions[i]["stats"]["totalSessionsWon"]/champions[i]["stats"]["totalSessionsPlayed"]*200) 61 + }
50 - + ((champions[i]["stats"]["totalAssists"]+champions[i]["stats"]["totalChampionKills"])/champions[i]["stats"]["totalDeathsPerSession"]*100) 62 + }
51 - + (champions[i]["stats"]["totalSessionsPlayed"]*3); 63 + champ_name[champ_name.length] = "total";
52 - champ_id[i] = champions[i]["id"]; 64 + var temp_id;
53 - } 65 + var temp_name;
54 - 66 + var temp_point;
55 - var staticUrl = "https://global.api.pvp.net/api/lol/static-data/kr/v1.2/champion/?api_key=" + apikey; 67 + var temp_pic;
56 - request(staticUrl,function(error,response,body){ 68 + for (var i = 0; i < champ_id.length - 1; i++) {
57 - var info_static_champ_json = JSON.parse(body); 69 + for (var j = i + 1; j < champ_id.length - 1; j++)
58 - var champion = info_static_champ_json["data"]; 70 + if (champ_point[i] > champ_point[j]) {
59 - for(var i=0; i < champ_id.length; i++){ 71 + temp_id = champ_id[i];
60 - for(js in champion){ 72 + temp_name = champ_name[i];
61 - for(j in champion[js]){ 73 + temp_point = champ_point[i];
62 - if(champion[js]["id"] == champ_id[i]){ 74 + temp_pic = champ_pic[i];
63 - champ_name[i] = champion[js]["key"]; 75 + champ_id[i] = champ_id[j];
64 - champ_pic[i] = "https://opgg-static.akamaized.net/images/lol/champion/"+champ_name[i]+".png?image=c_scale,w_46"; 76 + champ_name[i] = champ_name[j];
65 - } 77 + champ_point[i] = champ_point[j];
66 - } 78 + champ_pic[i] = champ_pic[j];
67 - } 79 + champ_id[j] = temp_id;
68 - } 80 + champ_name[j] = temp_name;
69 - champ_name[champ_name.length] = "total"; 81 + champ_point[j] = temp_point;
70 - var temp_id; 82 + champ_pic[j] = temp_pic;
71 - var temp_name; 83 + }
72 - var temp_point; 84 + }
73 - var temp_pic; 85 + res.render('index', { title: req.params.username,
74 - for(var i=0; i < champ_id.length-1; i++){ 86 + c_id : champ_id,
75 - for(var j=i+1;j <champ_id.length-1; j++) 87 + c_name : champ_name,
76 - if(champ_point[i] > champ_point[j]){ 88 + c_point : champ_point,
77 - temp_id = champ_id[i]; 89 + c_pic : champ_pic,
78 - temp_name = champ_name[i]; 90 + c_summoner : summoner
79 - temp_point = champ_point[i]; 91 + });
80 - temp_pic = champ_pic[i]; 92 + });
81 - champ_id[i] = champ_id[j] 93 + });
82 - champ_name[i] = champ_name[j]; 94 + });
83 - champ_point[i] = champ_point[j]; 95 + });
84 - champ_pic[i] = champ_pic[j]; 96 +};
85 - champ_id[j] = temp_id
86 - champ_name[j] = temp_name;
87 - champ_point[j] = temp_point;
88 - champ_pic[j] = temp_pic;
89 - }
90 - }
91 -
92 - res.render('index', { title: req.params.username ,
93 - c_id: champ_id,
94 - c_name: champ_name,
95 - c_point: champ_point,
96 - c_pic: champ_pic,
97 - c_summoner: summoner
98 - });
99 - });
100 - });
101 - });
102 - });
103 -};
...\ No newline at end of file ...\ No newline at end of file
......
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 - <meta charset="utf-8"> 4 + <meta charset = "utf-8">
5 <title><%= title %></title> 5 <title><%= title %></title>
6 - <link rel="icon" href = "FindMelogo.png"> 6 + <link rel = "icon" href = "FindMelogo.png">
7 - <link rel="stylesheet" href="css/style.css"> 7 + <link rel = "stylesheet" href = "css/style.css">
8 - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> 8 + <link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
9 - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"> 9 + <link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
10 - <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> 10 + <script src = "https://code.jquery.com/jquery-3.2.1.min.js" integrity = "sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin = "anonymous"></script>
11 <style> @import url("http://fonts.googleapis.com/earlyaccess/nanumgothic.css");</style> 11 <style> @import url("http://fonts.googleapis.com/earlyaccess/nanumgothic.css");</style>
12 <script> 12 <script>
13 - $(document).ready(function(){ 13 + $(document).ready(function() {
14 - $("button#searchButton").click(function(){ 14 + $("button#searchButton").click(function() {
15 var name = $("input").val(); 15 var name = $("input").val();
16 location.href = "http://localhost:3000/search/" + name; 16 location.href = "http://localhost:3000/search/" + name;
17 }) 17 })
...@@ -19,91 +19,119 @@ ...@@ -19,91 +19,119 @@
19 </script> 19 </script>
20 </head> 20 </head>
21 <body> 21 <body>
22 - <div class="imgOpacity"> 22 + <div class = "imgOpacity">
23 - <div class="center"> 23 + <div class = "center">
24 - <img src= "/FindMelogo.png" width = 150, height = 150/> 24 + <img src = "/FindMelogo.png" width = 150, height = 150/>
25 - </div> 25 + </div>
26 - <div class="center2"> 26 + <div class = "center2">
27 - <input type="text" class="input_text" placeholder="소환사 이름"> 27 + <input type = "text" class = "input_text" placeholder = "소환사 이름">
28 - <span class="input-group-btn"> 28 + <span class = "input-group-btn">
29 - <button id="searchButton" class="btn btn-primary" type="button" onclick="search(name)">click!</button> 29 + <button id = "searchButton" class = "btn btn-primary" type = "button" onclick = "search(name)">click!</button>
30 </span> 30 </span>
31 - </div> 31 + </div>
32 - </div> 32 + </div>
33 <br></br> 33 <br></br>
34 - <font size=10em> 34 + <font size = 10em>
35 <strong> 35 <strong>
36 <%= c_summoner + "\n"%> 36 <%= c_summoner + "\n"%>
37 </strong> 37 </strong>
38 </font> 38 </font>
39 - <table class="basic"> 39 + <b>
40 - <tbody> 40 + <font size = 5em>
41 - <tr><td> <img src= <%=c_imgtier%> width=120, height=120></td></tr> 41 + <table class = "basic">
42 - <tr><td><%= "Tier : " + c_tier + " " + c_rank + " / " + c_leaguePoint + "점"%></td></tr> 42 + <tbody>
43 - <tr><td><%= "Win : " + c_wins + " / Lose : " + c_losses%></td></tr> 43 + <tr><td> <img src = <%= c_imgtier%> width=120, height=120></td></tr>
44 - <tr><td><%= "승률 : " + ((c_wins/(c_wins+c_losses))*100).toFixed(2) + "%" %></td></tr> 44 + <tr><td><%= "Tier : " + c_tier + " " + c_rank + " / " + c_leaguePoint + "점"%></td></tr>
45 - </tbody> 45 + <tr><td><%= "Win : " + c_wins + " / Lose : " + c_losses %></td></tr>
46 - </table> 46 + <tr><td><%= "승률 : " + ((c_wins / (c_wins + c_losses)) * 100).toFixed(2) + "%" %></td></tr>
47 - <br></br> 47 + </tbody>
48 - <div class="center"> 48 + </table>
49 + <br></br>
50 + <div class="center">
49 <strong> 51 <strong>
50 - <%= "로테이션 챔피언: " %> 52 + <%= "로테이션 챔피언 : " %>
51 - </strong> 53 + </strong>
52 - <% for (var i=0; i<c_rotation.length-1; i++){ %> 54 + <% for (var i = 0; i < c_rotation.length-1; i++) { %>
53 - <img src= <%=c_rotation[i]%> width=50, height=50> 55 + <img src = <%= c_rotation[i]%> width = 50, height = 50>
56 + <% } %>
57 + </div>
58 + <br></br>
59 + <%= "이 챔피언들은 어떤가요?" %>
60 + <% for (var i = 0; i < 10; i++){ %>
61 + <% if (c_temp[i] > 75) { %>
62 + <img src = <%= c_pic[i]%> width = 50, height = 50>
63 + <% } %>
64 + <% } %>
65 +
66 + <br></br>
67 + <% for (var i = 0; i < 10; i++){ %>
68 + <% if (c_win[i]) { %>
69 + <span style = "color:blue">
70 + <%= "승리" %>
71 + </span>
72 + <% } %>
73 + <% if (!c_win[i]) { %>
74 + <span style = "color:red">
75 + <%= "패배" %>
76 + </span>
54 <% } %> 77 <% } %>
55 - </div>
56 - <b>
57 - <font size = 5em>
58 - <br></br>
59 - <% for (var i = 0; i < 10; i++){ %>
60 - <% if (c_win[i]) { %>
61 - <span style = "color:blue">
62 - <%= "승리" %>
63 - </span>
64 - <% } %>
65 - <% if (!c_win[i]) { %>
66 - <span style = "color:red">
67 - <%= "패배" %>
68 - </span>
69 - <% } %>
70 78
71 - <img src= <%= c_pic[i]%> width = 50, height = 50> 79 + <img src = <%= c_pic[i]%> width = 50, height = 50>
72 80
73 - <%= c_kills[i] + " / " %> 81 + <%= c_kills[i] + " / " %>
74 - <span style = "color:red"> 82 + <span style = "color:red">
75 - <%= c_deaths[i] %> 83 + <%= c_deaths[i] %>
76 - </span> 84 + </span>
77 - <%= " / " + c_assists[i] %> 85 + <%= " / " + c_assists[i] %>
78 86
79 - <%= "\t평점 : " %> 87 + <span style = "color:red">
80 - <% if (c_deaths[i] == 0) { %> 88 + <%= "\t평점" %>
81 - <span style = "color:blue"> 89 + </span>
82 - <%= "Perfect" %> 90 + <% if (c_deaths[i] == 0) { %>
83 - </span> 91 + <span style = "color:blue">
84 - <% } %> 92 + <%= " : Perfect" %>
85 - <% if (c_deaths[i] != 0) { %> 93 + </span>
86 - <%= ((c_kills[i] + c_assists[i]) / c_deaths[i]).toFixed(2) %> 94 + <% } %>
87 - <% } %> 95 + <% if (c_deaths[i] != 0) { %>
96 + <%= " : " + (c_kda[i]).toFixed(2) %>
97 + <% } %>
88 98
89 - <span style = "color : red"> 99 + <span style = "color:red">
90 - <% if (c_largestMultiKill[i] == 2) { %> 100 + <%= "\tCarry Point" %>
91 - <%= "\t더블킬" %> 101 + </span>
92 - <% } %> 102 + <%= " : " + (c_temp[i]).toFixed(2) %>
93 - <% if (c_largestMultiKill[i] == 3) { %> 103 +
94 - <%= "\t트리플킬" %> 104 + <span style = "color:red">
95 - <% } %> 105 + <% if (c_temp[i] > 75) { %>
96 - <% if (c_largestMultiKill[i] == 4) { %> 106 + <%= "Carry" %>
97 - <%= "\t쿼드라킬" %> 107 + <% } %>
98 - <% } %> 108 + </span>
99 - <% if (c_largestMultiKill[i] == 5) { %> 109 +
100 - <%= "\t펜타킬" %> 110 + <span style = "color:green">
111 + <% if (c_firstBloodKill[i]) { %>
112 + <%= "퍼스트 블러드" %>
113 + <% } %>
114 + </span>
115 +
116 + <span style = "color : blue">
117 + <% if (c_largestMultiKill[i] == 2) { %>
118 + <%= "\t더블킬" %>
119 + <% } %>
120 + <% if (c_largestMultiKill[i] == 3) { %>
121 + <%= "\t트리플킬" %>
122 + <% } %>
123 + <% if (c_largestMultiKill[i] == 4) { %>
124 + <%= "\t쿼드라킬" %>
125 + <% } %>
126 + <% if (c_largestMultiKill[i] == 5) { %>
127 + <%= "\t펜타킬" %>
128 + <% } %>
129 + </span>
130 +
131 + <br></br>
101 <% } %> 132 <% } %>
102 - </span> 133 + </b>
103 - <br></br>
104 - <% } %>
105 - </b>
106 </font> 134 </font>
107 -</div> 135 + </div>
108 -</body> 136 + </body>
109 </html> 137 </html>
...\ No newline at end of file ...\ No newline at end of file
......
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 - <meta charset="utf-8"> 4 + <meta charset = "utf-8">
5 <title><%= title %></title> 5 <title><%= title %></title>
6 - <link rel="icon" href = "FindMelogo.png"> 6 + <link rel = "icon" href = "FindMelogo.png">
7 - <link rel="stylesheet" href="css/style.css"> 7 + <link rel = "stylesheet" href = "css/style.css">
8 - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> 8 + <link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
9 - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"> 9 + <link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
10 - <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> 10 + <script src = "https://code.jquery.com/jquery-3.2.1.min.js" integrity = "sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin = "anonymous"></script>
11 <style> @import url("http://fonts.googleapis.com/earlyaccess/nanumgothic.css");</style> 11 <style> @import url("http://fonts.googleapis.com/earlyaccess/nanumgothic.css");</style>
12 <script> 12 <script>
13 - $(document).ready(function(){ 13 + $(document).ready(function() {
14 - 14 + $("button#searchButton").click(function() {
15 - 15 + var name = $("input").val();
16 - $("button#searchButton").click(function(){ 16 + location.href = "http://localhost:3000/search/" + name;
17 - var name = $("input").val(); 17 + })
18 - location.href = "http://localhost:3000/search/" + name; 18 + });
19 - })
20 - });
21 </script> 19 </script>
22 </head> 20 </head>
23 <body> 21 <body>
24 - <div class="imgOpacity"> 22 + <div class = "imgOpacity">
25 - <div class="center"> 23 + <div class = "center">
26 - <img src= "FindMelogo.png" width = 300, height = 300/> 24 + <img src= "FindMelogo.png" width = 300, height = 300/>
25 + </div>
26 + <div class = "center2">
27 + <input type = "text" class = "input_text" placeholder = "소환사명">
28 + <span class = "input-group-btn">
29 + <button id = "searchButton" class = "btn btn-primary" type = "button" onclick = "search(name)">click!</button>
30 + </span>
31 + </div>
27 </div> 32 </div>
28 - <div class="center2"> 33 + </body>
29 - <input type="text" class="input_text" placeholder="소환사명"> 34 +</html>
30 - <span class="input-group-btn">
31 - <button id="searchButton" class="btn btn-primary" type="button" onclick="search(name)">click!</button>
32 - </span>
33 - </div>
34 - </div>
35 -</body>
36 -</html>
...\ No newline at end of file ...\ No newline at end of file
......