Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projeto desenvolvimento de uma Pokédex consumindo a PokeAPI #269

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
1 change: 0 additions & 1 deletion README.md

This file was deleted.

3 changes: 2 additions & 1 deletion assets/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
}

body {
background-color: #f6f8fc;
background: linear-gradient(10deg, rgba(0, 72, 255, 0.695), rgba(255, 1, 1, 0.695), rgba(245, 221, 1, 0.695));
background-repeat: no-repeat;
}

.content {
Expand Down
14 changes: 10 additions & 4 deletions assets/css/pokedex.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,21 @@
margin: .5rem;
padding: 1rem;
border-radius: 1rem;
cursor: pointer;
}

.pokemon .number {
color: #000;
opacity: .3;
text-align: right;
font-size: .625rem;
font-size: 1rem;
}

.pokemon .name {
text-transform: capitalize;
color: #fff;
font-size: 1.3rem;
font-weight: 600;
margin-bottom: .25rem;
}

Expand All @@ -116,7 +119,9 @@
color: #fff;
padding: .25rem .5rem;
margin: .25rem 0;
font-size: .625rem;
font-size: .825rem;
font-weight: 400;
text-transform: capitalize;
border-radius: 1rem;
filter: brightness(1.1);
text-align: center;
Expand All @@ -137,13 +142,14 @@
}

.pagination button {
padding: .25rem .5rem;
padding: .5rem 1rem;
margin: .25rem 0;
font-size: .625rem;
font-size: 1rem;
color: #fff;
background-color: #6c79db;
border: none;
border-radius: 1rem;
cursor: pointer;
}

@media screen and (min-width: 380px) {
Expand Down
4 changes: 2 additions & 2 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ const pokemonList = document.getElementById('pokemonList')
const loadMoreButton = document.getElementById('loadMoreButton')

const maxRecords = 151
const limit = 10
const limit = 12
let offset = 0;

function convertPokemonToLi(pokemon) {
return `
<li class="pokemon ${pokemon.type}">
<span class="number">#${pokemon.number}</span>
<span class="name">${pokemon.name}</span>

<div class="detail">
<ol class="types">
${pokemon.types.map((type) => `<li class="type ${type}">${type}</li>`).join('')}
Expand Down
2 changes: 1 addition & 1 deletion assets/js/poke-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ pokeApi.getPokemons = (offset = 0, limit = 5) => {
.then((pokemons) => pokemons.map(pokeApi.getPokemonDetail))
.then((detailRequests) => Promise.all(detailRequests))
.then((pokemonsDetails) => pokemonsDetails)
}
}
2 changes: 1 addition & 1 deletion assets/js/pokemon-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ class Pokemon {
type;
types = [];
photo;
}
}
25 changes: 14 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,33 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;500;700&display=swap" rel="stylesheet">

<!-- Nosso CSS -->
<link rel="stylesheet" href="/assets/css/global.css">
<link rel="stylesheet" href="/assets/css/pokedex.css">
<!-- Link CSS -->
<link rel="stylesheet" href="./assets/css/global.css">
<link rel="stylesheet" href="./assets/css/pokedex.css">
<link rel="stylesheet" href="./assets/css/pokemonColors.css">
</head>

<body>
<section class="content">
<h1>Pokedex</h1>

<h1>Pokédex - 1ª Geração</h1>
<ol id="pokemonList" class="pokemons">
<!-- ..... Pokemons here ..... -->

</ol>


<div class="pagination">
<button id="loadMoreButton" type="button">
Load More
Ver Mais
</button>
</div>

</section>

<!-- Nosso JS -->
<script src="/assets/js/pokemon-model.js"></script>
<script src="/assets/js/poke-api.js"></script>
<script src="/assets/js/main.js"></script>
<!-- Link JS -->
<script src="./assets/js/pokemon-model.js"></script>
<script src="./assets/js/poke-api.js"></script>
<script src="./assets/js/main.js"></script>
</body>

</html>