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
8 changes: 5 additions & 3 deletions ExerciciosModulo4/ExercerciciosModulo4.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />

<link rel="stylesheet" href="exercicioModulo4.css">
<title>Document</title>
</head>
<body>
<div>
<ul></ul>
<input type="text" id="user" />
<div class="container flex">
<input type="text flex" id="user" />
<button onclick="getUserRepo()">Adicionar</button>
<ul class="list flex"></ul>
</div>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="ExerciciosModulo4.js"></script>
Expand Down
10 changes: 8 additions & 2 deletions ExerciciosModulo4/ExerciciosModulo4.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,15 @@ const fillList = repositorios => {

for (repo of repositorios) {
const reponame = document.createTextNode(repo.name);
const repolink = document.createTextNode(repo.html_url);
const repoItem = document.createElement("li");

repoItem.appendChild(reponame);
const link = document.createElement("a");

link.setAttribute("href", repolink.data);
link.setAttribute("target", "_blank");
link.appendChild(reponame);
repoItem.appendChild(link);
dataList.appendChild(repoItem);

}
};
115 changes: 115 additions & 0 deletions ExerciciosModulo4/exercicioModulo4.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
html, body, div, ul, li, a, button {
border: 0;
padding: 0;
margin: 0;
}

html {
font-family:Arial, Helvetica, sans-serif;
font-size: 16px;
}

.container {
width: 90vw;
margin: 5vh auto;
background-color: #f5f5f5;
padding: 10px 0;
}

.container input {
padding: 10px;
font-size: 1.2rem;
text-align: center;
border: 1px solid grey;
border-radius: 8px;
width: 230px;
margin: 0 auto;
}

.container input:focus {
border: 1px solid cornflowerblue;
outline: 0;
}

.container button {
background-color: cornflowerblue;
color: #fff;
padding: 10px;
font-size: 1.2rem;
border-radius: 8px;
width: 200px;
margin: 10px auto 0;
outline: 0;
}

.container button:hover {
filter: brightness(90%);
transition: 0.3s;
}

.flex {
display: flex;
flex-direction: column;
}

.list {
margin-top: 10px;
padding: 20px 20px 10px 20px;
min-height: 70vh;
}

.list li {
margin: 0 10px 10px 0;
list-style: none;
width: 80vw;
}

.list li a {
text-decoration: none;
font-size: 1.4rem;
background-color: cornflowerblue;
color: #fff;
padding: 10px 0;
display: block;
text-align: center;
border-radius: 8px;
border: 1px solid cornflowerblue;
}

.list li a:hover {
background-color: #fff;
color: cornflowerblue;
transition: 0.3s;
}

.list li a:active {
background-color: #fff;
color: cornflowerblue;
}

@media (min-width: 600px) {
.list {
flex-direction: row;
flex-wrap: wrap;
}

.list li {
width: 40vw;
}
}

@media (min-width: 801px) {
.list li {
width: 40vw;
}
}

@media (min-width: 1024px) {
.container {
width: 80vw;
}

.list li {
width: 25vw;
}
}