Show HN: The current sky at your approximate location, as a CSS gradient
443 dlazaro 92 8/9/2025, 1:25:16 PM sky.dlazaro.ca ↗
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
Well, the higher ups of course hated it, they were confused as to why the horizon would get hazy, yellowish, and so on. "Our competitors' skies are blue!" They didn't like "Use your eyes and look outside" as an answer.
Eventually, I was told to scrap it and just draw a blue rectangle :(
All that to say, nice job on the site!
1: https://courses.cs.duke.edu/cps124/fall01/resources/p91-pree...
The reality is that we have certain conventions that are immediately understandable, and that too much visual complexity results in confusion rather than clarity.
If the sky is hazy white when I expect it to be blue, I'm confused as to whether it's the sky or if the map is still loading. It's adding cognitive complexity for no reason. Stars similarly serve no functional purpose at night.
What you built sounds great for an actual planetary view like Google Earth. And it sounds fun to build. But it's an anti-feature for a navigation view. When you're navigating, simplicity and clarity are paramount. Not realism.
I can understand people removing polish things like that if there are usability concerns, but those small things add up to a lot in an end product and are a joy to find and explore.
1: https://en.wikipedia.org/wiki/Cobalt_(video_game)
This is like if you were renovating your house and the drywall guy spends a huge amount of time building up round corners, but you just wanted regular square corners. Then on some drywall forum they're bitching about how "all clients are stupid" or something.
If you're the kind of developer who likes to "sand and finish the back side of the cabinet," either you need to find a very rare, special company, or do it at home as a hobby.
But yeah, if you only care about checking the feature boxes.. Go ahead, make shit software with miserable people, but be sure to prepare to go out of business.
You could've sold it with telling them Vincent Van Gogh's paintings had the location of stars accurately, you were inspired by those paintings to reproduce the sky color accurately.
That doesn't apply to every single instance of those, but if the sky isn't the focus of your application, a realistic one is just a distraction.
Oh, don't mind me, I'll just be over here in the corner laughing ruefully as my bones crumble to dust: back when I started, if you wanted a page to refresh on its own, this was the only way.
Beautiful work! A splendid example of formal minimalism at its best.
https://www.oreilly.com/openbook/cgi/ch06_06.html
First, the header must be added to the response, not the request.
Second, in many environments (managed hosting etc.) there is not an easy way (or indeed a way at all) of adding headers to responses.
These bindings (or at least some of them) are also mocked when developing locally, in a non-Cloudflare-Workers environment.
[1] https://developers.cloudflare.com/workers/wrangler/api/#supp...
[2] https://developers.cloudflare.com/workers/runtime-apis/reque...
https://developers.cloudflare.com/network/ip-geolocation/
"This Managed Transform adds HTTP request headers with location information for the visitor's IP address, such as city, country, continent, longitude, and latitude."
[1] https://github.com/mpetroff/nightsky
I know that you deeply know map tech :-) but if I may make a suggestion - you might consider switching from Google Maps to Protomaps? https://github.com/protomaps/protomaps-leaflet
Cheers
But it looked very cool earlier today when it matched!
what got me the most is opening chrome dev tools and seeing nothing there
(I used this, but it does leave a small "please purchase" banner at the top, until you pay: https://play.google.com/store/apps/details?id=com.nuko.livew...)
I wonder what it would take to account for weather?
No comments yet
- First and most impactful: as the earth curves down and away from the observer's horizon, your line of sight goes through a thicker slice of the atmosphere.
Looking straight up you might have 100km of atmosphere until space (the distance is made up here, but I'm using the Kármán line as an arbitrary ruler), but looking out towards the horizon (assuming a perfectly spherical Earth), it's much, much more than that 100km, so the light will scatter off of (and/or be filtered by, depending on angle and time of day) more particles in the atmosphere, affecting the colour of the sky.
- The compounding factor here is if there are environmental factors that boost the particle count in the air, and especially particles that'd stay in lower layers of the atmosphere. Where I am, we've been dealing with wildfire smoke of varying strengths for a few weeks. Today's gentle enough, but it's bad enough that my gradient goes from rgb(115, 160, 207) at the top of the sky to rgb(227, 230, 227) at the horizon (which is shockingly accurate).