-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
90 lines (78 loc) · 3.7 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Github Profile Finder</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link href="https://fonts.googleapis.com/css2?family=Varela+Round&display=swap" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body class="bg-dark">
<nav class="navbar navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand">Github Finder</a>
<div class="d-flex">
<input class="form-control me-2" type="text" name="Username" id="input"
placeholder="Your Git Username..">
<button class="btn btn-outline-success" id="search" type="submit">Search</button>
</div>
</div>
</nav>
<div class="bg-info">
<center>
<div class="col-md-4 text-center">
<div class="card" style="width: 18rem;">
<img src="./Octocat.png" class="card-img-top" id="img" alt="...">
<div class="card-body text-center">
<span class="name" id="name">Yash Patel </span><br />
<a class="username" id="username">@yash-2115</a>
<div class="bio" id="bio">User BIO</div>
<div class="row">
<div class="col-md-6 text-center fs-4">
<a class="badge bg-primary text-decoration-none" id="flwrs-link"><span id="followers">0</span> followers</a>
</div>
<div class="col-md-6 text-center fs-4">
<a class="badge bg-primary text-decoration-none" id="flwin-link"><span id="following">0</span> following</a>
</div>
</div>
</div>
</div>
</div>
</center>
</div>
<div class="col-md-4"></div>
</div>
</div>
<script>
$("#search").click(() => {
$.getJSON(
"https://api.github.com/users/" + $("#input").val(),
(data) => {
$("#img").attr("src", data.avatar_url);
$("#name").html(data.name);
$("#username").html("@" + data.login);
$("#username").attr("href", data.html_url);
$("#bio").html(data.bio);
$("#followers").html(data.followers);
$("#following").html(data.following);
$("#flwrs-link").attr(
"href",
"https://github.com/" + data.login + "?tab=followers"
);
$("#flwin-link").attr(
"href",
"https://github.com/" + data.login + "?tab=following"
);
}
);
});
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
</body>
</html>