diff --git a/components/Header.vue b/components/Header.vue index 86a6b18..b3159e6 100644 --- a/components/Header.vue +++ b/components/Header.vue @@ -1,5 +1,10 @@ - Mon pokédex + Mon pokédex + diff --git a/pages/index.vue b/pages/index.vue index b6cdf35..33032fe 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -22,7 +22,6 @@ export default { components: { PokemonCard, GenerationFilter }, data() { return { - // Toutes les générations par défaut, donc on montre tout au départ selectedGen: [1, 2, 3, 4, 5, 6, 7, 8, 9], pokemons: [], } diff --git a/pages/inspire.vue b/pages/inspire.vue deleted file mode 100644 index 008d065..0000000 --- a/pages/inspire.vue +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - “First, solve the problem. Then, write the code.” - - - - - diff --git a/pages/pokemon/_id.vue b/pages/pokemon/_id.vue index a918de9..92b3f71 100644 --- a/pages/pokemon/_id.vue +++ b/pages/pokemon/_id.vue @@ -2,9 +2,89 @@ {{ pokemon.name.fr }} - - Génération : {{ pokemon.generation.name }} - Types : {{ pokemon.types.map(t => t.name).join(', ') }} + + + + + + {{ sprite.label }} + + + + Génération : {{ pokemon.generation }} + + + Types : + + + {{ type.name }} + + + + + Talents : + + + {{ talent.name }} (Talent caché) + + + + + + Stats : + + + HP{{ pokemon.stats.hp }} + Attaque{{ pokemon.stats.atk }} + Défense{{ pokemon.stats.def }} + Attaque Spéciale{{ pokemon.stats.spe_atk }} + Défense Spéciale{{ pokemon.stats.spe_def }} + Vitesse{{ pokemon.stats.vit }} + + + + + + Résistances : + + + {{ res.name }} + + + + + + Évolution : + + Précédent: {{ pokemon.evolution.pre.name || 'N/A' }} + + Suivant: + + + {{ evo.name }} - {{ evo.condition }} + + + + Méga: {{ pokemon.evolution.mega.name || 'N/A' }} + + + + + Taille : {{ pokemon.height }} + Poids : {{ pokemon.weight }} + Sexe : ♂ {{ pokemon.sexe.male }}% / ♀ {{ pokemon.sexe.female }}% + Taux de capture : {{ pokemon.catch_rate }} + Groupes d'œufs : {{ pokemon.egg_groups.join(', ') }} + @@ -16,6 +96,34 @@ export default { async asyncData({ params }) { const { data } = await axios.get(`https://tyradex.vercel.app/api/v1/pokemon/${params.id}`) return { pokemon: data } + }, + computed: { + availableSprites() { + const sprites = [] + if (this.pokemon.sprites.regular) + sprites.push({ url: this.pokemon.sprites.regular, label: 'Normal' }) + if (this.pokemon.sprites.shiny) + sprites.push({ url: this.pokemon.sprites.shiny, label: 'Shiny' }) + if (this.pokemon.sprites.gmax) + sprites.push({ url: this.pokemon.sprites.gmax, label: 'Gigamax' }) + return sprites + } + }, + methods: { + resistanceClass(multiplier) { + if (multiplier === 0) return 'bg-red-700' + if (multiplier < 1) return 'bg-green-600' + if (multiplier === 1) return 'bg-gray-500' + if (multiplier > 1) return 'bg-yellow-600' + return 'bg-gray-500' + } } } + +
- “First, solve the problem. Then, write the code.” - -
Génération : {{ pokemon.generation.name }}
Types : {{ pokemon.types.map(t => t.name).join(', ') }}
Génération : {{ pokemon.generation }}