├── .vscode └── settings.json ├── assets ├── back-to-home.svg ├── chevron_left.svg ├── chevron_right.svg ├── cross.svg ├── height.svg ├── pokeball.svg ├── pokedex.svg ├── search.svg ├── sorting.svg └── weight.svg ├── detail.html ├── index.html ├── pokemon-detail.js ├── pokemon.js ├── search.js └── style.css /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501 3 | } 4 | -------------------------------------------------------------------------------- /assets/back-to-home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /assets/chevron_left.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/chevron_right.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/cross.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/height.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /assets/pokeball.svg: -------------------------------------------------------------------------------- 1 | 8 | 12 | 18 | -------------------------------------------------------------------------------- /assets/pokedex.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /assets/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/sorting.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/weight.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /detail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Pokemon Detail 7 | 8 | 9 | 10 | 11 |
12 |
13 |
14 |
15 | 16 | back to home 22 | 23 |
24 |

25 |
26 |
27 |
28 |

29 |
30 |
31 |
32 | 43 |
44 |
45 |

46 |

47 |
48 |

About

49 |
50 |
51 |
52 | weight 53 |

54 |
55 |

Weight

56 |
57 |
58 |
59 | height 60 |

61 |
62 |

Height

63 |
64 |
65 |
66 |

Move

67 |
68 |
69 |

70 |

Base Stats

71 |
72 |
73 |

HP

74 |

75 | 76 |
77 |
78 |

ATK

79 |

80 | 81 |
82 |
83 |

DEF

84 |

85 | 86 |
87 |
88 |

SATK

89 |

90 | 91 |
92 |
93 |
94 | pokedex 95 |
96 | 97 | 98 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Document 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 |
16 | pokeball 17 |

Pokedex

18 |
19 |
20 |
21 | search icon 26 | 32 | cross icon 38 |
39 |
40 |
41 | sorting 47 |
48 |
49 |

Sort by:

