From db53cf0f03afa5b6a83a5c07efe8c576baad884f Mon Sep 17 00:00:00 2001 From: Gautham Sajith Date: Sat, 11 May 2024 14:56:48 -0400 Subject: [PATCH] Update type icons to match Pokerogue sprites --- content.js | 10 +++++----- manifest_chrome.json | 4 ++-- manifest_firefox.json | 4 ++-- styles.css | 15 ++++++++------- type-icons/type-icon1.png | Bin 0 -> 271 bytes type-icons/type-icon10.png | Bin 0 -> 268 bytes type-icons/type-icon11.png | Bin 0 -> 244 bytes type-icons/type-icon12.png | Bin 0 -> 244 bytes type-icons/type-icon13.png | Bin 0 -> 251 bytes type-icons/type-icon14.png | Bin 0 -> 292 bytes type-icons/type-icon15.png | Bin 0 -> 256 bytes type-icons/type-icon16.png | Bin 0 -> 287 bytes type-icons/type-icon17.png | Bin 0 -> 261 bytes type-icons/type-icon18.png | Bin 0 -> 277 bytes type-icons/type-icon2.png | Bin 0 -> 244 bytes type-icons/type-icon3.png | Bin 0 -> 261 bytes type-icons/type-icon4.png | Bin 0 -> 282 bytes type-icons/type-icon5.png | Bin 0 -> 232 bytes type-icons/type-icon6.png | Bin 0 -> 273 bytes type-icons/type-icon7.png | Bin 0 -> 271 bytes type-icons/type-icon8.png | Bin 0 -> 265 bytes type-icons/type-icon9.png | Bin 0 -> 282 bytes 22 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 type-icons/type-icon1.png create mode 100644 type-icons/type-icon10.png create mode 100644 type-icons/type-icon11.png create mode 100644 type-icons/type-icon12.png create mode 100644 type-icons/type-icon13.png create mode 100644 type-icons/type-icon14.png create mode 100644 type-icons/type-icon15.png create mode 100644 type-icons/type-icon16.png create mode 100644 type-icons/type-icon17.png create mode 100644 type-icons/type-icon18.png create mode 100644 type-icons/type-icon2.png create mode 100644 type-icons/type-icon3.png create mode 100644 type-icons/type-icon4.png create mode 100644 type-icons/type-icon5.png create mode 100644 type-icons/type-icon6.png create mode 100644 type-icons/type-icon7.png create mode 100644 type-icons/type-icon8.png create mode 100644 type-icons/type-icon9.png 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 0000000000000000000000000000000000000000..11f68c57df8782d4f3ff7e72f38d64d6b70f7a1a GIT binary patch literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#C7v#hAr*{oLkzhZ40w7TIkTvTi`ITf3;ZF@^8cs<30n_pu81hzeNlHw|sBRugM;UF#Pccu;k7^wE zdcd2(T4Gl4dkyOj-k6r{YgWeY&kt7GBx~|fMS0Wx#`CiouXUcE z&0rB7u-e7pEZ-3=!GO)o8@cWsENhE@b+P^U+-8?+3%bSBHRfIpTKQqOg;A)>JI3pV lqWZ!s8Kr*azhc-cH|?Cl^}CxRoPmyF@O1TaS?83{1OP?5b7M&s&~NR500^5~|c-7IogT%ZVX(OZ@B~iy|9l-+OA{ApLjdJl3S%KU4QA l@GQ_j&c9l|kLf2f|BQ0wgRhJCS_2)$;OXk;vd$@?2>_KjSG@oL literal 0 HcmV?d00001 diff --git a/type-icons/type-icon13.png b/type-icons/type-icon13.png new file mode 100644 index 0000000000000000000000000000000000000000..ba995df244e1d822debdae32a0085882287f2984 GIT binary patch literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#37#&FAr*{oryk^OP~dUxE@TrgVA{L0Rk*T1 zY59fO(mNWw6RHeW_Fj-uFl?-6xpdsy+o0^Nj*1U!XE1{#L)J$ZW2P;ai{H**JjZG> zk@p@~VS)fdv-vZ}%^3|0+&kG1zq{wmy-JH$h%O@PNVyu?1e?A*y@=B rJiZt{6_AOJ|Lp1Wvw-Wt{|4@3%jA3xtO$AsbQ^=GtDnm{r-UW|o)c6> literal 0 HcmV?d00001 diff --git a/type-icons/type-icon14.png b/type-icons/type-icon14.png new file mode 100644 index 0000000000000000000000000000000000000000..ec9e66b7126f467dbc944aaf6c58e4b741458913 GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#ot`d^Ar*{oLk+o_9R%)hE4r?-QIq#LHKo#f z))U5+HQh^>>VMFWioBr_%(I4lU3IHM1@oc8<<{1lizRLyFQ39&IH`9cC!a&Xw>>45 zcc1>MJpb+2qA3fr!uIoKe}546e{J&1dG??0gfyJvyt^^1W$V%-a~Qi9STLA|9NBwg zmkJY;>>`0T2b#AYuQzXG6V3Rovm?l5friKn$qTDgXJ{rV@>%#zQD60LMpf~AABH31 kx~)1-peGnSUHx3vIVCg!0O!JOA^-pY literal 0 HcmV?d00001 diff --git a/type-icons/type-icon15.png b/type-icons/type-icon15.png new file mode 100644 index 0000000000000000000000000000000000000000..0471116b042ace5434b2024292ca1f79e9a15acb GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#sh%#5Ar*{orz-L_81T4S%WyS17P99ZuyiQa zGWq_1rGTABf`yAy({p;G#M?=#!oRa#Px}8W+VHB+YgW0b4e729EPG5tSUrxiP1q@N zh^fX`bwWYeg>%w7Jfp0Yj`B6dDXbUn wXtH+gGQU5UF(qT!f_FQA2Yfu-+3zopr0N_hk2LJ#7 literal 0 HcmV?d00001 diff --git a/type-icons/type-icon16.png b/type-icons/type-icon16.png new file mode 100644 index 0000000000000000000000000000000000000000..e46e1cbda44a89680dc2b29b5b5aa0c5f882de8d GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#EuJopAr*{or)mo|8%VTF_VW$ReIIz&`3sBa zTivLe$q5#W?GD9!8#GkTbfp^Y*|bL_l9lJ?`+C)l_sipE%a$5hYcudMSZLedl^6e9 z6MOr+ik|PZuv0!rhE1mkKhw5{%M|Vp=bo dFkD;B=$qin8G3EP0igRCJYD@<);T3K0RZ*;W|;s0 literal 0 HcmV?d00001 diff --git a/type-icons/type-icon17.png b/type-icons/type-icon17.png new file mode 100644 index 0000000000000000000000000000000000000000..d5faf17bfe3252bf350411928782a22ec54bfd41 GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#S)MMAAr*{orz-L_81T4qKlI5EX<}CRkil~O zz=DesHf*iWf+py*osPIRDfQr+mCJJf-M^IP{cD+(rh+D`nv_d(`yP$88@DqaX{%hC zeE*$H(i0UoP4&3#vbvXltWs>3N`GY1z`%Z8c~)a(P^mGeBxmD-kdWv1O}FxX&+fm> z@cM<2gKvDibmtd)gXApN8juk`d5YUt*G$ zzP7GanS-V9t_{nw2~E~k(yxx?pAbr1->R%U`_FZs ky~obFoU{>Wq2nE_XM?3QUk-Qf5m^Sf(>6eXFnEJnw_S zA}d$FxjXwA^9?qQKcauT^j~x4H1FTBYpd^_lMYvtjJC{-XkW9Mt#Bp#N2yKzrd;dO zv%H)g)dK$RzP7O0r@{PLhjL0&-JQnnKg*I1JZB3lGBB}|3TOhllEKr}&t;ucLK6VU C&t7)` literal 0 HcmV?d00001 diff --git a/type-icons/type-icon4.png b/type-icons/type-icon4.png new file mode 100644 index 0000000000000000000000000000000000000000..b86d1ea172e9cd5e906b59bea946b0fef9d2402e GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#^`0({Ar*{oLpSm^8whM!+%tjk((joY}b@yw5YdVfgiE3H!`?2ZaeAOe2o{+x>lR>g<23?#XntTT0A(z{YZ3wcGCD zX_k-GCgCb;Ge7y=&E8rqF!g?5Ad~v(e_OZ2zH6AW*dW|Hxx_VorSL^&jZ)DAcfPy` z6MWNH%$cAi$!pJH()KgLnBCNMT}KgPRLE6jr^0ntM6aJ^(J<@P{I7oS7yEJHnE43| Y=c?Tn1~+Ti1D(#`>FVdQ&MBb@019Gb!~g&Q literal 0 HcmV?d00001 diff --git a/type-icons/type-icon5.png b/type-icons/type-icon5.png new file mode 100644 index 0000000000000000000000000000000000000000..8ac44649c302009721e4f5c691f9d449a77ba5bd GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#T2B|pkP61PQ}=Q<7zniLKazW=P-fNSyG?K{ z>vF?h<%lk8i_Rp$K*gPZ3YP2)f9mnzcLj^znc7;WL?Z=0W(k4$GB(P`zgn(d=y-qm z`WI%`uDM>Vd-tzc;KAIWvTHY`A0$bzUTE7rtH;3S(8@*0(LJRJrW5}w9sJ$E$kV`m YH$;4*`uaoHfDU2sboFyt=akR{048Zr-T(jq literal 0 HcmV?d00001 diff --git a/type-icons/type-icon6.png b/type-icons/type-icon6.png new file mode 100644 index 0000000000000000000000000000000000000000..c359f932694d14b5e15e7b0b32cd67e587847ab6 GIT binary patch literal 273 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#Wu7jMAr*{orxG3d9NxwDSX}zpaK0+N2X6);HzW?#ubE0%eXnMHWx53~G)1)-uq P7c+Re`njxgN@xNAcQ{}% literal 0 HcmV?d00001 diff --git a/type-icons/type-icon7.png b/type-icons/type-icon7.png new file mode 100644 index 0000000000000000000000000000000000000000..73c6248bea212a79b834b23b662fbf273d261fee GIT binary patch literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#C7v#hAr*{oryk^NFyL{G-u_|Py**Y<$`yrT z>IGu_yBhl*T%BD}%%j?xq7cV5i=X$so~$e!_TJ~febi!MV*He18S)0q=mdKI;Vst048-`n*aa+ literal 0 HcmV?d00001 diff --git a/type-icons/type-icon8.png b/type-icons/type-icon8.png new file mode 100644 index 0000000000000000000000000000000000000000..f3795ca12e0d7d67db3eba574637f6500ae0777b GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#d7dtgAr*{oLl5#cDDdbUGnF|g7;`|i=0rq| zgp+szi+h29ue^%ahH!ZmwIcl>uJCua5}s9Bu27KD>hb!(+!Qw1gh$plxW2n`e;|jo zP4)#D3v;jADQ~sjbqf_f<DcsSRnNwdUEwS{xi6bGoqBSG{mE(3N8CGt1p@j! z8g2z#UUi{aeXr%Znaop9)qBjmuvW6sq3XMwRX~?Ac)I$ztaD0e F0swDESgrs7 literal 0 HcmV?d00001 diff --git a/type-icons/type-icon9.png b/type-icons/type-icon9.png new file mode 100644 index 0000000000000000000000000000000000000000..6ce6abc82395cb0af33b368b81360e189e4bcb95 GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O)#^`0({Ar*{orx@}%7>Kla#~jMqH0uoC0|q_i zhXyhS&gE>HwWiPU-@=pLAAd<1zT7`$+28%wznk;U%CouB&UN+prv`ZjrIU+vIzwkJ zpZ;^({593C3^NX|S;sYTr7**?k|p;K?^%_4`{v&qwv4lr3nuN}X31#5T+6kN!(&S0 zO|C!L7H;c&bsE^b@+WPv4Qt5Ec~yEsfal#hwP!iclo(81j;<4GUDMj78XElb`W5DT auUV8&Iq5l1JM|psbOujXKbLh*2~7aRbZqee literal 0 HcmV?d00001