Skip to content

Commit

Permalink
U: texts
Browse files Browse the repository at this point in the history
  • Loading branch information
N1c0Dev committed Dec 5, 2024
1 parent 60310d7 commit d3add7c
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

body {
background: #f1f5f9;
font-family: DM Sans, Avenir, Helvetica, Arial, sans-serif;
}

2 changes: 1 addition & 1 deletion src/views/base/NotFoundView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function goToHome() {
>
404
</h1>
<p class="mx-auto">Pokepage not found...</p>
<p class="mx-auto">Poképage not found...</p>
<button
class="
mx-auto
Expand Down
57 changes: 54 additions & 3 deletions src/views/pages/Team/TeamDeatilsView.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { ref } from 'vue'
import { useRoute } from 'vue-router'
import { usePokemonStore } from "@/stores/pokemon.ts"
Expand All @@ -8,11 +9,20 @@ import NavBar from "@/components/NavBar.vue";
const route = useRoute()
const pokemonIsValid: boolean = ref(false)
const pokemonStore = usePokemonStore()
pokemonStore.getPokemon(route.params.id)
pokemonStore.getPokemonSpecies(route.params.id)
setTimeout(() => pokemonStore.getEvolutionChain(pokemonStore.pokemonSpecies.evolution_chain.url), 500)
function checkPokemon(){
pokemonIsValid.value = pokemonStore.myPokemonTeam.find(pokemon => pokemon.id == route.params.id)
}
checkPokemon()
if (pokemonIsValid.value) {
pokemonStore.getPokemon(route.params.id)
pokemonStore.getPokemonSpecies(route.params.id)
setTimeout(() => pokemonStore.getEvolutionChain(pokemonStore.pokemonSpecies.evolution_chain.url), 500)
}
</script>

<template>
Expand All @@ -22,6 +32,7 @@ setTimeout(() => pokemonStore.getEvolutionChain(pokemonStore.pokemonSpecies.evol
:pokemon-count="pokemonStore.myPokemonTeam.length"
/>
<div
v-if="pokemonIsValid"
class="
mx-5
mt-5
Expand All @@ -34,6 +45,46 @@ setTimeout(() => pokemonStore.getEvolutionChain(pokemonStore.pokemonSpecies.evol
:evolution-chain-data="pokemonStore.evolutionChain"
/>
</div>
<div
v-else
class="
mx-5
mt-5
"
>
<section
class="
flex
flex-col
bg-slate-300
h-screen
w-full
shadow
rounded-lg
text-gray-500
text-3xl
font-semibold
"
>
<img
class="
mt-auto
mx-auto
w-[150px]
"
src="@/assets/icons/pokeball.svg"
alt="pokeball"
/>
<div
class="
mb-auto
mx-auto
"
>
This Pokémon is not currently part of your team
</div>
</section>
</div>
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/home/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
>
<SimpleCard
buttonText="Add to team"
button-text-disabled="Team is Full!"
button-text-disabled="Your team is already full!"
:button-action="() => { pokemonStore.addPokemonToTeam(pokemon.entry_number) }"
:image-url="`${pokemonSpriteBaseUrl}${pokemon.entry_number}.png`"
:title="`#${pokemon.entry_number} ${pokemon.pokemon_species.name}`"
Expand Down

0 comments on commit d3add7c

Please sign in to comment.