geocodeearth / autocomplete-element

A custom element for use with the Geocode Earth Autocomplete API.
https://geocode.earth
MIT License
8 stars 1 forks source link

add loading spinner #2

Closed mxlje closed 3 years ago

mxlje commented 3 years ago

The spinner is shown as the user types (and requests are being made) and is hidden when a request comes back with results, as well as when an error occurs.

The spinner is an animated SVG from here (2nd row on the right): https://samherbert.net/svg-loaders/ I adjusted the animation duration to make it a bit faster. We can chose a different one of course, but I’d like it to be an animated SVG because they’re quite small and we can easily bundle them (as is shown in this PR).

https://user-images.githubusercontent.com/1345545/117289661-25932280-ae6d-11eb-8ae5-4589a492a5ea.mov

mxlje commented 3 years ago

\<rebased onto main>

mxlje commented 3 years ago

Thoughts, @orangejulius @missinglink ?

orangejulius commented 3 years ago

I like this. The animation is pretty cool, a bit more unique than most. It's also visible but subtle enough to stay out of the way.

👍

mxlje commented 3 years ago

I have rebased into main and added a CSS variable to customize the color of the loading spinner. Ready to merge if you think we should add it.

orangejulius commented 3 years ago

Yeah it's much better with the spinner :)