logoalt Hacker News

nnnnicolast Saturday at 4:09 PM2 repliesview on HN

it's beautiful. btw, could this be all done in client side js? didnt look at the implementation, probably server is used to resolve location?


Replies

wonger_last Saturday at 4:43 PM

(not author) from the source:

  const { latitude = "0", longitude = "0" } = Astro.locals.runtime.cf || {};
To do it client-side, you would probably have to call some less-reputable IP geolocation service, or settle for navigator.geolocation which has a permission popup
show 1 reply