-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
63 lines (56 loc) · 1.53 KB
/
index.html
File metadata and controls
63 lines (56 loc) · 1.53 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Javascript gravatar</title>
</script>
<!-- <script src="binarytransport.js"></script> -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<style media="screen">
img{
max-width: 300px;
max-height: 300px;
border-radius: 2px;
padding: 5px;
}
body{
background-color: black;
color: white;
}
#main{
display: flex;
flex-flow: row wrap;
}
a{
text-decoration: none;
color: cornflowerblue;
}
div{
margin: 10px;
}
.col-sm-5 {
background-color: #34495e;
}
.row {
width: 100%;
margin: 0 auto;
}
</style>
</head>
<body>
<form name="myForm">
<input type="text" name="userid" id="gravatar" value="35641311" />
<input type="submit" /><br>
</form>
<div id="output"></div>
<script type="text/javascript">
let params = (new URL(document.location)).searchParams;
document.addEventListener('DOMContentLoaded', _ => {
if(params.get('userid')){
let APIUserIDGavatar = "https://avatars3.githubusercontent.com/u/" + params.get("userid")
document.getElementById("output").innerHTML = '<img src="' + APIUserIDGavatar + '"/>';
};
});
</script>
</body>
</html>