PhilMurwin / PokemonChecklists

Home to a variety of Pokemon Checklists
40 stars 21 forks source link

Site images #62

Open tombomb opened 4 years ago

tombomb commented 4 years ago

The site images are dead, there is 2 ways to fix this, one is more clean and a little more work, the other is easier but looks a little jank.

So the css is setting images correctly, IE: http://pokemonpostgame.com/src/PKMNPostGame.Web/images/Lunala.png

But then the JS on PokemonChecklists/src/PKMNPostGame.Web/js/postgame_checklist2.js takes that and turns it into http://pokemonpostgame.com/src/images/Lunala.png

This is because the JS resolves the path (as far as I know) and in chrome, it is built into the page on load, thus its dropping the PKMNPostGame.Web because of the .. , I tried a fix with just the images folder structure next but it sometimes did not load correctly.

The 2 fixes would be:

  1. Update the the CSS to add the full image to the urls This would be the easy and less clean version, if you take this fix, go with the correct root folder path for you, it would probably just be /src/PKMNPostGame.Web/images/ I had to tack on PokemonChecklists because of my github.io

  2. Update the folder structure to get rid of PKMNPostGame.Web directory and move all sub folders to the main dir, this would make the site look a little cleaner but might have some other knock on effects (need to update a bunch of other links and poking some javascript to make sure its still pointing to the correct objects.)

I would recommend 2 in the long run as it would make your url's look cleaner.

an example of the lazy fix can been seen at

https://github.com/tombomb/PokemonChecklists/blob/master/src/PKMNPostGame.Web/css/postgame_checklist_2017.css https://github.com/tombomb/PokemonChecklists/blob/master/src/PKMNPostGame.Web/css/postgame_checklist.css

and

https://tombomb.github.io/PokemonChecklists/src/PKMNPostGame.Web/swsh_checklist.html

tombomb commented 4 years ago

image This is just to prove i'm not crazy, sometimes it fails to load with dead images, it works fine in firefox, but like 90% of the time it fails to load on chrome

PhilMurwin commented 4 years ago

Thanks for the notes/details; it's taken me a while to get around to looking this over. I'm not sure what I'll do, I have a half written vuejs overhaul that may or may not fix the issues. I'll have to review that and see. I'm hoping to have some time at the end of the month to work on the site so hopefully I'll have a fix in place soon.