Skip to content

Commit

Permalink
2주차
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoojin9 committed Apr 2, 2024
1 parent 278ec1e commit ed8561b
Show file tree
Hide file tree
Showing 17 changed files with 212 additions and 900 deletions.
142 changes: 142 additions & 0 deletions data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
const data = [
{
name: 'Bulbasaur',
height: '7',
weight: '69',
types: ['grass', 'poison'],
'base-Experience': '64',
abilities: ['overgrow', 'chlorophyll'],
hp: '45',
attack: '49',
defense: '49',
'special-attack': '65',
'special-defense': '65',
speed: '45',
},
{
name: 'Ivysaur',
height: '10',
weight: '130',
types: ['grass', 'poison'],
'base-Experience': '142',
abilities: ['overgrow', 'chlorophyll'],
hp: '60',
attack: '62',
defense: '63',
'special-attack': '80',
'special-defense': '80',
speed: '60',
},
{
name: 'Venusaur',
height: '20',
weight: '1000',
types: ['grass', 'poison'],
'base-Experience': '236',
abilities: ['overgrow', 'chlorophyll'],
hp: '80',
attack: '82',
defense: '83',
'special-attack': '100',
'special-defense': '100',
speed: '80',
},
{
name: 'Charmander',
height: '6',
weight: '85',
types: ['fire'],
'base-Experience': '62',
abilities: ['blaze', 'solar-power'],
hp: '39',
attack: '52',
defense: '43',
'special-attack': '60',
'special-defense': '50',
speed: '65',
},
{
name: 'Charmeleon',
height: '11',
weight: '190',
types: ['fire'],
'base-Experience': '142',
abilities: ['blaze', 'solar-power'],
hp: '58',
attack: '64',
defense: '58',
'special-attack': '80',
'special-defense': '65',
speed: '80',
},
{
name: 'Charizard',
height: '17',
weight: '905',
types: ['fire', 'flying'],
'base-Experience': '240',
abilities: ['blaze', 'solar-power'],
hp: '78',
attack: '84',
defense: '78',
'special-attack': '109',
'special-defense': '85',
speed: '100',
},
{
name: 'Squirtle',
height: '5',
weight: '90',
types: ['water'],
'base-Experience': '63',
abilities: ['torrent', 'rain-dish'],
hp: '44',
attack: '48',
defense: '65',
'special-attack': '50',
'special-defense': '64',
speed: '43',
},
{
name: 'Wartortle',
height: '10',
weight: '225',
types: ['water'],
'base-Experience': '142',
abilities: ['torrent', 'rain-dish'],
hp: '59',
attack: '63',
defense: '80',
'special-attack': '65',
'special-defense': '80',
speed: '58',
},
{
name: 'Blastoise',
height: '16',
weight: '855',
types: ['water'],
'base-Experience': '239',
abilities: ['torrent', 'rain-dish'],
hp: '79',
attack: '83',
defense: '100',
'special-attack': '85',
'special-defense': '105',
speed: '78',
},
{
name: 'Caterpie',
height: '3',
weight: '29',
types: ['bug'],
'base-Experience': '39',
abilities: ['shield-dust', 'run-away'],
hp: '45',
attack: '30',
defense: '35',
'special-attack': '20',
'special-defense': '20',
speed: '45',
},
]
113 changes: 3 additions & 110 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,116 +15,9 @@
<h1><a href="./">Pokemon List</a></h1>
</nav>
<main>
<div id="card-wrapper">
<a class="card" href="./pokemon/1.html">
<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/1.png" alt="bulbasaur">
<div class="info-wrapper">
<h2>bulbasaur</h2>
<p>height: 7 dm</p>
<p>weight: 69 hg</p>
<p>types: grass, poison</p>
</div>
</a>
<a class="card" href="./pokemon/2.html">
<div class="img-wrapper">
<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/2.png" alt="ivysaur">
</div>
<div class="info-wrapper">
<h2>ivysaur</h2>
<p>height: 10 dm</p>
<p>weight: 130 hg</p>
<p>types: grass, poison</p>
</div>
</a>
<a class="card" href="./pokemon/3.html">
<div class="img-wrapper">
<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/3.png" alt="venusaur">
</div>
<div class="info-wrapper">
<h2>venusaur</h2>
<p>height: 10 dm</p>
<p>weight: 130 hg</p>
<p>types: grass, poison</p>
</div>
</a>
<a class="card" href="./pokemon/4.html">
<div class="img-wrapper">
<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/4.png" alt="charmander">
</div>
<div class="info-wrapper">
<h2>charmander</h2>
<p>height: 7 dm</p>
<p>weight: 69 hg</p>
<p>types: grass, poison</p>
</div>
</a>
<a class="card" href="./pokemon/5.html">
<div class="img-wrapper">
<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/5.png" alt="charmeleon">
</div>
<div class="info-wrapper">
<h2>charmeleon</h2>
<p>height: 7 dm</p>
<p>weight: 69 hg</p>
<p>types: grass, poison</p>
</div>
</a>
<a class="card" href="./pokemon/6.html">
<div class="img-wrapper">
<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/6.png" alt="charizard">
</div>
<div class="info-wrapper">
<h2>charizard</h2>
<p>height: 7 dm</p>
<p>weight: 69 hg</p>
<p>types: grass, poison</p>
</div>
</a>
<a class="card" href="./pokemon/7.html">
<div class="img-wrapper">
<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/7.png" alt="squirtle">
</div>
<div class="info-wrapper">
<h2>squirtle</h2>
<p>height: 7 dm</p>
<p>weight: 69 hg</p>
<p>types: grass, poison</p>
</div>
</a>
<a class="card" href="./pokemon/8.html">
<div class="img-wrapper">
<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/8.png" alt="wartortle">
</div>
<div class="info-wrapper">
<h2>wartortle</h2>
<p>height: 7 dm</p>
<p>weight: 69 hg</p>
<p>types: grass, poison</p>
</div>
</a>
<a class="card" href="./pokemon/9.html">
<div class="img-wrapper">
<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/9.png" alt="blastoise">
</div>
<div class="info-wrapper">
<h2>blastoise</h2>
<p>height: 7 dm</p>
<p>weight: 69 hg</p>
<p>types: grass, poison</p>
</div>
</a>
<a class="card" href="./pokemon/10.html">
<div class="img-wrapper">
<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/10.png" alt="caterpie">
</div>
<div class="info-wrapper">
<h2>caterpie</h2>
<p>height: 7 dm</p>
<p>weight: 69 hg</p>
<p>types: grass, poison</p>
</div>
</a>
</div>
<div id="card-wrapper"></div>
</main>
<script src="data.js"></script>
<script src="main.js"></script>
</body>
</html>
14 changes: 14 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
for (var i=1;i<=data.length;i++) {
const pokemon = data[i-1];
var a = document.createElement("a");
a.className += "card";
a.href = `./pokemon/index.html?n=${i-1}`;
a.innerHTML = `<img src="https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/${i}.png" alt="${pokemon.name}">
<div class="info-wrapper">
<h2>${pokemon.name}</h2>
<p>Height: ${pokemon.height}</p>
<p>Weight: ${pokemon.weight}</p>
<p>Types: ${pokemon.types.join(", ")}</p>
</div>`;
document.getElementById("card-wrapper").appendChild(a);
}
79 changes: 0 additions & 79 deletions pokemon/1.html

This file was deleted.

Loading

0 comments on commit ed8561b

Please sign in to comment.