msikma / pokesprite

Database project of box and inventory sprites from the Pokémon core series games
https://msikma.github.io/pokesprite/
MIT License
972 stars 167 forks source link

Having issues using Pokesprite on site #23

Closed GiacomoLaw closed 7 years ago

GiacomoLaw commented 7 years ago

Hi all

I linked the CSS to the url sheet on the download site. However, the icons are not showing:

https://github.com/GiacomoLaw/pokemon-team

Anyone know why?

Thank you! 😄

msikma commented 7 years ago

Sorry, the documentation is missing some information. I had been meaning to add this ever since I changed the way the code works, but it seems I just forgot.

In order for the icons to show up, you need to decorate the DOM items. The easiest way is to add the following code just before your closing </body> tag (or, right after the last icon):

<script type="text/javascript">
PkSpr.process_dom();
</script>

Or, you can do this:

<span id="icon_1" class="pkspr pkmn-bulbasaur color-shiny"></span>
<script type="text/javascript">
PkSpr.decorate('icon_1');
</script>

The first version is simpler, the second one is slightly more efficient because it will make the icon show up before the whole page finishes loading.

GiacomoLaw commented 7 years ago

Thank you so much!

GiacomoLaw commented 7 years ago

It worked - yay!

GiacomoLaw commented 7 years ago

Is this right for leftovers?

<span class="pkspr leftovers"></span>

msikma commented 7 years ago

It should be hold-item-leftovers - they are all prefixed with the category, and leftovers is a hold item. The overview is the quickest way to double check.

GiacomoLaw commented 7 years ago

Okay, thanks. Didn't see that page!

Thanks so much for the awesome work.