Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Gamandeep singh/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GitHub-User Searcher</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DynaPuff:wght@500&display=swap" rel="stylesheet">
</head>

<body style="background-color: #393646;">
<div class="container">

<br><br>
<h1>
🔎GitHub-User Searcher🔍
</h1>
<br><br>
<form action="" id="myForm" autocomplete="off">
<div class="form-group">
<input type="text" class="form-control" id="search" placeholder="Search Username">
<br>
</div>
<div class="form-group">
<button class="btn btn-dark btn-block" id="btn1" onclick="functionName()"
style="align-items: center; justify-content: center; display: flex; background-color: #F7D060; ">
Search User
</button>
</div>
</form>
<div class="box b1">
pls! Click on the pic, that will re-direct you to their GitHub profile!
</div>
<br>
<div id="result">

</div>
</div>

<script src="script.js"></script>
</body>

</html>
34 changes: 34 additions & 0 deletions Gamandeep singh/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

//to display text after click on search!
function functionName() {
document.querySelector(".box").classList.toggle("b1")
}

//fetch data from form!
var form = document.getElementById("myForm");


form.addEventListener('submit', function (e) {

//prevent the auto submission of form
e.preventDefault();

var search = document.getElementById("search").value;

//to remove space in b/w firstName & lastName
var originalName = search.split(' ').join('');

document.getElementById("result").innerHTML = '';

fetch("https://api.github.com/users/" + originalName)
.then((result) => result.json())
.then((data) => {
console.log(data)

document.getElementById("result").classList.add("discription");

document.getElementById("result").innerHTML = `
<a target="_blank" href="https://www.github.com/${originalName}"> <img src="${data.avatar_url}"/></a>
`
})
})
79 changes: 79 additions & 0 deletions Gamandeep singh/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
.b1 {
visibility: hidden;
font-family: 'DynaPuff', cursive;

}

.box {
display: flex;
align-items: center;
justify-content: center;
color: #917FB3;
font-family: 'Tilt Prism', cursive;
font-size: 30px;
}

h1 {
font-family: 'DynaPuff', cursive;
text-align: center;
text-align: center;
font-size: 80px;
color: #F7D060;
}

.form-control {
padding: 7px;
font-size: 14px;
font-family: cursive;
border-width: 2px;
border-color: #FDE2F3;

color: #000000;
border-style: double;
border-radius: 22px;
box-shadow: 0px 4px 10px rgba(66, 66, 66, .75);

}

.form-control:focus {
outline: none;
background-color: #F7D060;
}

.btn {
width: 100%;
background: #F9D949;
background-image: -webkit-linear-gradient(top, #F9D949, #FF8400);
background-image: -moz-linear-gradient(top, #F9D949, #FF8400);
background-image: -ms-linear-gradient(top, #F9D949, #FF8400);
background-image: -o-linear-gradient(top, #F9D949, #FF8400);
background-image: linear-gradient(to bottom, #F9D949, #FF8400);
-webkit-border-radius: 32;
-moz-border-radius: 32;
border-radius: 32px;
-webkit-box-shadow: 6px 6px 11px #6a7999;
-moz-box-shadow: 6px 6px 11px #6a7999;
box-shadow: 6px 6px 11px #6a7999;
font-family: Arial;
color: #ffffff;
font-size: 21px;
padding: 10px 20px 10px 20px;
text-decoration: none;
}

.btn:hover {
background: #FF8400;
background-image: -webkit-linear-gradient(top, #FF8400, #F9D949);
background-image: -moz-linear-gradient(top, #FF8400, #F9D949);
background-image: -ms-linear-gradient(top, #FF8400, #F9D949);
background-image: -o-linear-gradient(top, #FF8400, #F9D949);
background-image: linear-gradient(to bottom, #FF8400, #F9D949);
text-decoration: none;
color: #6a7999;
}

#result {
position: absolute;
left: 35%;

}