Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
uploaded files
  • Loading branch information
pcm20001 committed Apr 15, 2024
1 parent 935f516 commit ec487ce
Show file tree
Hide file tree
Showing 4 changed files with 553 additions and 0 deletions.
80 changes: 80 additions & 0 deletions week-12/index.css
@@ -0,0 +1,80 @@
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #d5caf7;
}

h1 {
color:#9e8adf;
font-size: 48px;
}

button {
background-color: #9e8adf;
color: white;
border: none;
border-radius: 10px;
width: 100px;
height: 30px;
font-size: 1em;
}

button:hover {
background-color: rgb(255, 255, 255);
color:#9e8adf;
border:1px solid #9e8adf;
}

input {
height: 25px;
border-radius: 10px;
width: 200px;
border: 1px rgb(33, 33, 33) solid;
padding-left: 10px;
font-size: 1em;
}

form {
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
flex-direction: column;
border: 1px #9e8adf;
background-color: #d5caf7;
}

.profile {
display: flex;
flex-direction: column;
padding: 20px 0px;
align-items: center;
border: solid 1px rgb(132, 132, 132);
border-radius: 10px;
gap: 20px;
background-color: white;
}

.profile img {
width: 300px;
padding: 20px;
}

h2 {
font-size: 2em;
margin: 0;
}

a {
font-size: 1.4em;
margin: 0;
}

#info {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 30px;
padding-top: 40px;
}
23 changes: 23 additions & 0 deletions week-12/index.html
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Github Userbase</title>
<link rel="stylesheet" href="index.css">
</head>
<body>

<div class="container">
<h1>Github UConn Profile</h1>
<form id="form">
<input type="text" name="input">
<button id="button">Search</button>
</form>
<section id="info">

</section>
</div>
<script src="/index.js"></script>
</body>
</html>
27 changes: 27 additions & 0 deletions week-12/index.js
@@ -0,0 +1,27 @@
let info = document.querySelector("#info");
let button = document.querySelector("#button")
let form = document.querySelector("#form")

form.addEventListener("submit", function (e) {
e.preventDefault()

info.innerHTML = ``

let formData = new FormData(this);
let input = formData.get("input");

fetch(`https://github.uconn.edu/api/v3/search/users?q=${input}`)
.then(response => {
return response.json();
}).then(items => {
items.items.forEach(element => {
info.innerHTML += `
<div class="profile">
<img src="${element.avatar_url}">
<h2>${element.login}</h2>
<a href="${element.html_url}">Profile</a>
</div>`
});
});
})

0 comments on commit ec487ce

Please sign in to comment.