samwho / symbol.wtf

A dumb website I made for when I need a symbol.
https://symbol.wtf/
MIT License
61 stars 42 forks source link

Add search bar 🔍 | Split symbols out #29

Closed CatalanCabbage closed 5 months ago

CatalanCabbage commented 5 months ago

Split symbols out of the HTML

symbols = {'©', '®', '™'} //has been split into
symbols = {"glyph": "²", "name": "Squared", "searchTerms": ["squared", "power"]}, //etc

Add a rudimentary search bar

A simple search bar has been added which performs a naive search across the symbols.
It takes data from the array searchTerms, concats them and checks for a partial match.
Should be good enough for a long time. Unless we want AI and ML and 100,000 symbols. :)

Considering searchTerms is a separate value, it's full customizable - ✔ will show up on searches for check, tick, correct etc - go wild!

Comments on style Kept the default since it's in line with the general style of the page. Just centered it (WHICH TOOK ME 3 HOURS) btw the search results view is endearing - becomes bigger in size with fewer results. Pretty cool, so I let it be.


Now here's what you came for

the search! image

ooh only 2 hits so they're chonky boisss image

qwell commented 5 months ago

17 no longer made sense given this PR, but I would like to push a bit for the way it did categories, even if only via comments for now. It would be nice in the future to be able to scroll through things in a semi-coherent list and it could help with searching as well.

qwell commented 5 months ago

Created PR downstream to address my comments here.

https://github.com/CatalanCabbage/symbol.wtf/pull/1

qwell commented 5 months ago

Add several more downstream PRs to add some extra functionality.

1) Invisible characters (https://github.com/CatalanCabbage/symbol.wtf/pull/2) 2) Autofocus (https://github.com/CatalanCabbage/symbol.wtf/pull/3).

samwho commented 5 months ago

I'm going to merge this into a staging branch and apply the review comments from @qwell. Thank you both for your contributions :)

qwell commented 5 months ago

If you give me a minute, I'll get my rollup branch pointed to yours and open a separate PR.

samwho commented 5 months ago

Ahh sorry, I already did the merge. If you rebase off main and open a new PR I'll take a look 🙏

qwell commented 5 months ago

Ahh sorry, I already did the merge. If you rebase off main and open a new PR I'll take a look 🙏

39 :)