resolvetosavelives / healthicons

A collection of open source icons for public health projects.
https://healthicons.org
MIT License
623 stars 49 forks source link

Permalinks for icons #80

Closed sgarrity closed 2 years ago

sgarrity commented 3 years ago

Right now, you can't send someone a link to an icon on healthicons.org without getting the SVG source URL directly.

Let's create discrete URLs for each icon that will be visible when the modal for that icon is open (and will open the modal if you navigate to that URL).

sgarrity commented 3 years ago

I'm not sure if this is something nextjs can provide, or needs to be handled by a routing let, but I think the basics should work something like this:

  1. Visit healthicons.org (location bar shows https://healthicons.org/
  2. Click on the syringe icon (modal opens, location bar shows something like https://healthicons.org/#syringe)
  3. Closing the modal removes the #syringe fragment from the URL
  4. If you send the https://healthicons.org/#syringe URL to a friend, the site will load with the Syringe icon modal open

Just using a short-name URL fragment may not be sufficient, since there are filled and outline variations. This could be addressed with something fairly simple, like /#syringe-outline, or we could get fancier, and define a hackable URL scheme.

For example: https://healthicons.org/[icon-style]/[icon]

https://healthicons.org/outline/syringe

With this approach, https://healthicons.org/outline/ could pre-populate the style filter requested in https://github.com/resolvetosavelives/healthicons/issues/76

nburka commented 3 years ago

I prefer this URL structure: https://healthicons.org/[style]/[icon]

nburka commented 2 years ago

I don't know why I added an "Easy" tag to this! It was not easy. But it's now done.