Skip to content

Commit

Permalink
Adicionado favicon na aba e mudança de código para inglês
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonathanSousa committed Aug 9, 2022
1 parent 705d98d commit 2dda915
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 31 deletions.
Binary file added favicon.ico
Binary file not shown.
22 changes: 12 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GitFav</title>
<title>GitFav - Search for your favorite user</title>
<!-- TAB-ICON -->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<!-- STYLE-CSS -->
<link rel="stylesheet" href="style/style.css">
<!-- FONTE-DO-PROJETO -->
<!-- PROJECT-SOURCE -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<!-- IMPORTAND-SCRIPT -->
<!-- IMPORT-SCRIPT -->
<script src="script/main.js" type="module" defer></script>
</head>
<body>
Expand All @@ -20,13 +22,13 @@
<header>
<a href="#"><img src="image/logo-gitfav.png" alt="Logo gitfav"></a>
<div class="search">
<label for="favorite" class="sr-only">Digite o Github username que quer favoritar</label>
<input type="text" id="favorite" placeholder="Digite o Github username que quer favoritar">
<label for="favorite" class="sr-only">Enter the Github username you want to favorite</label>
<input type="text" id="favorite" placeholder="Enter the Github username you want to favorite">
<button>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 1.5C12.3249 1.5 12.6128 1.70919 12.7133 2.01819L14.9824 9H22.5C22.8287 9 23.1191 9.21402 23.2164 9.52798C23.3137 9.84193 23.1952 10.1827 22.9241 10.3685L16.8295 14.5477L19.1794 21.5102C19.2837 21.8193 19.1762 22.1605 18.9134 22.354C18.6506 22.5474 18.2929 22.5488 18.0287 22.3573L12 17.9887L5.97133 22.3573C5.70709 22.5488 5.34938 22.5474 5.0866 22.354C4.82381 22.1605 4.71628 21.8193 4.82063 21.5102L7.17046 14.5477L1.07585 10.3685C0.804769 10.1827 0.686309 9.84193 0.783612 9.52798C0.880915 9.21402 1.17131 9 1.49999 9H9.01763L11.2867 2.01819C11.3871 1.70919 11.6751 1.5 12 1.5ZM12 4.67651L10.2758 9.98181C10.1753 10.2908 9.88739 10.5 9.56249 10.5H3.91994L8.48664 13.6315C8.76343 13.8213 8.88044 14.1718 8.77311 14.4898L6.99287 19.7646L11.5599 16.4552C11.8225 16.2649 12.1775 16.2649 12.4401 16.4552L17.0071 19.7646L15.2269 14.4898C15.1196 14.1718 15.2366 13.8213 15.5133 13.6315L20.08 10.5H14.4375C14.1126 10.5 13.8246 10.2908 13.7242 9.98181L12 4.67651Z" fill="white"/>
</svg>
favoritar
favorite
</button>
</div>
</header>
Expand All @@ -36,10 +38,10 @@
<table>
<thead>
<tr>
<th>Usuário</th>
<th>Users</th>
<th>Repositories</th>
<th>Followers</th>
<th>Ação</th>
<th>Action</th>
</tr>
</thead>

Expand All @@ -49,8 +51,8 @@

<!-- BACKGROUND-TABLE -->
<div class="bg-table" id="bg-table">
<img src="image/estrela.png" alt="Imagem de uma estrela para representar usuários favoritos">
<h2>Nenhum favorito ainda</h2>
<img src="image/estrela.png" alt="Image of a star to represent favorite users">
<h2>No favorites yet</h2>
</div>
<!-- BACKGROUND-TABLE -->
</div>
Expand Down
26 changes: 9 additions & 17 deletions script/Favorites.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ export class Favorites{
const userExists = this.entries.find(entry => entry.login === username);

if(userExists){
throw new Error('Usuário já cadastrado');
throw new Error('User already registered');
}


const user = await GithubUser.search(username);
if(user.login === undefined){
throw new Error('Usuário não encontrado! Tente novamente');
throw new Error('User not found! Try again');
}

this.entries = [user, ...this.entries];
Expand Down Expand Up @@ -76,7 +76,7 @@ export class FavoritesView extends Favorites{
row.querySelector('.followers').textContent = user.followers;

row.querySelector('.remove').onclick = () => {
const isOk = confirm('Tem certeza que deseja exluir?');
const isOk = confirm('Are you sure you want to delete?');

if(isOk){
this.delete(user);
Expand All @@ -93,24 +93,16 @@ export class FavoritesView extends Favorites{
tr.innerHTML =
`
<td class="user">
<img src="https://github.com/jhonathanSousa.png" alt="Image">
<img src="" alt="Image">
<a href="" target="_blank">
<p>Jhonathan Sousa</p>
<span>/ jhonathanSousa</span>
<p></p>
<span>/</span>
</a>
</td>
<td class="repositories">
30
</td>
<td class="followers">
30
</td>
<td>
<button class="remove">Remover</button>
</td>
<td class="repositories"></td>
<td class="followers"></td>
<td><button class="remove">Remover</button></td>
`;
return tr;
}
Expand Down
8 changes: 4 additions & 4 deletions style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
text-decoration: none;
}

/* VARIÁVEIS-CSS */
/* CSS-VARIABLES */
:root{
--bg-body: #030b0d;
--ff-primary: 'Roboto', sans-serif;
Expand Down Expand Up @@ -37,7 +37,7 @@ body{
margin: 0 auto;
}

/* FORMATAÇÃO HEADER */
/* HEADER FORMATTING*/
header{
display: flex;
align-items: center;
Expand Down Expand Up @@ -89,7 +89,7 @@ header .search button:hover , header .search button:hover svg path{
fill: #065E7C;
}

/* FORMATAÇÃO TABLE */
/* TABLE FORMATTING */
table{
width: 100%;
border-collapse: collapse;
Expand Down Expand Up @@ -148,7 +148,7 @@ table tbody tr td .remove{
cursor: pointer;
}

/* FORMATAÇÃO DE BACKGROUND-TABLE */
/* BACKGROUND-TABLE FORMATTING */
.bg-table{
display: flex;
align-items: center;
Expand Down

1 comment on commit 2dda915

@vercel
Copy link

@vercel vercel bot commented on 2dda915 Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.