index_lol.ejs
3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html>
<head>
<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>
<style> @import url("http://fonts.googleapis.com/earlyaccess/nanumgothic.css");</style>
<script>
function search() {
console.log("---------------------")
var tft_check = $("tft_check").val();
console.log(tft_check)
var name = $("input").val();
if (tft_check == 1) {
location.href = "http://localhost:3000/tft/search/" + name;
} else {
location.href = "http://localhost:3000/search/" + name;
}
}
$(document).ready(function(){
$("button#searchButton").click(function(){
console.log("---------------------")
var tft_check = $("tft_check").val();
console.log(tft_check)
var name = $("input").val();
if (tft_check == 1) {
location.href = "http://localhost:3000/tft/search/" + name;
} else {
location.href = "http://localhost:3000/search/" + name;
}
})
});
</script>
</head>
<body>
<div class="imgOpacity">
<div class="center">
<img src= "/FindMelogo.png" width = 150, height = 150/>
</div>
<div class="center2">
<div>
<input type="text" class="input_text" placeholder="소환사 이름">
<input type="checkbox" id="tft_check" name="tft_check" checked>
<label for="tft_check">TFT</label>
</div>
<span class="input-group-btn">
<button id="searchButton" class="btn btn-primary" type="button" onclick="search(name)">click!</button>
</span>
</div>
</div>
<br></br>
<% if (error_message) { %>
<h2><%= error_message %></h2>
<% } else { %>
<font size=10em>
<strong>
<%= c_summoner.name + "\n"%> <!-- 소환사 object -->
</strong>
</font>
<table class="table">
<thead>
<tr>
<th>Tier</th>
<th>Win</th>
<th>Lose</th>
<th>승률</th>
<th>캐리력</th>
</tr>
</thead>
<% if (c_leagueList.length>0) { %>
<tbody>
<%
c_leagueList.forEach(function(league){ %>
<tr>
<td><%= league.tier + " " + league.rank + " / " + league.leaguePoints + "점"%></td>
<td><%= league.wins %></td>
<td><%= league.losses %></td>
<td><%= ((league.wins/(league.wins+league.losses))*100).toFixed(2) + "%" %></td>
<td><%= (league.wins/league.losses*2).toFixed(2) %></td>
</tr>
<% }); %>
</tbody>
<% } else { %>
<tbody>
<tr >
<td colspan="5" style="text-align: center;">no league</td>
</tr>
</tbody>
<% } %>
</table>
<% } %>
</div>
</body>
</html>