Showing
4 changed files
with
142 additions
and
116 deletions
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 | }); | ... | ... |
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 | -var startIndex; | ||
15 | -var endIndex; | ||
16 | -var totalGames; | ||
17 | -var matches; //- | ||
18 | 13 | ||
19 | app.get('/', function(req, res) { | 14 | app.get('/', function(req, res) { |
20 | res.render('main', { title: 'LOL Helper' }); | 15 | res.render('main', { title: 'LOL Helper' }); |
21 | }); | 16 | }); |
22 | 17 | ||
23 | - app.get('/search/:username/', function(req, res){ | 18 | + app.get('/search/:username/', function(req, res) { |
24 | - //롤 api url | 19 | + //리그오브레전드 api url |
25 | name = req.params.username; | 20 | name = req.params.username; |
26 | - var nameUrl = "https://kr.api.riotgames.com/lol/summoner/v3/summoners/by-name/" + urlenconde(name)+"?api_key="+ apikey; | 21 | + var nameUrl = "https://kr.api.riotgames.com/lol/summoner/v3/summoners/by-name/" + urlenconde(name) + "?api_key=" + apikey; |
27 | - request(nameUrl,function(error,response,body){ | 22 | + request(nameUrl, function(error, response, body) { |
28 | var info_summoner_json = JSON.parse(body); | 23 | var info_summoner_json = JSON.parse(body); |
29 | 24 | ||
30 | accountId = info_summoner_json["accountId"]; | 25 | accountId = info_summoner_json["accountId"]; |
... | @@ -34,9 +29,8 @@ var matches; //- | ... | @@ -34,9 +29,8 @@ var matches; //- |
34 | summonerLevel = info_summoner_json["summonerLevel"]; | 29 | summonerLevel = info_summoner_json["summonerLevel"]; |
35 | revisionDate = info_summoner_json["revisionDate"]; | 30 | revisionDate = info_summoner_json["revisionDate"]; |
36 | 31 | ||
37 | - var rankedUrl = "https://kr.api.pvp.net/api/lol/kr/v2.5/league/by-summoner/"+ urlenconde(id)+ "?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; | 32 | var champUrl = "https://kr.api.pvp.net/api/lol/kr/v1.3/stats/by-summoner/" + urlenconde(id) + "/ranked?api_key=" + apikey; |
39 | - request(champUrl,function(error,response,body){ | 33 | + request(champUrl, function(error, response, body) { |
40 | var info_champ_json = JSON.parse(body); | 34 | var info_champ_json = JSON.parse(body); |
41 | var champions = info_champ_json["champions"]; | 35 | var champions = info_champ_json["champions"]; |
42 | var champ_point = new Array(); | 36 | var champ_point = new Array(); |
... | @@ -45,23 +39,23 @@ var matches; //- | ... | @@ -45,23 +39,23 @@ var matches; //- |
45 | var champ_pic = new Array(); | 39 | var champ_pic = new Array(); |
46 | var champions_length = Object.keys(champions).length; | 40 | var champions_length = Object.keys(champions).length; |
47 | 41 | ||
48 | - for(var i=0; i < champions_length; i++){ | 42 | + for (var i = 0; i < champions_length; i++) { |
49 | - champ_point[i] = (champions[i]["stats"]["totalSessionsWon"]/champions[i]["stats"]["totalSessionsPlayed"]*200) | 43 | + champ_point[i] = (champions[i]["stats"]["totalSessionsWon"] / champions[i]["stats"]["totalSessionsPlayed"] * 200) |
50 | - + ((champions[i]["stats"]["totalAssists"]+champions[i]["stats"]["totalChampionKills"])/champions[i]["stats"]["totalDeathsPerSession"]*100) | 44 | + + ((champions[i]["stats"]["totalAssists"] + champions[i]["stats"]["totalChampionKills"]) / champions[i]["stats"]["totalDeathsPerSession"] * 100) |
51 | - + (champions[i]["stats"]["totalSessionsPlayed"]*3); | 45 | + + (champions[i]["stats"]["totalSessionsPlayed"] * 3); |
52 | champ_id[i] = champions[i]["id"]; | 46 | champ_id[i] = champions[i]["id"]; |
53 | } | 47 | } |
54 | 48 | ||
55 | var staticUrl = "https://global.api.pvp.net/api/lol/static-data/kr/v1.2/champion/?api_key=" + apikey; | 49 | var staticUrl = "https://global.api.pvp.net/api/lol/static-data/kr/v1.2/champion/?api_key=" + apikey; |
56 | - request(staticUrl,function(error,response,body){ | 50 | + request(staticUrl, function(error, response, body){ |
57 | var info_static_champ_json = JSON.parse(body); | 51 | var info_static_champ_json = JSON.parse(body); |
58 | var champion = info_static_champ_json["data"]; | 52 | var champion = info_static_champ_json["data"]; |
59 | - for(var i=0; i < champ_id.length; i++){ | 53 | + for (var i = 0; i < champ_id.length; i++) { |
60 | - for(js in champion){ | 54 | + for (js in champion) { |
61 | - for(j in champion[js]){ | 55 | + for (j in champion[js]) { |
62 | - if(champion[js]["id"] == champ_id[i]){ | 56 | + if (champion[js]["id"] == champ_id[i]) { |
63 | champ_name[i] = champion[js]["key"]; | 57 | champ_name[i] = champion[js]["key"]; |
64 | - champ_pic[i] = "https://opgg-static.akamaized.net/images/lol/champion/"+champ_name[i]+".png?image=c_scale,w_46"; | 58 | + champ_pic[i] = "https://opgg-static.akamaized.net/images/lol/champion/" + champ_name[i] + ".png?image=c_scale,w_46"; |
65 | } | 59 | } |
66 | } | 60 | } |
67 | } | 61 | } |
... | @@ -71,30 +65,29 @@ var matches; //- | ... | @@ -71,30 +65,29 @@ var matches; //- |
71 | var temp_name; | 65 | var temp_name; |
72 | var temp_point; | 66 | var temp_point; |
73 | var temp_pic; | 67 | var temp_pic; |
74 | - for(var i=0; i < champ_id.length-1; i++){ | 68 | + for (var i = 0; i < champ_id.length - 1; i++) { |
75 | - for(var j=i+1;j <champ_id.length-1; j++) | 69 | + for (var j = i + 1; j < champ_id.length - 1; j++) |
76 | - if(champ_point[i] > champ_point[j]){ | 70 | + if (champ_point[i] > champ_point[j]) { |
77 | temp_id = champ_id[i]; | 71 | temp_id = champ_id[i]; |
78 | temp_name = champ_name[i]; | 72 | temp_name = champ_name[i]; |
79 | temp_point = champ_point[i]; | 73 | temp_point = champ_point[i]; |
80 | temp_pic = champ_pic[i]; | 74 | temp_pic = champ_pic[i]; |
81 | - champ_id[i] = champ_id[j] | 75 | + champ_id[i] = champ_id[j]; |
82 | champ_name[i] = champ_name[j]; | 76 | champ_name[i] = champ_name[j]; |
83 | champ_point[i] = champ_point[j]; | 77 | champ_point[i] = champ_point[j]; |
84 | champ_pic[i] = champ_pic[j]; | 78 | champ_pic[i] = champ_pic[j]; |
85 | - champ_id[j] = temp_id | 79 | + champ_id[j] = temp_id; |
86 | champ_name[j] = temp_name; | 80 | champ_name[j] = temp_name; |
87 | champ_point[j] = temp_point; | 81 | champ_point[j] = temp_point; |
88 | champ_pic[j] = temp_pic; | 82 | champ_pic[j] = temp_pic; |
89 | } | 83 | } |
90 | } | 84 | } |
91 | - | 85 | + res.render('index', { title: req.params.username, |
92 | - res.render('index', { title: req.params.username , | 86 | + c_id : champ_id, |
93 | - c_id: champ_id, | 87 | + c_name : champ_name, |
94 | - c_name: champ_name, | 88 | + c_point : champ_point, |
95 | - c_point: champ_point, | 89 | + c_pic : champ_pic, |
96 | - c_pic: champ_pic, | 90 | + c_summoner : summoner |
97 | - c_summoner: summoner | ||
98 | }); | 91 | }); |
99 | }); | 92 | }); |
100 | }); | 93 | }); | ... | ... |
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,42 +19,50 @@ | ... | @@ -19,42 +19,50 @@ |
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 | + <font size = 5em> | ||
41 | + <table class = "basic"> | ||
40 | <tbody> | 42 | <tbody> |
41 | - <tr><td> <img src= <%=c_imgtier%> width=120, height=120></td></tr> | 43 | + <tr><td> <img src = <%= c_imgtier%> width=120, height=120></td></tr> |
42 | <tr><td><%= "Tier : " + c_tier + " " + c_rank + " / " + c_leaguePoint + "점"%></td></tr> | 44 | <tr><td><%= "Tier : " + c_tier + " " + c_rank + " / " + c_leaguePoint + "점"%></td></tr> |
43 | - <tr><td><%= "Win : " + c_wins + " / Lose : " + c_losses%></td></tr> | 45 | + <tr><td><%= "Win : " + c_wins + " / Lose : " + c_losses %></td></tr> |
44 | - <tr><td><%= "승률 : " + ((c_wins/(c_wins+c_losses))*100).toFixed(2) + "%" %></td></tr> | 46 | + <tr><td><%= "승률 : " + ((c_wins / (c_wins + c_losses)) * 100).toFixed(2) + "%" %></td></tr> |
45 | </tbody> | 47 | </tbody> |
46 | </table> | 48 | </table> |
47 | <br></br> | 49 | <br></br> |
48 | <div class="center"> | 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> |
54 | <% } %> | 56 | <% } %> |
55 | </div> | 57 | </div> |
56 | - <b> | 58 | + <br></br> |
57 | - <font size = 5em> | 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 | + | ||
58 | <br></br> | 66 | <br></br> |
59 | <% for (var i = 0; i < 10; i++){ %> | 67 | <% for (var i = 0; i < 10; i++){ %> |
60 | <% if (c_win[i]) { %> | 68 | <% if (c_win[i]) { %> |
... | @@ -68,7 +76,7 @@ | ... | @@ -68,7 +76,7 @@ |
68 | </span> | 76 | </span> |
69 | <% } %> | 77 | <% } %> |
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"> |
... | @@ -76,17 +84,36 @@ | ... | @@ -76,17 +84,36 @@ |
76 | </span> | 84 | </span> |
77 | <%= " / " + c_assists[i] %> | 85 | <%= " / " + c_assists[i] %> |
78 | 86 | ||
79 | - <%= "\t평점 : " %> | 87 | + <span style = "color:red"> |
88 | + <%= "\t평점" %> | ||
89 | + </span> | ||
80 | <% if (c_deaths[i] == 0) { %> | 90 | <% if (c_deaths[i] == 0) { %> |
81 | <span style = "color:blue"> | 91 | <span style = "color:blue"> |
82 | - <%= "Perfect" %> | 92 | + <%= " : Perfect" %> |
83 | </span> | 93 | </span> |
84 | <% } %> | 94 | <% } %> |
85 | <% if (c_deaths[i] != 0) { %> | 95 | <% if (c_deaths[i] != 0) { %> |
86 | - <%= ((c_kills[i] + c_assists[i]) / c_deaths[i]).toFixed(2) %> | 96 | + <%= " : " + (c_kda[i]).toFixed(2) %> |
87 | <% } %> | 97 | <% } %> |
88 | 98 | ||
89 | - <span style = "color : red"> | 99 | + <span style = "color:red"> |
100 | + <%= "\tCarry Point" %> | ||
101 | + </span> | ||
102 | + <%= " : " + (c_temp[i]).toFixed(2) %> | ||
103 | + | ||
104 | + <span style = "color:red"> | ||
105 | + <% if (c_temp[i] > 75) { %> | ||
106 | + <%= "Carry" %> | ||
107 | + <% } %> | ||
108 | + </span> | ||
109 | + | ||
110 | + <span style = "color:green"> | ||
111 | + <% if (c_firstBloodKill[i]) { %> | ||
112 | + <%= "퍼스트 블러드" %> | ||
113 | + <% } %> | ||
114 | + </span> | ||
115 | + | ||
116 | + <span style = "color : blue"> | ||
90 | <% if (c_largestMultiKill[i] == 2) { %> | 117 | <% if (c_largestMultiKill[i] == 2) { %> |
91 | <%= "\t더블킬" %> | 118 | <%= "\t더블킬" %> |
92 | <% } %> | 119 | <% } %> |
... | @@ -100,10 +127,11 @@ | ... | @@ -100,10 +127,11 @@ |
100 | <%= "\t펜타킬" %> | 127 | <%= "\t펜타킬" %> |
101 | <% } %> | 128 | <% } %> |
102 | </span> | 129 | </span> |
130 | + | ||
103 | <br></br> | 131 | <br></br> |
104 | <% } %> | 132 | <% } %> |
105 | </b> | 133 | </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 | - | ||
16 | - $("button#searchButton").click(function(){ | ||
17 | var name = $("input").val(); | 15 | var name = $("input").val(); |
18 | location.href = "http://localhost:3000/search/" + name; | 16 | location.href = "http://localhost:3000/search/" + name; |
19 | }) | 17 | }) |
... | @@ -21,16 +19,16 @@ | ... | @@ -21,16 +19,16 @@ |
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/> |
27 | </div> | 25 | </div> |
28 | - <div class="center2"> | 26 | + <div class = "center2"> |
29 | - <input type="text" class="input_text" placeholder="소환사명"> | 27 | + <input type = "text" class = "input_text" placeholder = "소환사명"> |
30 | - <span class="input-group-btn"> | 28 | + <span class = "input-group-btn"> |
31 | - <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> |
32 | </span> | 30 | </span> |
33 | </div> | 31 | </div> |
34 | </div> | 32 | </div> |
35 | -</body> | 33 | + </body> |
36 | </html> | 34 | </html> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment