Skip to content

Commit

Permalink
Merge pull request #9 from lawandothman/develop
Browse files Browse the repository at this point in the history
Bug fix and pokemon list design
  • Loading branch information
lawandothman authored Jan 15, 2020
2 parents d5bb35b + eddeb2e commit 4869109
Show file tree
Hide file tree
Showing 2 changed files with 173 additions and 32 deletions.
126 changes: 121 additions & 5 deletions public/style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,121 @@
* {
font-family: sans-serif;
color: #222;

}
body {
margin: 0;
}
.container {
margin: auto;
text-align: center;
}

.type {
text-transform: capitalize;
text-align: center;
text-transform: uppercase;
color: white;
padding: 2px 10px;
border-radius: 10px;
margin: 0px 5px 0px 5px;
}

.pokedex {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
align-items: center;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.pokemon-card {
list-style: none;
padding: 40px;
margin: 30px;
background-color: white;
box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.09);
transition: 0.3s ease-in-out;
border-radius: 2px;
}
.pokemon-card:hover {
box-shadow: 0 5px 15px 2px rgba(0, 0, 0, 0.1);
}

.name {
text-transform: uppercase;
margin: auto;
text-align: center;
}

.image {
height: 180px;
margin: 10px 0px 10px 0px;
}

.fire {
background-color: #fd7d24;
}

.flying {
background: rgb(0, 212, 255);
background: linear-gradient(
180deg,
rgba(0, 212, 255, 1) 40%,
rgba(195, 195, 195, 1) 60%
);
}
.electric {
background-color: #eed535;
}
.grass {
background-color: #57ba7d;
}
.water {
background-color: #4592c4;
}
.psychic {
background-color: #f366b9;
}
.fighting {
background-color: #d56723;
}
.bug {
background-color: #b05cfa;
}
.normal {
background-color: #959396;
}
.dragon {
background: rgb(255, 197, 99);
background: linear-gradient(
180deg,
rgba(255, 197, 99, 1) 40%,
rgba(240, 134, 83, 1) 60%
);
}
.fairy {
background-color: #fdb9e9;
}
.rock {
background-color: #948c5c;
}
.ground {
background: rgb(126, 57, 57);
background: linear-gradient(
180deg,
rgba(99, 175, 200, 1) 40%,
rgba(126, 57, 57, 1) 60%
);
}
.steel {
background-color: #9eb7b8;
}
.ice {
background-color: #51c4e7;
}
.ghost {
background-color: #7b62a3;
}
.dark {
background-color: #332f2f;
}
.poison {
background-color: #b97fc9;
}
79 changes: 52 additions & 27 deletions views/index.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>My Pokédex</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<link rel = "stylesheet" type = "text/css" href = "/style.css">
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bulma@0.8.0/css/bulma.min.css"
/>
<link
rel="stylesheet"
src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"
/>
</head>


<body class = "has-background-white">
<div class="container">
<h1>Welcome to My Pokédex</h1>
<div class="block">
<h1 class="title is-1">Pokédex</h1>
</div>
</div>

<ol>
{%for pokemon in pokemons%}
<a href = "/pokemon/{{pokemon.data.id}}">
<p class = "name"> {{pokemon.data.name}} </p>
<img class = "image" src = "{{pokemon.data.sprites["front_default"]}}">
</a>
<p class = "type"> {%for type in pokemon.data.types%} {{type.type.name}} {%endfor%}</p>
<hr>
{%endfor%}
<div class="container">
<ol class = "pokedex" >

{%for pokemon in pokemons%}
<li class = "pokemon-card">
<a href="/pokemon/{{pokemon.data.id}}">
<p class="name">{{pokemon.data.name}}</p>
<img class = "image" src =
"{{pokemon.data.sprites["front_default"]}}" onerror = "this.src='https://www.brooklinelibrary.org/wp-content/uploads/2016/07/2000px-Poké_Ball.svg_-1.png'">
</a>
{%for type in pokemon.data.types%}
<span class = "type {{type.type.name}}"> {{type.type.name}} </span>
{%endfor%}
{%endfor%}
</li>
</ol>
</div>

{% if (page-1) >= 0%}
<a href = "/?page={{page-1}}"> Previous </a>
{%endif%}
{%if (page+1) < maxNumOfPages%}
<a href = "/?page={{page+1}}"> Next </a>
{%endif%}
</ol>
<script src="../client.js"></script>
</body>
</html>
<div class="container">
{% if (page-1) >= 0%}
<a class = "button is-primary" href="/?page={{page-1}}"> Previous </a>
{% else %}
<button class = "button is-static" diasbled> Previous </button>
{%endif%}
{%if (page+1) < maxNumOfPages%}
<a class = "button is-primary" href="/?page={{page+1}}"> Next </a>
{% else %}
<button class = "button is-static" disabled> Next </button>
{%endif%}
</div>
<script src="../client.js"></script>
</body>
</html>

0 comments on commit 4869109

Please sign in to comment.