Lurker News
For HTML Day 2025 [1], I made a web service that displays the current sky at your approximate location as a CSS gradient. Colours are simulated on-demand using atmospheric absorption and scattering coefficients. Updates every minute, without the use of client-side JavaScript.

Source code and additional information is available on GitHub: https://github.com/dnlzro/horizon
[1] https://html.energy/html-day/2025/index.html

Comments (160) 61 threads

Earlier comments
michelreij#
Beautiful, thank you!
i_love_retros2 replies#
Curious why a celebration of HTML needed a full stack javascript framework?
dnlzro1 reply#
A server is needed to calculate the sun's position from latitude + longitude + time, and then render the gradient. I could use HTML templating in some other language/framework, but I used Astro because that's what I'm familiar with and it's very easy to deploy to Cloudflare Pages.
nnnnico1 reply#
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?
wonger_1 reply#
(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

Continue this thread — 1 reply

ascorbic1 reply#
Astro is a great way to write HTML
dnlzro1 reply#
I'm sure that's your totally unbiased opinion ;)
ascorbic#
I was a fan of Astro long before I became a maintainer. That's why I joined!
therealfiona1 reply#
Works in Hawaii.
cwmoore#
Even at sunrise?
hoppp#
Seems to work :)

Load more comments