Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이정호
/
lolhelper
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이정호
2020-06-25 03:14:44 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0e2e67845b2e9b283b302a05952afed12194de1d
0e2e6784
1 parent
95d1cbdd
final
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
254 additions
and
228 deletions
LOL_Helper/router/Test.js
LOL_Helper/router/main.js
LOL_Helper/views/index.ejs
LOL_Helper/views/main.ejs
LOL_Helper/router/Test.js
View file @
0e2e678
function
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
largestMulti
Kill
,
num
)
{
function
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
kda
,
largestMultiKill
,
temp
,
firstBlood
Kill
,
num
)
{
for
(
var
i
=
0
;
i
<
10
;
i
++
)
{
if
(
info_match
[
"participants"
][
i
][
"championId"
]
==
championId
[
num
])
{
win
[
num
]
=
info_match
[
"participants"
][
i
][
"stats"
][
"win"
];
kills
[
num
]
=
info_match
[
"participants"
][
i
][
"stats"
][
"kills"
];
deaths
[
num
]
=
info_match
[
"participants"
][
i
][
"stats"
][
"deaths"
];
assists
[
num
]
=
info_match
[
"participants"
][
i
][
"stats"
][
"assists"
];
largestMultiKill
[
num
]
=
info_match
[
"participants"
][
i
][
"stats"
][
"largestMultiKill"
]
kda
[
num
]
=
(
kills
[
num
]
+
assists
[
num
])
/
deaths
[
num
];
largestMultiKill
[
num
]
=
info_match
[
"participants"
][
i
][
"stats"
][
"largestMultiKill"
];
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
;
firstBloodKill
[
num
]
=
info_match
[
"participants"
][
i
][
"stats"
][
"firstBloodKill"
];
}
}
}
...
...
@@ -14,14 +17,14 @@ module.exports = function(app) {
var
request
=
require
(
"request"
);
var
urlenconde
=
require
(
'urlencode'
);
var
apikey
=
"RGAPI-8547dfd4-a79e-4392-b60d-f89b0fd1347c"
;
//api
var
apikey
=
"RGAPI-8547dfd4-a79e-4392-b60d-f89b0fd1347c"
;
//api
key
var
profileIconId
;
//아이콘 번호
var
revisionDate
;
//수정날짜
var
id
;
//소환사
ID
var
accountId
;
//계정
I
d
var
profileIconId
;
//프로필 아이콘
var
revisionDate
;
//수정
날짜
var
id
;
//소환사
id
var
accountId
;
//계정
i
d
var
name
;
//소환사 이름
var
summonerLevel
;
//소환사
var
summonerLevel
;
//소환사 레벨
var
rotation_champ
=
new
Array
();
app
.
get
(
'/'
,
function
(
req
,
res
)
{
...
...
@@ -29,12 +32,11 @@ module.exports = function(app) {
});
app
.
get
(
'/search/:username/'
,
function
(
req
,
res
,
next
)
{
//
롤
api url
//
리그오브레전드
api url
name
=
req
.
params
.
username
;
var
nameUrl
=
"https://kr.api.riotgames.com/lol/summoner/v4/summoners/by-name/"
+
urlenconde
(
name
)
+
"?api_key="
+
apikey
;
request
(
nameUrl
,
function
(
error
,
response
,
body
)
{
// 요청에 대한 응답이 성공적으로 왔는지 검사.
// status code가 200이 아니면 오류가 있었던 것으로 간주하고 함수 종료.
//status code != 200, 함수 종료
console
.
log
(
'response code '
,
response
.
statusCode
);
if
(
response
.
statusCode
!=
200
)
{
console
.
log
(
'Error with response code22 '
,
response
.
statusCode
);
...
...
@@ -61,8 +63,7 @@ module.exports = function(app) {
var
champ_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);
// status code가 200이 아니면 종료.
// status code != 200, 함수 종료
if
(
info_champ_json
[
"status"
]
!=
undefined
)
{
if
(
info_champ_json
[
"status"
][
"status_code"
]
!=
200
)
{
console
.
log
(
'Error with response code11 '
,
info_champ_json
[
"status"
][
"status_code"
]);
...
...
@@ -169,48 +170,51 @@ module.exports = function(app) {
var
kills
=
new
Array
();
var
deaths
=
new
Array
();
var
assists
=
new
Array
();
var
kda
=
new
Array
();
var
largestMultiKill
=
new
Array
();
var
temp
=
new
Array
();
var
firstBloodKill
=
new
Array
();
var
matchUrl
;
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
0
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
largestMulti
Kill
,
0
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
kda
,
largestMultiKill
,
temp
,
firstBlood
Kill
,
0
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
1
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
largestMulti
Kill
,
1
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
kda
,
largestMultiKill
,
temp
,
firstBlood
Kill
,
1
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
2
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
largestMulti
Kill
,
2
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
kda
,
largestMultiKill
,
temp
,
firstBlood
Kill
,
2
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
3
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
largestMulti
Kill
,
3
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
kda
,
largestMultiKill
,
temp
,
firstBlood
Kill
,
3
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
4
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
largestMulti
Kill
,
4
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
kda
,
largestMultiKill
,
temp
,
firstBlood
Kill
,
4
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
5
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
largestMulti
Kill
,
5
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
kda
,
largestMultiKill
,
temp
,
firstBlood
Kill
,
5
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
6
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
largestMulti
Kill
,
6
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
kda
,
largestMultiKill
,
temp
,
firstBlood
Kill
,
6
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
7
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
largestMulti
Kill
,
7
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
kda
,
largestMultiKill
,
temp
,
firstBlood
Kill
,
7
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
8
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
largestMulti
Kill
,
8
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
kda
,
largestMultiKill
,
temp
,
firstBlood
Kill
,
8
);
matchUrl
=
"https://kr.api.riotgames.com/lol/match/v4/matches/"
+
urlenconde
(
gameId
[
9
])
+
"?api_key="
+
apikey
;
request
(
matchUrl
,
function
(
error
,
response
,
body
){
var
info_match
=
JSON
.
parse
(
body
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
largestMulti
Kill
,
9
);
func
(
info_match
,
championId
,
win
,
kills
,
deaths
,
assists
,
kda
,
largestMultiKill
,
temp
,
firstBlood
Kill
,
9
);
champ_name
[
champ_name
.
length
]
=
"total"
;
var
temp_id
;
var
temp_name
;
...
...
@@ -281,8 +285,11 @@ module.exports = function(app) {
c_kills
:
kills
,
c_deaths
:
deaths
,
c_assists
:
assists
,
c_kda
:
kda
,
c_largestMultiKill
:
largestMultiKill
,
c_pic
:
picture
c_pic
:
picture
,
c_temp
:
temp
,
c_firstBloodKill
:
firstBloodKill
});
});
});
...
...
@@ -301,4 +308,4 @@ module.exports = function(app) {
});
});
});
};
};
\ No newline at end of file
...
...
LOL_Helper/router/main.js
View file @
0e2e678
module
.
exports
=
function
(
app
){
module
.
exports
=
function
(
app
)
{
var
request
=
require
(
"request"
);
var
urlenconde
=
require
(
'urlencode'
);
var
apikey
=
"RGAPI-8547dfd4-a79e-4392-b60d-f89b0fd1347c"
//api
var
request
=
require
(
"request"
);
var
urlenconde
=
require
(
'urlencode'
);
var
apikey
=
"RGAPI-8547dfd4-a79e-4392-b60d-f89b0fd1347c"
//api key
var
profileIconId
;
//아이콘 번호
var
revisionDate
;
//수정날짜
var
id
;
//소환사ID
var
accountId
;
//계정Id
var
name
;
//소환사 이름
var
summonerLevel
;
//소환사 레벨
var
profileIconId
;
//프로필 아이콘
var
revisionDate
;
//수정 날짜
var
id
;
//소환사 id
var
accountId
;
//계정 id
var
name
;
//소환사 이름
var
summonerLevel
;
//소환사 레벨
app
.
get
(
'/'
,
function
(
req
,
res
)
{
res
.
render
(
'main'
,
{
title
:
'LOL Helper'
});
});
var
startIndex
;
var
endIndex
;
var
totalGames
;
var
matches
;
//-
app
.
get
(
'/search/:username/'
,
function
(
req
,
res
)
{
//리그오브레전드 api url
name
=
req
.
params
.
username
;
var
nameUrl
=
"https://kr.api.riotgames.com/lol/summoner/v3/summoners/by-name/"
+
urlenconde
(
name
)
+
"?api_key="
+
apikey
;
request
(
nameUrl
,
function
(
error
,
response
,
body
)
{
var
info_summoner_json
=
JSON
.
parse
(
body
);
app
.
get
(
'/'
,
function
(
req
,
res
)
{
res
.
render
(
'main'
,
{
title
:
'LOL Helper'
});
});
accountId
=
info_summoner_json
[
"accountId"
];
id
=
info_summoner_json
[
"id"
];
summoner
=
info_summoner_json
[
"name"
];
profileIconId
=
info_summoner_json
[
"profileIconId"
];
summonerLevel
=
info_summoner_json
[
"summonerLevel"
];
revisionDate
=
info_summoner_json
[
"revisionDate"
];
app
.
get
(
'/search/:username/'
,
function
(
req
,
res
){
//롤 api url
name
=
req
.
params
.
username
;
var
nameUrl
=
"https://kr.api.riotgames.com/lol/summoner/v3/summoners/by-name/"
+
urlenconde
(
name
)
+
"?api_key="
+
apikey
;
request
(
nameUrl
,
function
(
error
,
response
,
body
){
var
info_summoner_json
=
JSON
.
parse
(
body
);
var
champUrl
=
"https://kr.api.pvp.net/api/lol/kr/v1.3/stats/by-summoner/"
+
urlenconde
(
id
)
+
"/ranked?api_key="
+
apikey
;
request
(
champUrl
,
function
(
error
,
response
,
body
)
{
var
info_champ_json
=
JSON
.
parse
(
body
);
var
champions
=
info_champ_json
[
"champions"
];
var
champ_point
=
new
Array
();
var
champ_id
=
new
Array
();
var
champ_name
=
new
Array
();
var
champ_pic
=
new
Array
();
var
champions_length
=
Object
.
keys
(
champions
).
length
;
accountId
=
info_summoner_json
[
"accountId"
];
id
=
info_summoner_json
[
"id"
];
summoner
=
info_summoner_json
[
"name"
];
profileIconId
=
info_summoner_json
[
"profileIconId"
]
;
summonerLevel
=
info_summoner_json
[
"summonerLevel
"
];
revisionDate
=
info_summoner_json
[
"revisionDate"
];
for
(
var
i
=
0
;
i
<
champions_length
;
i
++
)
{
champ_point
[
i
]
=
(
champions
[
i
][
"stats"
][
"totalSessionsWon"
]
/
champions
[
i
][
"stats"
][
"totalSessionsPlayed"
]
*
200
)
+
((
champions
[
i
][
"stats"
][
"totalAssists"
]
+
champions
[
i
][
"stats"
][
"totalChampionKills"
])
/
champions
[
i
][
"stats"
][
"totalDeathsPerSession"
]
*
100
)
+
(
champions
[
i
][
"stats"
][
"totalSessionsPlayed"
]
*
3
)
;
champ_id
[
i
]
=
champions
[
i
][
"id
"
];
}
var
rankedUrl
=
"https://kr.api.pvp.net/api/lol/kr/v2.5/league/by-summoner/"
+
urlenconde
(
id
)
+
"?api_key="
+
apikey
;
var
champUrl
=
"https://kr.api.pvp.net/api/lol/kr/v1.3/stats/by-summoner/"
+
urlenconde
(
id
)
+
"/ranked?api_key="
+
apikey
;
request
(
champUrl
,
function
(
error
,
response
,
body
){
var
info_champ_json
=
JSON
.
parse
(
body
);
var
champions
=
info_champ_json
[
"champions"
];
var
champ_point
=
new
Array
();
var
champ_id
=
new
Array
();
var
champ_name
=
new
Array
();
var
champ_pic
=
new
Array
();
var
champions_length
=
Object
.
keys
(
champions
).
length
;
for
(
var
i
=
0
;
i
<
champions_length
;
i
++
){
champ_point
[
i
]
=
(
champions
[
i
][
"stats"
][
"totalSessionsWon"
]
/
champions
[
i
][
"stats"
][
"totalSessionsPlayed"
]
*
200
)
+
((
champions
[
i
][
"stats"
][
"totalAssists"
]
+
champions
[
i
][
"stats"
][
"totalChampionKills"
])
/
champions
[
i
][
"stats"
][
"totalDeathsPerSession"
]
*
100
)
+
(
champions
[
i
][
"stats"
][
"totalSessionsPlayed"
]
*
3
);
champ_id
[
i
]
=
champions
[
i
][
"id"
];
}
var
staticUrl
=
"https://global.api.pvp.net/api/lol/static-data/kr/v1.2/champion/?api_key="
+
apikey
;
request
(
staticUrl
,
function
(
error
,
response
,
body
){
var
info_static_champ_json
=
JSON
.
parse
(
body
);
var
champion
=
info_static_champ_json
[
"data"
];
for
(
var
i
=
0
;
i
<
champ_id
.
length
;
i
++
){
for
(
js
in
champion
){
for
(
j
in
champion
[
js
]){
if
(
champion
[
js
][
"id"
]
==
champ_id
[
i
]){
champ_name
[
i
]
=
champion
[
js
][
"key"
];
champ_pic
[
i
]
=
"https://opgg-static.akamaized.net/images/lol/champion/"
+
champ_name
[
i
]
+
".png?image=c_scale,w_46"
;
}
}
}
}
champ_name
[
champ_name
.
length
]
=
"total"
;
var
temp_id
;
var
temp_name
;
var
temp_point
;
var
temp_pic
;
for
(
var
i
=
0
;
i
<
champ_id
.
length
-
1
;
i
++
){
for
(
var
j
=
i
+
1
;
j
<
champ_id
.
length
-
1
;
j
++
)
if
(
champ_point
[
i
]
>
champ_point
[
j
]){
temp_id
=
champ_id
[
i
];
temp_name
=
champ_name
[
i
];
temp_point
=
champ_point
[
i
];
temp_pic
=
champ_pic
[
i
];
champ_id
[
i
]
=
champ_id
[
j
]
champ_name
[
i
]
=
champ_name
[
j
];
champ_point
[
i
]
=
champ_point
[
j
];
champ_pic
[
i
]
=
champ_pic
[
j
];
champ_id
[
j
]
=
temp_id
champ_name
[
j
]
=
temp_name
;
champ_point
[
j
]
=
temp_point
;
champ_pic
[
j
]
=
temp_pic
;
}
}
res
.
render
(
'index'
,
{
title
:
req
.
params
.
username
,
c_id
:
champ_id
,
c_name
:
champ_name
,
c_point
:
champ_point
,
c_pic
:
champ_pic
,
c_summoner
:
summoner
});
});
});
});
});
};
var
staticUrl
=
"https://global.api.pvp.net/api/lol/static-data/kr/v1.2/champion/?api_key="
+
apikey
;
request
(
staticUrl
,
function
(
error
,
response
,
body
){
var
info_static_champ_json
=
JSON
.
parse
(
body
);
var
champion
=
info_static_champ_json
[
"data"
];
for
(
var
i
=
0
;
i
<
champ_id
.
length
;
i
++
)
{
for
(
js
in
champion
)
{
for
(
j
in
champion
[
js
])
{
if
(
champion
[
js
][
"id"
]
==
champ_id
[
i
])
{
champ_name
[
i
]
=
champion
[
js
][
"key"
];
champ_pic
[
i
]
=
"https://opgg-static.akamaized.net/images/lol/champion/"
+
champ_name
[
i
]
+
".png?image=c_scale,w_46"
;
}
}
}
}
champ_name
[
champ_name
.
length
]
=
"total"
;
var
temp_id
;
var
temp_name
;
var
temp_point
;
var
temp_pic
;
for
(
var
i
=
0
;
i
<
champ_id
.
length
-
1
;
i
++
)
{
for
(
var
j
=
i
+
1
;
j
<
champ_id
.
length
-
1
;
j
++
)
if
(
champ_point
[
i
]
>
champ_point
[
j
])
{
temp_id
=
champ_id
[
i
];
temp_name
=
champ_name
[
i
];
temp_point
=
champ_point
[
i
];
temp_pic
=
champ_pic
[
i
];
champ_id
[
i
]
=
champ_id
[
j
];
champ_name
[
i
]
=
champ_name
[
j
];
champ_point
[
i
]
=
champ_point
[
j
];
champ_pic
[
i
]
=
champ_pic
[
j
];
champ_id
[
j
]
=
temp_id
;
champ_name
[
j
]
=
temp_name
;
champ_point
[
j
]
=
temp_point
;
champ_pic
[
j
]
=
temp_pic
;
}
}
res
.
render
(
'index'
,
{
title
:
req
.
params
.
username
,
c_id
:
champ_id
,
c_name
:
champ_name
,
c_point
:
champ_point
,
c_pic
:
champ_pic
,
c_summoner
:
summoner
});
});
});
});
});
};
\ No newline at end of file
...
...
LOL_Helper/views/index.ejs
View file @
0e2e678
<!DOCTYPE html>
<html>
<head>
<meta
charset
=
"utf-8"
>
<meta
charset
=
"utf-8"
>
<title>
<
%= title %>
</title>
<link
rel
=
"icon"
href =
"FindMelogo.png"
>
<link
rel
=
"stylesheet"
href=
"css/style.css"
>
<link
rel
=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"
>
<link
rel
=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"
>
<script
src
=
"https://code.jquery.com/jquery-3.2.1.min.js"
integrity=
"sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin=
"anonymous"
></script>
<link
rel
=
"icon"
href =
"FindMelogo.png"
>
<link
rel
=
"stylesheet"
href =
"css/style.css"
>
<link
rel
=
"stylesheet"
href =
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"
>
<link
rel
=
"stylesheet"
href =
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"
>
<script
src
=
"https://code.jquery.com/jquery-3.2.1.min.js"
integrity =
"sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin =
"anonymous"
></script>
<style>
@import
url("http://fonts.googleapis.com/earlyaccess/nanumgothic.css")
;
</style>
<script>
$
(
document
).
ready
(
function
(){
$
(
"button#searchButton"
).
click
(
function
(){
$
(
document
).
ready
(
function
()
{
$
(
"button#searchButton"
).
click
(
function
()
{
var
name
=
$
(
"input"
).
val
();
location
.
href
=
"http://localhost:3000/search/"
+
name
;
})
...
...
@@ -19,91 +19,119 @@
</script>
</head>
<body>
<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>
<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>
</div>
</div>
</div>
<br></br>
<font
size
=
10em
>
<font
size
=
10em
>
<strong>
<
%= c_summoner + "\n"%>
</strong>
</font>
<table
class=
"basic"
>
<tbody>
<tr><td>
<img
src=
<%=c_imgtier%
>
width=120, height=120>
</td></tr>
<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>
</tbody>
</table>
<br></br>
<div
class=
"center"
>
<b>
<font
size =
5em
>
<table
class =
"basic"
>
<tbody>
<tr><td>
<img
src =
<%=
c_imgtier
%
>
width=120, height=120>
</td></tr>
<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>
</tbody>
</table>
<br></br>
<div
class=
"center"
>
<strong>
<
%= "로테이션 챔피언: " %>
</strong>
<
% for (var i=0; i
<c
_rotation
.
length-1
;
i
++){
%
>
<img
src=
<%=c_rotation[i]%
>
width=50, height=50>
<
%= "로테이션 챔피언 : " %>
</strong>
<
% 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
< 10
;
i
++){
%
>
<
% if (c_temp[i] > 75) { %>
<img
src =
<%=
c_pic
[
i
]%
>
width = 50, height = 50>
<
% } %>
<
% } %>
<br></br>
<
% for (var i = 0; i
< 10
;
i
++){
%
>
<
% if (c_win[i]) { %>
<span
style =
"color:blue"
>
<
%= "승리" %>
</span>
<
% } %>
<
% if (!c_win[i]) { %>
<span
style =
"color:red"
>
<
%= "패배" %>
</span>
<
% } %>
</div>
<b>
<font
size =
5em
>
<br></br>
<
% for (var i = 0; i
< 10
;
i
++){
%
>
<
% if (c_win[i]) { %>
<span
style =
"color:blue"
>
<
%= "승리" %>
</span>
<
% } %>
<
% if (!c_win[i]) { %>
<span
style =
"color:red"
>
<
%= "패배" %>
</span>
<
% } %>
<img
src
=
<%=
c_pic
[
i
]%
>
width = 50, height = 50>
<img
src
=
<%=
c_pic
[
i
]%
>
width = 50, height = 50>
<
%= c_kills[i] + " / " %>
<span
style =
"color:red"
>
<
%= c_deaths[i] %>
</span>
<
%= " / " + c_assists[i] %>
<
%= c_kills[i] + " / " %>
<span
style =
"color:red"
>
<
%= c_deaths[i] %>
</span>
<
%= " / " + c_assists[i] %>
<
%= "\t평점 : " %>
<
% if (c_deaths[i] == 0) { %>
<span
style =
"color:blue"
>
<
%= "Perfect" %>
</span>
<
% } %>
<
% if (c_deaths[i] != 0) { %>
<
%= ((c_kills[i] + c_assists[i]) / c_deaths[i]).toFixed(2) %>
<
% } %>
<span
style =
"color:red"
>
<
%= "\t평점" %>
</span>
<
% if (c_deaths[i] == 0) { %>
<span
style =
"color:blue"
>
<
%= " : Perfect" %>
</span>
<
% } %>
<
% if (c_deaths[i] != 0) { %>
<
%= " : " + (c_kda[i]).toFixed(2) %>
<
% } %>
<span
style =
"color : red"
>
<
% if (c_largestMultiKill[i] == 2) { %>
<
%= "\t더블킬" %>
<
% } %>
<
% if (c_largestMultiKill[i] == 3) { %>
<
%= "\t트리플킬" %>
<
% } %>
<
% if (c_largestMultiKill[i] == 4) { %>
<
%= "\t쿼드라킬" %>
<
% } %>
<
% if (c_largestMultiKill[i] == 5) { %>
<
%= "\t펜타킬" %>
<span
style =
"color:red"
>
<
%= "\tCarry Point" %>
</span>
<
%= " : " + (c_temp[i]).toFixed(2) %>
<span
style =
"color:red"
>
<
% if (c_temp[i] > 75) { %>
<
%= "Carry" %>
<
% } %>
</span>
<span
style =
"color:green"
>
<
% if (c_firstBloodKill[i]) { %>
<
%= "퍼스트 블러드" %>
<
% } %>
</span>
<span
style =
"color : blue"
>
<
% if (c_largestMultiKill[i] == 2) { %>
<
%= "\t더블킬" %>
<
% } %>
<
% if (c_largestMultiKill[i] == 3) { %>
<
%= "\t트리플킬" %>
<
% } %>
<
% if (c_largestMultiKill[i] == 4) { %>
<
%= "\t쿼드라킬" %>
<
% } %>
<
% if (c_largestMultiKill[i] == 5) { %>
<
%= "\t펜타킬" %>
<
% } %>
</span>
<br></br>
<
% } %>
</span>
<br></br>
<
% } %>
</b>
</b>
</font>
</div>
</body>
</div>
</body>
</html>
\ No newline at end of file
...
...
LOL_Helper/views/main.ejs
View file @
0e2e678
<!DOCTYPE html>
<html>
<head>
<meta
charset
=
"utf-8"
>
<meta
charset
=
"utf-8"
>
<title>
<
%= title %>
</title>
<link
rel
=
"icon"
href =
"FindMelogo.png"
>
<link
rel
=
"stylesheet"
href=
"css/style.css"
>
<link
rel
=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"
>
<link
rel
=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"
>
<script
src
=
"https://code.jquery.com/jquery-3.2.1.min.js"
integrity=
"sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin=
"anonymous"
></script>
<link
rel
=
"icon"
href =
"FindMelogo.png"
>
<link
rel
=
"stylesheet"
href =
"css/style.css"
>
<link
rel
=
"stylesheet"
href =
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"
>
<link
rel
=
"stylesheet"
href =
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"
>
<script
src
=
"https://code.jquery.com/jquery-3.2.1.min.js"
integrity =
"sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin =
"anonymous"
></script>
<style>
@import
url("http://fonts.googleapis.com/earlyaccess/nanumgothic.css")
;
</style>
<script>
$
(
document
).
ready
(
function
(){
$
(
"button#searchButton"
).
click
(
function
(){
var
name
=
$
(
"input"
).
val
();
location
.
href
=
"http://localhost:3000/search/"
+
name
;
})
});
$
(
document
).
ready
(
function
()
{
$
(
"button#searchButton"
).
click
(
function
()
{
var
name
=
$
(
"input"
).
val
();
location
.
href
=
"http://localhost:3000/search/"
+
name
;
})
});
</script>
</head>
<body>
<div
class=
"imgOpacity"
>
<div
class=
"center"
>
<img
src=
"FindMelogo.png"
width =
300,
height =
300/
>
<div
class =
"imgOpacity"
>
<div
class =
"center"
>
<img
src=
"FindMelogo.png"
width =
300,
height =
300/
>
</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>
</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>
</div>
</body>
</html>
</body>
</html>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment