Skip to content

Commit

Permalink
display candy + ui tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Schmitt committed Aug 2, 2016
1 parent 1584027 commit 9691363
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
28 changes: 12 additions & 16 deletions app/assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
body, html, .content {
font-family: Roboto;
font-weight: 400;
background: linear-gradient(to top, #24ccaa, #a2db95);
background-color: black;
color: #eee;
display: flex;
flex-direction: column;
Expand All @@ -26,6 +26,7 @@ body, html, .content {
padding: 0px;
align-items: stretch;
flex: 1 100%;
background: linear-gradient(to top, #24ccaa, #a2db95);
}

#map {
Expand Down Expand Up @@ -59,21 +60,9 @@ body, html, .content {
border-right: 0px;
}
.toolbar div:hover {
background-color: #000;
}
@keyframes bounce {
0% { margin-top: 0px; }
15% { margin-top: -4px; }
30% { margin-top: 0px; }
40% { margin-top: -3px; }
50% { margin-top: 0px; }
60% { margin-top: -1px; }
70% { margin-top: 0px; }
}
.toolbar div:hover img {
-webkit-filter: invert(100%);
animation: bounce 600ms 1;
background-color: #f4f4f4;
}

.toolbar a {
padding: 7px 12px 5px;
display: inline-block;
Expand Down Expand Up @@ -211,6 +200,10 @@ body, html, .content {
color: #fff;
}

.pokemonsort a:hover {
opacity: 0.5;
}

.pokemon .imgspan {
flex-grow: 1;
display: flex;
Expand All @@ -222,8 +215,11 @@ body, html, .content {
margin: auto;
}

.pokemon span:last-child {
.pokemon .name {
font-weight: bold;
}

.pokemon span:last-child {
letter-spacing: 0.05em;
}

Expand Down
7 changes: 4 additions & 3 deletions app/scripts/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ Map.prototype.displayPokemonList = function(all, sortBy) {
var div = $(".inventory .data");
div.html(``);
this.pokemonList.forEach(function(elt) {
var canEvolve = elt.canEvolve && !elt.inGym;
console.log(elt);
var canEvolve = elt.canEvolve && !elt.inGym && elt.candy >= elt.candyToEvolve;
var evolveStyle = canEvolve ? "" : "style='display:none'";
div.append(`
<div class="pokemon">
Expand All @@ -161,9 +162,9 @@ Map.prototype.displayPokemonList = function(all, sortBy) {
<a title='Evolve' href="#" class="evolveAction" ${evolveStyle}><img src="./assets/img/evolve.png" /></a>
</div>
<span class="info">CP: <strong>${elt.cp}</strong> IV: <strong>${elt.iv}%</strong></span>
<span class="info">Candy: ${elt.candy}</span>
<span class="info">Candy: ${elt.candy}<span ${evolveStyle}>/${elt.candyToEvolve}</span></span>
<span class="imgspan"><img src="./assets/pokemon/${elt.pokemonId}.png" /></span>
<span>${elt.name}</span>
<span class="name">${elt.name}</span>
</div>
`);
});
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ function listenToWebSocket() {
id: p.Item1.Id,
pokemonId: p.Item1.PokemonId,
inGym: p.Item1.DeployedFortId != "",
canEvolve: pkmInfo && pkmInfo.EvolutionIds.length > 0, //&& pkmInfo.CandyToEvolve <= p.Item3,
canEvolve: pkmInfo && pkmInfo.EvolutionIds.length > 0,
cp: p.Item1.Cp,
iv: p.Item2.toFixed(1),
name: p.Item1.Nickname || inventory.getPokemonName(p.Item1.PokemonId),
realname: inventory.getPokemonName(p.Item1.PokemonId, "en"),
candy: p.Item3,
//candyToEvolve: pkmInfo.CandyToEvolve
candyToEvolve: pkmInfo.CandyToEvolve
}
});
global.map.displayPokemonList(pkm);
Expand Down

0 comments on commit 9691363

Please sign in to comment.