-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.html
97 lines (88 loc) · 4.88 KB
/
test.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="identicon, api, image generator, elixir, phoenix, erlang, faymir" />
<meta name="author" content="Faymir" />
<title>Indenticon API Testing</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
</head>
<body style="background-color: black;">
<div class="container center-block" style="margin-top: 1%;">
<div class="jumbotron form-group">
<h4 class="text-center">Welcome to my Elixir/Phoenix Identicon Api demo</h4> <br>
<div class="form-group" style="padding: 5%; background: aqua;">
<h4 class="text-center">Request Sended to get The Identicon (image)</h4>
<div class="form-row">
<div class="form-group col-sm-6">
<label for="request" class="text-center">Api Url</label>
<input type="text" class="form-control text-left" readonly id="requestUrl" placeholder="https://identicapi.herokuapp.com/identicapi/">
</div>
<div class="form-group col-sm-2">
<label for="requestHeight" class="text-center">Username</label>
<input type="text" class="form-control text-left" readonly id="requestUsername">
</div>
<div class="form-group col-sm-2">
<label for="requestWidth" class="text-center">Image Width</label>
<input type="text" class="form-control text-left" readonly id="requestWidth">
</div>
<div class="form-group col-sm-2">
<label for="requestHeight" class="text-center">Image Height</label>
<input type="text" class="form-control text-left" readonly id="requestHeight">
</div>
</div>
<div class="form-group d-flex justify-content-center">
<i class="fas fa-arrow-down fa-3x"></i>
</div>
<div class="form-group">
<input type="text" class="form-control text-center " readonly id="request" placeholder="https://identicapi.herokuapp.com/identicapi/">
</div>
</div>
<div class="form-group row">
<label for="width" class="col-sm-2 col-form-label">Width</label>
<div class="col-sm-3">
<input type="text" class="form-control text-center" id="width" value="250">
</div>
<label class="col-sm-1 font-weight-bold">px</label>
<label for="height" class="col-sm-2 col-form-label">Height</label>
<div class="col-sm-3">
<input type="text" class="form-control text-center" id="height" value="250">
</div><label class="col-sm-1 font-weight-bold">px</label>
</div>
<div class="form-group row">
<label for="username" class="col-sm-2 col-form-label">Username</label>
<input class="form-control text-center col-sm-8" type="text" id="username" onkeyup="loadImage()">
<button class="form-control btn btn-primary col-sm-2" onclick="loadImage()">Reload</button>
</div>
<div class="d-flex justify-content-center">
<img style="border-radius: 10px/10px;" id="myimg" src="http://localhost:4000/image/me" >
</div>
<br>
<div class="d-flex justify-content-center">
<button class="btn btn-warning" id="toggle-interval">Toggle Random</button>
</div>
</div>
</div>
</div>
<script src="http://unpkg.com/axios/dist/axios.min.js"></script>
<script src="app.js"></script>
<script>
let random = false;
let input = document.querySelector("#username");
let apiUrl = "http://localhost:4000/json/";
//loadImage(generateId(6), apiUrl);
let interval = null;
let delay = 1000;
document.querySelector("#toggle-interval").onclick = function () {
interval = toogle_interval2(delay, apiUrl);
};
function newLoadImage(username, url = "http://localhost:4000/image/"){
document.getElementById("myimg").src = url + username;
}
//console.log("=========END==========");
</script>
</body>
</html>