diff --git a/content.js b/content.js index 06bc303..ee083fe 100644 --- a/content.js +++ b/content.js @@ -146,7 +146,7 @@ function createTypeEffectivenessWrapper(effectiveness, types) { typeEffectivenessWrapper.appendChild(block) } const typeIcon = document.createElement('div'); - typeIcon.style.backgroundImage = `url('https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/types/generation-viii/sword-shield/${Types[type]}.png')`; + typeIcon.style.backgroundImage = `url('${chrome.runtime.getURL(`/type-icons/type-icon${Types[type]}.png`)}')`; typeIcon.className = 'type-icon'; block.appendChild(typeIcon) counter += 1; @@ -222,7 +222,7 @@ function changePage(click) { } else { currentAllyPage = alliesPokemon.length - 1 } - } + } } else if (direction === 'down') { if (divId === 'enemies') { if ((currentEnemyPage + 1) < enemiesPokemon.length) { @@ -273,11 +273,11 @@ function createPokemonCardDiv(divId, pokemon) { const extraInfoRow = document.createElement('div'); extraInfoRow.classList.add('text-base') extraInfoRow.textContent = `Ability: ${pokemon.ability} - Nature: ${pokemon.nature}`; - + const ivsRow = document.createElement('div'); ivsRow.classList.add('text-base'); ivsRow.textContent = `HP: ${pokemon.ivs[Stat["HP"]]}, ATK: ${pokemon.ivs[Stat["ATK"]]}, DEF: ${pokemon.ivs[Stat["DEF"]]}, SPE: ${pokemon.ivs[Stat["SPD"]]}, SPD: ${pokemon.ivs[Stat["SPDEF"]]}, SPA: ${pokemon.ivs[Stat["SPATK"]]}`; - + let weatherRow = undefined if (weather.type && weather.turnsLeft) { weatherRow = document.createElement('div'); @@ -351,4 +351,4 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { createCardsDiv(divId) sendResponse({ success: true }); } -}); \ No newline at end of file +}); diff --git a/manifest_chrome.json b/manifest_chrome.json index 0253c03..3a46955 100644 --- a/manifest_chrome.json +++ b/manifest_chrome.json @@ -27,5 +27,5 @@ "css": ["styles.css"] } ], - "web_accessible_resources": ["inject.js", "injected.js"] -} \ No newline at end of file + "web_accessible_resources": ["inject.js", "injected.js", "type-icons/*.png"] +} diff --git a/manifest_firefox.json b/manifest_firefox.json index 68fa134..8ec39f7 100644 --- a/manifest_firefox.json +++ b/manifest_firefox.json @@ -32,5 +32,5 @@ "css": ["styles.css"] } ], - "web_accessible_resources": ["inject.js", "injected.js"] -} \ No newline at end of file + "web_accessible_resources": ["inject.js", "injected.js", "type-icons/*.png"] +} diff --git a/styles.css b/styles.css index 6e8db56..6ee7a5e 100644 --- a/styles.css +++ b/styles.css @@ -51,11 +51,11 @@ .type-icon { width: 30px; height: 30px; - background-size: cover; + background-size: 130% 130%; background-repeat: no-repeat; - background-position: left; - background-position-x: -1.15px; + background-position: center; border-radius: 50%; + image-rendering: pixelated; margin: 0 5px; } @@ -130,14 +130,14 @@ width: 80px; -webkit-appearance: none; } - + input[type='range']::-webkit-slider-runnable-track { height: 10px; -webkit-appearance: none; color: #13bba4; margin-top: -1px; } - + input[type='range']::-webkit-slider-thumb { width: 10px; -webkit-appearance: none; @@ -151,7 +151,7 @@ input[type="range"]::-moz-range-progress { background-color: #b3462c; } -input[type="range"]::-moz-range-track { +input[type="range"]::-moz-range-track { background-color: #fff; } input[type="range"] { @@ -160,4 +160,5 @@ input[type="range"] { .slider-wrapper { display: flex; -} \ No newline at end of file +} + diff --git a/type-icons/type-icon1.png b/type-icons/type-icon1.png new file mode 100644 index 0000000..11f68c5 Binary files /dev/null and b/type-icons/type-icon1.png differ diff --git a/type-icons/type-icon10.png b/type-icons/type-icon10.png new file mode 100644 index 0000000..775c605 Binary files /dev/null and b/type-icons/type-icon10.png differ diff --git a/type-icons/type-icon11.png b/type-icons/type-icon11.png new file mode 100644 index 0000000..4f6f92f Binary files /dev/null and b/type-icons/type-icon11.png differ diff --git a/type-icons/type-icon12.png b/type-icons/type-icon12.png new file mode 100644 index 0000000..d7d2daa Binary files /dev/null and b/type-icons/type-icon12.png differ diff --git a/type-icons/type-icon13.png b/type-icons/type-icon13.png new file mode 100644 index 0000000..ba995df Binary files /dev/null and b/type-icons/type-icon13.png differ diff --git a/type-icons/type-icon14.png b/type-icons/type-icon14.png new file mode 100644 index 0000000..ec9e66b Binary files /dev/null and b/type-icons/type-icon14.png differ diff --git a/type-icons/type-icon15.png b/type-icons/type-icon15.png new file mode 100644 index 0000000..0471116 Binary files /dev/null and b/type-icons/type-icon15.png differ diff --git a/type-icons/type-icon16.png b/type-icons/type-icon16.png new file mode 100644 index 0000000..e46e1cb Binary files /dev/null and b/type-icons/type-icon16.png differ diff --git a/type-icons/type-icon17.png b/type-icons/type-icon17.png new file mode 100644 index 0000000..d5faf17 Binary files /dev/null and b/type-icons/type-icon17.png differ diff --git a/type-icons/type-icon18.png b/type-icons/type-icon18.png new file mode 100644 index 0000000..b9cca95 Binary files /dev/null and b/type-icons/type-icon18.png differ diff --git a/type-icons/type-icon2.png b/type-icons/type-icon2.png new file mode 100644 index 0000000..7836dc2 Binary files /dev/null and b/type-icons/type-icon2.png differ diff --git a/type-icons/type-icon3.png b/type-icons/type-icon3.png new file mode 100644 index 0000000..162f72a Binary files /dev/null and b/type-icons/type-icon3.png differ diff --git a/type-icons/type-icon4.png b/type-icons/type-icon4.png new file mode 100644 index 0000000..b86d1ea Binary files /dev/null and b/type-icons/type-icon4.png differ diff --git a/type-icons/type-icon5.png b/type-icons/type-icon5.png new file mode 100644 index 0000000..8ac4464 Binary files /dev/null and b/type-icons/type-icon5.png differ diff --git a/type-icons/type-icon6.png b/type-icons/type-icon6.png new file mode 100644 index 0000000..c359f93 Binary files /dev/null and b/type-icons/type-icon6.png differ diff --git a/type-icons/type-icon7.png b/type-icons/type-icon7.png new file mode 100644 index 0000000..73c6248 Binary files /dev/null and b/type-icons/type-icon7.png differ diff --git a/type-icons/type-icon8.png b/type-icons/type-icon8.png new file mode 100644 index 0000000..f3795ca Binary files /dev/null and b/type-icons/type-icon8.png differ diff --git a/type-icons/type-icon9.png b/type-icons/type-icon9.png new file mode 100644 index 0000000..6ce6abc Binary files /dev/null and b/type-icons/type-icon9.png differ