Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add colorblind friendly mode #125

Merged
merged 10 commits into from
Dec 14, 2023
Merged

Add colorblind friendly mode #125

merged 10 commits into from
Dec 14, 2023

Conversation

mwbernard
Copy link
Contributor

We had an issue with the minimap images not appearing anymore on the live site after this code was merged, so I reverted that commit and will address the problems here before re merging this code.

@ebrelsford do you have any thoughts on why the live site was failing to access the minimap images here.

@mwbernard mwbernard requested a review from ebrelsford December 12, 2023 22:41
Comment on lines 66 to 69
const schemeFolder = colorblindFriendly.value ? 'colorblindFriendly/' : 'default/'
const url = `../assets/img/minimaps/${schemeFolder}${crop}_${selectedModel.value}.svg`

return new URL(url, import.meta.url).href
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is where we get the dynamic image URL for each minimap

@mwbernard mwbernard linked an issue Dec 12, 2023 that may be closed by this pull request
@ebrelsford
Copy link
Contributor

@mwbernard To test how this is going to look in production, build the site locally then view the generated version.

  1. Build: npm run build. The site is generated in dist/.
  2. cd dist
  3. Run a simple server (such as python3 -m http.server 8000, site will be running on localhost:8000.

Following these steps I can see the images are referenced like this:

image

But the images aren't actually there in the built version. I think the easiest thing to do will be to move these images into public/ and fetch them from there as we do the data. Do that and test it with the above process?

@mwbernard
Copy link
Contributor Author

@ebrelsford Thanks for the help on this! Seems to be working well for me in the built version - so I've updated the script to output there.

I also added a couple smaller style adjustments for stuff that had been bothering me, so I think this is looking good.

Copy link
Contributor

@ebrelsford ebrelsford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, confirmed this should work in prod.

Could be a follow-up issue but as I note in #127 these SVGs are a bit heavy and may be contributing to mobile issues, how hard would it be to generated PNGs instead?

vacs-map-app/src/components/GridOverlay.vue Outdated Show resolved Hide resolved
@mwbernard
Copy link
Contributor Author

@ebrelsford there's likely a better way to just generate these pngs directly with canvas, but this was fairly easy to add to the existing code.

We're still generating svg files, but then using a library to convert those files to pngs and deleting the svgs once that's done. Does that work for you?

Copy link
Contributor

@ebrelsford ebrelsford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect thanks!

@mwbernard mwbernard merged commit 17874d2 into main Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add colorblind-friendly color palette
2 participants