Add Pokémon types
This commit is contained in:
parent
0e356f0caf
commit
19aa6b70b3
14
flashdex.js
14
flashdex.js
@ -80,9 +80,9 @@ $(document).ready(function() {
|
|||||||
return '<span class="form LA"></span>'
|
return '<span class="form LA"></span>'
|
||||||
else if (pkmn["origin"] == "9G")
|
else if (pkmn["origin"] == "9G")
|
||||||
return '<span class="form SV"></span>'
|
return '<span class="form SV"></span>'
|
||||||
else if (pkmn["type"] == "mega")
|
else if (pkmn["form"] == "mega")
|
||||||
return '<span class="form mega"></span>';
|
return '<span class="form mega"></span>';
|
||||||
else if (pkmn["type"] == "giga")
|
else if (pkmn["form"] == "giga")
|
||||||
return '<span class="form giga"></span>';
|
return '<span class="form giga"></span>';
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@ -93,9 +93,19 @@ $(document).ready(function() {
|
|||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getFormattedTypes(num) {
|
||||||
|
str = '<span class="types"><span class="'+num["type"][0]+'">'+num["type"][0]+'</span>';
|
||||||
|
if (num["type"][1])
|
||||||
|
str += '<span class="'+num["type"][1]+'">'+num["type"][1]+'</span>';
|
||||||
|
str += '</span>';
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
for (i in pokemon_generation_list) {
|
for (i in pokemon_generation_list) {
|
||||||
|
|
||||||
$('article #container #game #flashdex').append(
|
$('article #container #game #flashdex').append(
|
||||||
'<div class="pokedex id_'+pklist.mn[pokemon_generation_list[i]]["num"]+'">'
|
'<div class="pokedex id_'+pklist.mn[pokemon_generation_list[i]]["num"]+'">'
|
||||||
|
+ getFormattedTypes(pklist.mn[pokemon_generation_list[i]])
|
||||||
+ getFormText(pklist.mn[pokemon_generation_list[i]]) // either gigantamax or mega-evolution
|
+ getFormText(pklist.mn[pokemon_generation_list[i]]) // either gigantamax or mega-evolution
|
||||||
+ '<img src="pokemon/'+ imageType((pklist.mn[pokemon_generation_list[i]]["num"])) +'.png"/>'
|
+ '<img src="pokemon/'+ imageType((pklist.mn[pokemon_generation_list[i]]["num"])) +'.png"/>'
|
||||||
+ '<span class="name">' + '<strong>' + '#' + getFormattedNumber(pklist.mn[[pokemon_generation_list[i]]]["num"]) + '</strong> '
|
+ '<span class="name">' + '<strong>' + '#' + getFormattedNumber(pklist.mn[[pokemon_generation_list[i]]]["num"]) + '</strong> '
|
||||||
|
2091
pokemon.json
2091
pokemon.json
File diff suppressed because it is too large
Load Diff
57
style.css
57
style.css
@ -353,7 +353,7 @@ article #container.diploma #score {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#container #game #flashdex .pokedex {
|
#container #game #flashdex .pokedex {
|
||||||
width: 250px; height: 285px;
|
width: 250px;
|
||||||
border: 1px solid white;
|
border: 1px solid white;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
@ -368,16 +368,10 @@ article #container.diploma #score {
|
|||||||
height: 250px;
|
height: 250px;
|
||||||
display: block;
|
display: block;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
margin: 12px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#game #flashdex .pokedex span.name {
|
#game #flashdex .pokedex span.form {
|
||||||
text-align: center;
|
|
||||||
font-size: 1em;
|
|
||||||
display: block;
|
|
||||||
margin: auto; margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
span.form {
|
|
||||||
display: block;
|
display: block;
|
||||||
float: right;
|
float: right;
|
||||||
width: 25px; height: 25px;
|
width: 25px; height: 25px;
|
||||||
@ -386,14 +380,52 @@ span.form {
|
|||||||
right: 10px;
|
right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
span.form.mega { background-image: url('img/icon_mega.png'); }
|
#game #flashdex .pokedex span.form.mega { background-image: url('img/icon_mega.png'); }
|
||||||
span.form.giga {
|
#game #flashdex .pokedex span.form.giga {
|
||||||
background-image: url('img/icon_giga.png'); background-color: white;
|
background-image: url('img/icon_giga.png'); background-color: white;
|
||||||
background-position: center; background-size:20px;
|
background-position: center; background-size:20px;
|
||||||
border-radius: 50%; border: 1px solid white;
|
border-radius: 50%; border: 1px solid white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#game #flashdex .pokedex span.types {
|
||||||
|
display: flex;
|
||||||
|
float: left;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#game #flashdex .pokedex span.types:after {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
#game #flashdex .pokedex span.types span {
|
||||||
|
margin: 0px;
|
||||||
|
margin-right: 5px;
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: 2px;
|
||||||
|
font-family: Sans-Serif;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#game #flashdex .pokedex span.types .Grass { background: #78C850; }
|
||||||
|
#game #flashdex .pokedex span.types .Poison { background: #A040A0; }
|
||||||
|
#game #flashdex .pokedex span.types .Fire { background: #F08030; }
|
||||||
|
#game #flashdex .pokedex span.types .Dragon { background: #7038F8; }
|
||||||
|
#game #flashdex .pokedex span.types .Flying { background: #A890F0; }
|
||||||
|
#game #flashdex .pokedex span.types .Water { background: #6890F0; }
|
||||||
|
#game #flashdex .pokedex span.types .Bug { background: #A8B820; }
|
||||||
|
#game #flashdex .pokedex span.types .Normal { background: #A8A878; }
|
||||||
|
#game #flashdex .pokedex span.types .Dark { background: #705848; }
|
||||||
|
#game #flashdex .pokedex span.types .Electric { background: #F8D030; }
|
||||||
|
#game #flashdex .pokedex span.types .Ground { background: #E0C068; }
|
||||||
|
#game #flashdex .pokedex span.types .Psychic { background: #F85888; }
|
||||||
|
#game #flashdex .pokedex span.types .Ice { background: #98D8D8; }
|
||||||
|
#game #flashdex .pokedex span.types .Steel { background: #B8B8D0; }
|
||||||
|
#game #flashdex .pokedex span.types .Fairy { background: #EE99AC; }
|
||||||
|
#game #flashdex .pokedex span.types .Fighting { background: #C03028; }
|
||||||
|
#game #flashdex .pokedex span.types .Rock { background: #B8A038; }
|
||||||
|
#game #flashdex .pokedex span.types .Ghost { background: #705898; }
|
||||||
|
|
||||||
|
|
||||||
/*** MOBILE ***/
|
/*** MOBILE ***/
|
||||||
@ -527,8 +559,7 @@ span.form.giga {
|
|||||||
|
|
||||||
/* flashdex */
|
/* flashdex */
|
||||||
|
|
||||||
#container #game #flashdex .pokedex { width: 230px; height: 260px; }
|
#container #game #flashdex .pokedex { width: 230px; }
|
||||||
#game #flashdex .pokedex img { height: 225px; }
|
|
||||||
|
|
||||||
#game #flashdex_config p { text-align: left; }
|
#game #flashdex_config p { text-align: left; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user