-
-
-
-
-
-
-
-
+
+
-
404
@@ -44,16 +40,11 @@ onMounted(() => {
-
The requested Pokémon does not exist in the database.
-
-
-
-
-
+
diff --git a/src/pages/Pokedex.vue b/src/pages/Pokedex.vue
index 36a8760..d374ba4 100644
--- a/src/pages/Pokedex.vue
+++ b/src/pages/Pokedex.vue
@@ -4,9 +4,7 @@ import { useRoute, useRouter } from 'vue-router';
import Description from '../components/pokemon/Description.vue'
import Information from '../components/pokemon/Information.vue'
import Pokemon from '../components/pokemon/Pokemon.vue'
-import Header from '../components/layout/Header.vue'
-import StatusBar from '../components/layout/StatusBar.vue'
-import BackgroundGrid from '../components/ui/BackgroundGrid.vue'
+import PageLayout from '../components/layout/PageLayout.vue'
import ColorThief from 'colorthief'
import { generateThemeColors } from '../utils/theme'
import { appState } from '../store'
@@ -38,12 +36,10 @@ function getPokemonColors(image) {
}
function getPokemonData() {
- // Reset state before fetch to avoid stale data flash
pokemon.value = null
const currentId = parseInt(route.params.id)
- // Fetch current Pokemon
fetch(`https://pokeapi.co/api/v2/pokemon/${currentId}`)
.then((response) => {
if (!response.ok) {
@@ -69,7 +65,6 @@ function getPokemonData() {
if (json) pokemonSpecies.value = json
});
- // Fetch previous Pokemon (if exists)
if (currentId > 1) {
fetch(`https://pokeapi.co/api/v2/pokemon/${currentId - 1}`)
.then((response) => response.ok ? response.json() : null)
@@ -80,7 +75,6 @@ function getPokemonData() {
appState.setPreviousPokemon(null)
}
- // Fetch next Pokemon
fetch(`https://pokeapi.co/api/v2/pokemon/${currentId + 1}`)
.then((response) => response.ok ? response.json() : null)
.then((json) => {
@@ -107,14 +101,15 @@ const pokemonColors = computed(() => {
}
});
-// Initial fetch
getPokemonData()
-// Watch for route changes to refetch data
watch(() => route.params.id, () => {
getPokemonData()
})
+
onMounted(() => {
+ appState.clearPageDisplay()
+
setButtonActions([
{ buttonNumber: 1, label: 'LIST', action: () => router.push('/') },
{ buttonNumber: 2, label: 'STATS', action: () => console.log('Stats view - TBA') },
@@ -126,46 +121,36 @@ onMounted(() => {
-
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
Species:
{{ pokemonSpecies.genera.find(g => g.language.name === 'en')?.genus || 'Unknown' }}
-
-
-
@@ -175,43 +160,36 @@ onMounted(() => {
-
+
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
ACCESSING DATABASE
+
Establishing secure connection...
-
-
-
ACCESSING DATABASE
-
Establishing secure connection...
-
-
-
+