forked from myskam7/Project-Uno
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoLex.html
More file actions
185 lines (140 loc) · 5.93 KB
/
Copy pathLoLex.html
File metadata and controls
185 lines (140 loc) · 5.93 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Challenge Round</title>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js'></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
<link rel="stylesheet" href=" https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M"
crossorigin="anonymous">
</head>
<body>
<style>
.paper{
border: 1px solid red;
}
a:hover{
text-decoration: none;
}
</style>
</head>
<body>
<div class="container" id="gridID">
<div class="jumbotron">
<div class="chart"></div>
<h1> </h1>
<i class="fa fa-newspaper-o" aria-hidden="true"></i>
<nav class="navbar navbar-light bg-faded">
<form class="form-inline">
<input class="form-control mr-sm-2" id="input" type="text" placeholder="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</nav>
</div>
<div class="paper1">
</div>
</div>
<script>
var ch = {
"Ana": "/1",
"Bastion":"/2",
"D.Va":"/3",
"Genji":"/4",
"Hanzo":"/5",
"Junkrat":"/6",
"Lúcio":"/7",
"McCree":"/8",
"Mei":"/9",
"Mercy":"/10",
"Pharah":"/11",
"Reaper":"/12",
"Reinhardt":"/13",
"Roadhog":"/14",
"Soldier: 76":"/15",
"Symmetra":"/16",
"Torbjö statusrn":"/17",
"Tracer":"/18",
"Widowmaker":"/19",
"Winston":"/20",
"Zarya":"/21",
"Zenyatta":"/22",
"Sombra":"/23",
"Orisa":"/24",
};
// console.log(Object.entries(ch));
// d3.select(".chart")
// .selectAll("div")
// .data(ch)
// .enter()
// .append("div")
// .style("width", function(d){
// return d
// }).text(function(d){
// console.log(d)
// });
const cors = "https://cors-bcs.herokuapp.com/";
var apiID = "RGAPI-818a2ace-9c3a-4b25-acf9-920dbc693326";
var queryURL = cors + 'https://overwatch-api.net/api/v1/hero' ;
// var grid = $("<div>")
// $("#grid").on("click", function(){
// })
// $("#gridID").append(grid)
$.ajax({
url: queryURL,
method: 'GET',
}).done(function(result){
var characters = result;
console.log(characters)
for (var i = 0; i < characters.data.length; i++) {
var d = $("<button>");
d.addClass("btn btn-outline-success my-2 my-sm-0")
d.html(characters.data[i].name);
$("#gridID").append(d);
}
$("button").on("click", function(event){
Object.entries(ch).forEach(([key, value]) => {
console.log(key, value);
});
});
// var a = $("button").val(function( index, value ) {
// console.log ();
});
// $(".btn-outline-success").on("click", function(event){
// event.preventDefault();
// console.log(ch)
// });
// $.ajax({
// url: queryURL,
// method: 'GET',
// }).done(function(result){
// console.log(result)
// });
// makes a second request with the id of the name
// complete: function(data){
// // var nameId = $("data.id.val()
// var queryURL2 = cors + 'https://na1.api.riotgames.com/lol/platform/v3/masteries/by-summoner/' + dt + '?api_key=' + apiID;
// $.ajax({
// url: queryURL2,
// method: 'GET',
// success: function(response){
// console.log(response)
// }
// },
// )}
// data: data,
// success: function(result){
// var a = data;
// console.log (result)
// var a = key.data
// $(a).each(function(e){
// console.log(a)
// })
// for (var i = 0; i < data.length; i++) {
// console.log(data[i])
// }
</script>
</body>
</html>