50 |
51 |
52 | 59 | 60 |
61 |
62 | 63 | 64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
Pokemon not found
76 |
77 |
78 | 79 | 80 | -------------------------------------------------------------------------------- /pokemon-detail.js: -------------------------------------------------------------------------------- 1 | let currentPokemonId = null; 2 | 3 | document.addEventListener("DOMContentLoaded", () => { 4 | const MAX_POKEMONS = 151; 5 | const pokemonID = new URLSearchParams(window.location.search).get("id"); 6 | const id = parseInt(pokemonID, 10); 7 | 8 | if (id < 1 || id > MAX_POKEMONS) { 9 | return (window.location.href = "./index.html"); 10 | } 11 | 12 | currentPokemonId = id; 13 | loadPokemon(id); 14 | }); 15 | 16 | async function loadPokemon(id) { 17 | try { 18 | const [pokemon, pokemonSpecies] = await Promise.all([ 19 | fetch(`https://pokeapi.co/api/v2/pokemon/${id}`).then((res) => 20 | res.json() 21 | ), 22 | fetch(`https://pokeapi.co/api/v2/pokemon-species/${id}`).then((res) => 23 | res.json() 24 | ), 25 | ]); 26 | 27 | const abilitiesWrapper = document.querySelector( 28 | ".pokemon-detail-wrap .pokemon-detail.move" 29 | ); 30 | abilitiesWrapper.innerHTML = ""; 31 | 32 | if (currentPokemonId === id) { 33 | displayPokemonDetails(pokemon); 34 | const flavorText = getEnglishFlavorText(pokemonSpecies); 35 | document.querySelector(".body3-fonts.pokemon-description").textContent = 36 | flavorText; 37 | 38 | const [leftArrow, rightArrow] = ["#leftArrow", "#rightArrow"].map((sel) => 39 | document.querySelector(sel) 40 | ); 41 | leftArrow.removeEventListener("click", navigatePokemon); 42 | rightArrow.removeEventListener("click", navigatePokemon); 43 | 44 | if (id !== 1) { 45 | leftArrow.addEventListener("click", () => { 46 | navigatePokemon(id - 1); 47 | }); 48 | } 49 | if (id !== 151) { 50 | rightArrow.addEventListener("click", () => { 51 | navigatePokemon(id + 1); 52 | }); 53 | } 54 | 55 | window.history.pushState({}, "", `./detail.html?id=${id}`); 56 | } 57 | 58 | return true; 59 | } catch (error) { 60 | console.error("An error occured while fetching Pokemon data:", error); 61 | return false; 62 | } 63 | } 64 | 65 | async function navigatePokemon(id) { 66 | currentPokemonId = id; 67 | await loadPokemon(id); 68 | } 69 | 70 | const typeColors = { 71 | normal: "#A8A878", 72 | fire: "#F08030", 73 | water: "#6890F0", 74 | electric: "#F8D030", 75 | grass: "#78C850", 76 | ice: "#98D8D8", 77 | fighting: "#C03028", 78 | poison: "#A040A0", 79 | ground: "#E0C068", 80 | flying: "#A890F0", 81 | psychic: "#F85888", 82 | bug: "#A8B820", 83 | rock: "#B8A038", 84 | ghost: "#705898", 85 | dragon: "#7038F8", 86 | dark: "#705848", 87 | steel: "#B8B8D0", 88 | dark: "#EE99AC", 89 | }; 90 | 91 | function setElementStyles(elements, cssProperty, value) { 92 | elements.forEach((element) => { 93 | element.style[cssProperty] = value; 94 | }); 95 | } 96 | 97 | function rgbaFromHex(hexColor) { 98 | return [ 99 | parseInt(hexColor.slice(1, 3), 16), 100 | parseInt(hexColor.slice(3, 5), 16), 101 | parseInt(hexColor.slice(5, 7), 16), 102 | ].join(", "); 103 | } 104 | 105 | function setTypeBackgroundColor(pokemon) { 106 | const mainType = pokemon.types[0].type.name; 107 | const color = typeColors[mainType]; 108 | 109 | if (!color) { 110 | console.warn(`Color not defined for type: ${mainType}`); 111 | return; 112 | } 113 | 114 | const detailMainElement = document.querySelector(".detail-main"); 115 | setElementStyles([detailMainElement], "backgroundColor", color); 116 | setElementStyles([detailMainElement], "borderColor", color); 117 | 118 | setElementStyles( 119 | document.querySelectorAll(".power-wrapper > p"), 120 | "backgroundColor", 121 | color 122 | ); 123 | 124 | setElementStyles( 125 | document.querySelectorAll(".stats-wrap p.stats"), 126 | "color", 127 | color 128 | ); 129 | 130 | setElementStyles( 131 | document.querySelectorAll(".stats-wrap .progress-bar"), 132 | "color", 133 | color 134 | ); 135 | 136 | const rgbaColor = rgbaFromHex(color); 137 | const styleTag = document.createElement("style"); 138 | styleTag.innerHTML = ` 139 | .stats-wrap .progress-bar::-webkit-progress-bar { 140 | background-color: rgba(${rgbaColor}, 0.5); 141 | } 142 | .stats-wrap .progress-bar::-webkit-progress-value { 143 | background-color: ${color}; 144 | } 145 | `; 146 | document.head.appendChild(styleTag); 147 | } 148 | 149 | function capitalizeFirstLetter(string) { 150 | return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); 151 | } 152 | 153 | function createAndAppendElement(parent, tag, options = {}) { 154 | const element = document.createElement(tag); 155 | Object.keys(options).forEach((key) => { 156 | element[key] = options[key]; 157 | }); 158 | parent.appendChild(element); 159 | return element; 160 | } 161 | 162 | function displayPokemonDetails(pokemon) { 163 | const { name, id, types, weight, height, abilities, stats } = pokemon; 164 | const capitalizePokemonName = capitalizeFirstLetter(name); 165 | 166 | document.querySelector("title").textContent = capitalizePokemonName; 167 | 168 | const detailMainElement = document.querySelector(".detail-main"); 169 | detailMainElement.classList.add(name.toLowerCase()); 170 | 171 | document.querySelector(".name-wrap .name").textContent = 172 | capitalizePokemonName; 173 | 174 | document.querySelector( 175 | ".pokemon-id-wrap .body2-fonts" 176 | ).textContent = `#${String(id).padStart(3, "0")}`; 177 | 178 | const imageElement = document.querySelector(".detail-img-wrapper img"); 179 | imageElement.src = `https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/dream-world/${id}.svg`; 180 | imageElement.alt = name; 181 | 182 | const typeWrapper = document.querySelector(".power-wrapper"); 183 | typeWrapper.innerHTML = ""; 184 | types.forEach(({ type }) => { 185 | createAndAppendElement(typeWrapper, "p", { 186 | className: `body3-fonts type ${type.name}`, 187 | textContent: type.name, 188 | }); 189 | }); 190 | 191 | document.querySelector( 192 | ".pokemon-detail-wrap .pokemon-detail p.body3-fonts.weight" 193 | ).textContent = `${weight / 10}kg`; 194 | document.querySelector( 195 | ".pokemon-detail-wrap .pokemon-detail p.body3-fonts.height" 196 | ).textContent = `${height / 10}m`; 197 | 198 | const abilitiesWrapper = document.querySelector( 199 | ".pokemon-detail-wrap .pokemon-detail.move" 200 | ); 201 | abilities.forEach(({ ability }) => { 202 | createAndAppendElement(abilitiesWrapper, "p", { 203 | className: "body3-fonts", 204 | textContent: ability.name, 205 | }); 206 | }); 207 | 208 | const statsWrapper = document.querySelector(".stats-wrapper"); 209 | statsWrapper.innerHTML = ""; 210 | 211 | const statNameMapping = { 212 | hp: "HP", 213 | attack: "ATK", 214 | defense: "DEF", 215 | "special-attack": "SATK", 216 | "special-defense": "SDEF", 217 | speed: "SPD", 218 | }; 219 | 220 | stats.forEach(({ stat, base_stat }) => { 221 | const statDiv = document.createElement("div"); 222 | statDiv.className = "stats-wrap"; 223 | statsWrapper.appendChild(statDiv); 224 | 225 | createAndAppendElement(statDiv, "p", { 226 | className: "body3-fonts stats", 227 | textContent: statNameMapping[stat.name], 228 | }); 229 | 230 | createAndAppendElement(statDiv, "p", { 231 | className: "body3-fonts", 232 | textContent: String(base_stat).padStart(3, "0"), 233 | }); 234 | 235 | createAndAppendElement(statDiv, "progress", { 236 | className: "progress-bar", 237 | value: base_stat, 238 | max: 100, 239 | }); 240 | }); 241 | 242 | setTypeBackgroundColor(pokemon); 243 | } 244 | 245 | function getEnglishFlavorText(pokemonSpecies) { 246 | for (let entry of pokemonSpecies.flavor_text_entries) { 247 | if (entry.language.name === "en") { 248 | let flavor = entry.flavor_text.replace(/\f/g, " "); 249 | return flavor; 250 | } 251 | } 252 | return ""; 253 | } 254 | -------------------------------------------------------------------------------- /pokemon.js: -------------------------------------------------------------------------------- 1 | const MAX_POKEMON = 151; 2 | const listWrapper = document.querySelector(".list-wrapper"); 3 | const searchInput = document.querySelector("#search-input"); 4 | const numberFilter = document.querySelector("#number"); 5 | const nameFilter = document.querySelector("#name"); 6 | const notFoundMessage = document.querySelector("#not-found-message"); 7 | 8 | let allPokemons = []; 9 | 10 | fetch(`https://pokeapi.co/api/v2/pokemon?limit=${MAX_POKEMON}`) 11 | .then((response) => response.json()) 12 | .then((data) => { 13 | allPokemons = data.results; 14 | displayPokemons(allPokemons); 15 | }); 16 | 17 | async function fetchPokemonDataBeforeRedirect(id) { 18 | try { 19 | const [pokemon, pokemonSpecies] = await Promise.all([ 20 | fetch(`https://pokeapi.co/api/v2/pokemon/${id}`).then((res) => 21 | res.json() 22 | ), 23 | fetch(`https://pokeapi.co/api/v2/pokemon-species/${id}`).then((res) => 24 | res.json() 25 | ), 26 | ]); 27 | return true; 28 | } catch (error) { 29 | console.error("Failed to fetch Pokemon data before redirect"); 30 | } 31 | } 32 | 33 | function displayPokemons(pokemon) { 34 | listWrapper.innerHTML = ""; 35 | 36 | pokemon.forEach((pokemon) => { 37 | const pokemonID = pokemon.url.split("/")[6]; 38 | const listItem = document.createElement("div"); 39 | listItem.className = "list-item"; 40 | listItem.innerHTML = ` 41 |
42 |

#${pokemonID}

43 |
44 |
45 | ${pokemon.name} 46 |
47 |
48 |

#${pokemon.name}

49 |
50 | `; 51 | 52 | listItem.addEventListener("click", async () => { 53 | const success = await fetchPokemonDataBeforeRedirect(pokemonID); 54 | if (success) { 55 | window.location.href = `./detail.html?id=${pokemonID}`; 56 | } 57 | }); 58 | 59 | listWrapper.appendChild(listItem); 60 | }); 61 | } 62 | 63 | searchInput.addEventListener("keyup", handleSearch); 64 | 65 | function handleSearch() { 66 | const searchTerm = searchInput.value.toLowerCase(); 67 | let filteredPokemons; 68 | 69 | if (numberFilter.checked) { 70 | filteredPokemons = allPokemons.filter((pokemon) => { 71 | const pokemonID = pokemon.url.split("/")[6]; 72 | return pokemonID.startsWith(searchTerm); 73 | }); 74 | } else if (nameFilter.checked) { 75 | filteredPokemons = allPokemons.filter((pokemon) => 76 | pokemon.name.toLowerCase().startsWith(searchTerm) 77 | ); 78 | } else { 79 | filteredPokemons = allPokemons; 80 | } 81 | 82 | displayPokemons(filteredPokemons); 83 | 84 | if (filteredPokemons.length === 0) { 85 | notFoundMessage.style.display = "block"; 86 | } else { 87 | notFoundMessage.style.display = "none"; 88 | } 89 | } 90 | 91 | const closeButton = document.querySelector(".search-close-icon"); 92 | closeButton.addEventListener("click", clearSearch); 93 | 94 | function clearSearch() { 95 | searchInput.value = ""; 96 | displayPokemons(allPokemons); 97 | notFoundMessage.style.display = "none"; 98 | } 99 | -------------------------------------------------------------------------------- /search.js: -------------------------------------------------------------------------------- 1 | const inputElement = document.querySelector("#search-input"); 2 | const search_icon = document.querySelector("#search-close-icon"); 3 | const sort_wrapper = document.querySelector(".sort-wrapper"); 4 | 5 | inputElement.addEventListener("input", () => { 6 | handleInputChange(inputElement); 7 | }); 8 | search_icon.addEventListener("click", handleSearchCloseOnClick); 9 | sort_wrapper.addEventListener("click", handleSortIconOnClick); 10 | 11 | function handleInputChange(inputElement) { 12 | const inputValue = inputElement.value; 13 | 14 | if (inputValue !== "") { 15 | document 16 | .querySelector("#search-close-icon") 17 | .classList.add("search-close-icon-visible"); 18 | } else { 19 | document 20 | .querySelector("#search-close-icon") 21 | .classList.remove("search-close-icon-visible"); 22 | } 23 | } 24 | 25 | function handleSearchCloseOnClick() { 26 | document.querySelector("#search-input").value = ""; 27 | document 28 | .querySelector("#search-close-icon") 29 | .classList.remove("search-close-icon-visible"); 30 | } 31 | 32 | function handleSortIconOnClick() { 33 | document 34 | .querySelector(".filter-wrapper") 35 | .classList.toggle("filter-wrapper-open"); 36 | document.querySelector("body").classList.toggle("filter-wrapper-overlay"); 37 | } 38 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --identity-primary: #dc0a2d; 3 | 4 | --grayscale-dark: #212121; 5 | --grayscale-medium: #666666; 6 | --grayscale-light: #e0e0e0; 7 | --grayscale-background: #efefef; 8 | --grayscale-white: #ffffff; 9 | 10 | --headline-font-size: 24px; 11 | --body1-font-size: 14px; 12 | --body2-font-size: 12px; 13 | --body3-font-size: 10px; 14 | --subtitle1-font-size: 14px; 15 | --subtitle2-font-size: 12px; 16 | --subtitle3-font-size: 10px; 17 | --caption-font-size: 8px; 18 | 19 | --headline-line-height: 32px; 20 | --common-line-height: 16px; 21 | --caption-line-height: 12px; 22 | 23 | --font-weight-regular: 400; 24 | --font-weight-bold: 700; 25 | 26 | --drop-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.2); 27 | --drop-shadow-hover: 0px 3px 12px 3px rgba(0, 0, 0, 0.2); 28 | --drop-shadow-inner: 0px 1px 3px 1px rgba(0, 0, 0, 0.25) inset; 29 | } 30 | 31 | h2, 32 | h3, 33 | h4, 34 | .body1-fonts, 35 | .body2-fonts, 36 | .body3-fonts { 37 | line-height: var(--common-line-height); 38 | } 39 | 40 | h1 { 41 | font-size: var(--headline-font-size); 42 | line-height: var(--headline-line-height); 43 | } 44 | 45 | h2 { 46 | font-size: var(--subtitle1-font-size); 47 | } 48 | 49 | h3 { 50 | font-size: var(--subtitle2-font-size); 51 | } 52 | 53 | h4 { 54 | font-size: var(--subtitle3-font-size); 55 | } 56 | 57 | .body1-fonts { 58 | font-size: var(--body1-font-size); 59 | } 60 | 61 | .body2-fonts { 62 | font-size: var(--body2-font-size); 63 | } 64 | 65 | .body3-fonts { 66 | font-size: var(--body3-font-size); 67 | } 68 | 69 | .caption-fonts { 70 | font-size: var(--caption-font-size); 71 | line-height: var(--caption-line-height); 72 | } 73 | 74 | input:focus-visible { 75 | outline: 0; 76 | } 77 | 78 | .featured-img a.arrow.hidden { 79 | display: none; 80 | } 81 | 82 | body { 83 | margin: 0; 84 | height: 100vh; 85 | width: 100vw; 86 | box-sizing: border-box; 87 | font-family: "Poppins", sans-serif; 88 | } 89 | 90 | .main { 91 | margin: 0; 92 | padding: 0; 93 | background-color: var(--identity-primary); 94 | height: 100vh; 95 | width: 100vw; 96 | display: flex; 97 | flex-direction: column; 98 | align-items: center; 99 | gap: 1rem; 100 | } 101 | 102 | .header.home { 103 | width: 90%; 104 | } 105 | 106 | .container { 107 | width: 100%; 108 | margin: 0; 109 | } 110 | 111 | .logo-wrapper { 112 | display: flex; 113 | align-items: center; 114 | } 115 | 116 | .logo-wrapper > h1 { 117 | color: var(--grayscale-white); 118 | } 119 | 120 | .logo-wrapper > img { 121 | margin-right: 16px; 122 | } 123 | 124 | .search-wrapper, 125 | .search-wrap { 126 | display: flex; 127 | align-items: center; 128 | width: 100%; 129 | gap: 16px; 130 | } 131 | 132 | .search-wrap { 133 | position: relative; 134 | background-color: var(--grayscale-white); 135 | border-radius: 16px; 136 | box-shadow: var(--drop-shadow-inner); 137 | height: 32px; 138 | gap: 8px; 139 | } 140 | 141 | .search-icon { 142 | margin-left: 16px; 143 | } 144 | 145 | .search-wrap svg path { 146 | fill: var(--identity-primary); 147 | } 148 | 149 | .search-wrap > input { 150 | width: 60%; 151 | border: none; 152 | } 153 | 154 | .sort-wrapper { 155 | position: relative; 156 | } 157 | 158 | .sort-wrap { 159 | background-color: var(--grayscale-white); 160 | border-radius: 100%; 161 | min-width: 2rem; 162 | min-height: 2rem; 163 | box-shadow: var(--drop-shadow-inner); 164 | display: flex; 165 | align-items: center; 166 | justify-content: center; 167 | position: relative; 168 | } 169 | 170 | .search-close-icon { 171 | position: absolute; 172 | right: 1rem; 173 | display: none; 174 | cursor: pointer; 175 | } 176 | 177 | .search-close-icon-visible { 178 | display: block; 179 | } 180 | 181 | .filter-wrapper { 182 | position: absolute; 183 | background: var(--identity-primary); 184 | border: 4px solid var(--identity-primary); 185 | border-top: 0; 186 | border-radius: 12px; 187 | padding: 0px 4px 4px 4px; 188 | right: 0px; 189 | box-shadow: var(--drop-shadow-hover); 190 | min-width: 113px; 191 | top: 40px; 192 | display: none; 193 | z-index: 5000; 194 | } 195 | 196 | .filter-wrapper-open { 197 | display: block; 198 | } 199 | 200 | .filter-wrapper-overlay .main::before { 201 | background-color: rgba(0, 0, 0, 0.4); 202 | width: 100%; 203 | height: 100%; 204 | position: absolute; 205 | left: 0; 206 | right: 0; 207 | top: 0; 208 | bottom: 0; 209 | z-index: 2; 210 | } 211 | 212 | .filter-wrapper > .body2-fonts { 213 | color: var(--grayscale-white); 214 | font-weight: var(--font-weight-bold); 215 | padding: 16px 20px; 216 | } 217 | 218 | .filter-wrap { 219 | background-color: var(--grayscale-white); 220 | box-shadow: var(--drop-shadow-inner); 221 | padding: 16px 20px; 222 | border-radius: 8px; 223 | } 224 | 225 | .filter-wrap > div { 226 | display: flex; 227 | align-items: center; 228 | gap: 8px; 229 | margin-bottom: 16px; 230 | } 231 | 232 | .filter-wrap > div:last-child { 233 | margin-bottom: 0px; 234 | } 235 | 236 | .filter-wrap input { 237 | accent-color: var(--identity-primary); 238 | } 239 | 240 | .pokemon-list { 241 | background-color: var(--grayscale-white); 242 | box-shadow: var(--drop-shadow-inner); 243 | border-radius: 0.75rem; 244 | min-height: calc(85.5% - 1rem); 245 | width: calc(100% - 1rem); 246 | max-height: 100px; 247 | overflow-y: auto; 248 | } 249 | 250 | .list-wrapper { 251 | margin: 1rem 0; 252 | display: flex; 253 | align-items: center; 254 | justify-content: center; 255 | flex-wrap: wrap; 256 | gap: 0.75rem; 257 | } 258 | 259 | .list-item { 260 | border-radius: 8px; 261 | box-shadow: var(--drop-shadow); 262 | background-color: var(--grayscale-white); 263 | width: 8.85rem; 264 | height: 8.85rem; 265 | text-align: center; 266 | text-decoration: none; 267 | cursor: pointer; 268 | } 269 | 270 | .list-item .number-wrap { 271 | min-height: 16px; 272 | text-align: right; 273 | padding: 0 8px; 274 | color: var(--grayscale-medium); 275 | } 276 | 277 | .list-item .name-wrap { 278 | border-radius: 7px; 279 | background-color: var(--grayscale-background); 280 | padding: 24px 8px 4px 8px; 281 | color: var(--grayscale-dark); 282 | margin-top: -18px; 283 | } 284 | 285 | .list-item .img-wrap { 286 | width: 72px; 287 | height: 72px; 288 | margin: auto; 289 | } 290 | 291 | .list-item .img-wrap img { 292 | width: 100%; 293 | height: 100%; 294 | } 295 | 296 | /* detail page */ 297 | 298 | .detail-main .header { 299 | padding: 20px 20px 24px 20px; 300 | position: relative; 301 | z-index: 2; 302 | } 303 | 304 | .detail-main .header-wrapper { 305 | display: flex; 306 | align-items: center; 307 | justify-content: space-between; 308 | column-gap: 15px; 309 | } 310 | 311 | .detail-main .header-wrap { 312 | display: flex; 313 | align-items: center; 314 | column-gap: 8px; 315 | } 316 | 317 | .detail-main .back-btn-wrap { 318 | max-height: 32px; 319 | } 320 | 321 | .detail-main .back-btn-wrap path, 322 | .detail-main .header-wrapper p, 323 | .detail-main .header-wrapper h1 { 324 | fill: var(--grayscale-white); 325 | color: var(--grayscale-white); 326 | } 327 | 328 | .detail-main .pokemon-id-wrap p { 329 | font-weight: var(--font-weight-bold); 330 | } 331 | 332 | .detail-img-wrapper { 333 | width: 200px; 334 | height: 200px; 335 | margin: auto; 336 | position: relative; 337 | z-index: 3; 338 | } 339 | 340 | .detail-img-wrapper img { 341 | width: 100%; 342 | height: 100%; 343 | } 344 | 345 | .detail-card-detail-wrapper { 346 | border-radius: 8px; 347 | background-color: var(--grayscale-white); 348 | box-shadow: var(--drop-shadow-inner); 349 | padding: 56px 20px 20px 20px; 350 | margin-top: -50px; 351 | display: flex; 352 | flex-direction: column; 353 | position: relative; 354 | z-index: 2; 355 | } 356 | 357 | .power-wrapper { 358 | display: flex; 359 | justify-content: center; 360 | align-items: center; 361 | flex-wrap: wrap; 362 | gap: 16px; 363 | } 364 | 365 | .power-wrapper > p { 366 | border-radius: 10px; 367 | padding: 2px 8px; 368 | font-weight: var(--font-weight-bold); 369 | color: var(--grayscale-white); 370 | text-transform: capitalize; 371 | background-color: #74cb48; 372 | } 373 | 374 | .pokemon-detail.move p { 375 | text-transform: capitalize; 376 | word-break: break-all; 377 | } 378 | 379 | .list-item .name-wrap p { 380 | text-transform: capitalize; 381 | } 382 | 383 | .detail-card-detail-wrapper .about-text { 384 | font-weight: var(--font-weight-bold); 385 | text-align: center; 386 | } 387 | 388 | .pokemon-detail-wrapper { 389 | display: flex; 390 | align-items: flex-end; 391 | } 392 | 393 | .pokemon-detail-wrapper .pokemon-detail-wrap { 394 | flex: 1; 395 | text-align: center; 396 | position: relative; 397 | } 398 | 399 | .pokemon-detail-wrap:before { 400 | content: ""; 401 | background-color: var(--grayscale-light); 402 | width: 1px; 403 | height: 100%; 404 | position: absolute; 405 | right: 0; 406 | top: 0; 407 | bottom: 0; 408 | margin: auto; 409 | } 410 | 411 | .pokemon-detail-wrap:last-child::before { 412 | display: none; 413 | } 414 | 415 | .pokemon-detail { 416 | display: flex; 417 | justify-content: center; 418 | align-items: center; 419 | padding: 8px 20px; 420 | gap: 8px; 421 | } 422 | 423 | .pokemon-detail-wrapper { 424 | min-height: 76px; 425 | } 426 | 427 | .pokemon-detail.move { 428 | flex-direction: column; 429 | gap: 0; 430 | align-items: center; 431 | padding: 8px 5px; 432 | } 433 | 434 | .pokemon-detail-wrap > .caption-fonts { 435 | color: var(--grayscale-medium); 436 | } 437 | 438 | .pokemon-detail-wrap .straighten { 439 | transform: rotate(90deg); 440 | } 441 | 442 | .detail-card-detail-wrapper .pokemon-description { 443 | color: var(--grayscale-dark); 444 | text-align: center; 445 | } 446 | 447 | .stats-wrap { 448 | display: flex; 449 | align-items: center; 450 | } 451 | 452 | .stats-wrap p { 453 | color: var(--grayscale-dark); 454 | margin-right: 8px; 455 | min-width: 19px; 456 | } 457 | 458 | .stats-wrap p.stats { 459 | text-align: right; 460 | padding-right: 8px; 461 | min-width: 35px; 462 | border-right: 1px solid var(--grayscale-light); 463 | font-weight: var(--font-weight-bold); 464 | } 465 | 466 | .stats-wrap .progress-bar { 467 | flex: 1; 468 | border-radius: 4px; 469 | height: 4px; 470 | } 471 | 472 | .stats-wrap .progress-bar::-webkit-progress-bar { 473 | border-radius: 4px; 474 | } 475 | 476 | .stats-wrap .progress-bar::-webkit-progress-value { 477 | border-radius: 4px; 478 | } 479 | 480 | .detail-bg { 481 | position: absolute; 482 | z-index: 1; 483 | right: 8px; 484 | top: 8px; 485 | opacity: 0.1; 486 | } 487 | 488 | .detail-bg path { 489 | fill: var(--grayscale-white); 490 | } 491 | 492 | div#not-found-message { 493 | display: none; 494 | position: absolute; 495 | left: 50%; 496 | top: 50%; 497 | transform: translate(-50%, -50%); 498 | font-size: 20px; 499 | font-weight: 600; 500 | } 501 | 502 | .arrow img { 503 | -webkit-filter: brightness(0) grayscale(1) invert(1); 504 | filter: brightness(0) grayscale(1) invert(1); 505 | width: 28px; 506 | } 507 | 508 | .featured-img { 509 | position: relative; 510 | } 511 | 512 | .featured-img a.arrow { 513 | display: inline-block; 514 | position: absolute; 515 | top: 50%; 516 | transform: translateY(-50%); 517 | z-index: 999; 518 | } 519 | 520 | .featured-img a.arrow.left-arrow { 521 | left: -2rem; 522 | } 523 | 524 | .featured-img a.arrow.right-arrow { 525 | right: -2rem; 526 | } 527 | 528 | .detail-main.main { 529 | height: max-content; 530 | border-color: transparent; 531 | background-color: transparent; 532 | } 533 | --------------------------------------------------------------------------------