Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -222,7 +222,7 @@ function changePage(click) {
} else {
currentAllyPage = alliesPokemon.length - 1
}
}
}
} else if (direction === 'down') {
if (divId === 'enemies') {
if ((currentEnemyPage + 1) < enemiesPokemon.length) {
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -351,4 +351,4 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
createCardsDiv(divId)
sendResponse({ success: true });
}
});
});
4 changes: 2 additions & 2 deletions manifest_chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
"css": ["styles.css"]
}
],
"web_accessible_resources": ["inject.js", "injected.js"]
}
"web_accessible_resources": ["inject.js", "injected.js", "type-icons/*.png"]
}
4 changes: 2 additions & 2 deletions manifest_firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
"css": ["styles.css"]
}
],
"web_accessible_resources": ["inject.js", "injected.js"]
}
"web_accessible_resources": ["inject.js", "injected.js", "type-icons/*.png"]
}
15 changes: 8 additions & 7 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand All @@ -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"] {
Expand All @@ -160,4 +160,5 @@ input[type="range"] {

.slider-wrapper {
display: flex;
}
}

Binary file added type-icons/type-icon1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added type-icons/type-icon9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.