Live data from Hacker News

Show HN: The current sky at your approximate location, as a CSS gradient

sky.dlazaro.ca

31–40 of 171 posts

Re: Show HN: The current sky at your approximate location, as a CSS gradient

#32

Awesome. I remember much earlier in my career I was working on a 3D turn-by-turn navigation software, and one of my tasks was to draw the sky in the background. The more senior guy on the team said, just draw a blue rectangle during the day and a dark gray one at night and call it job done. Of course, I had to do it the hard way, so I looked up the relevant literature on sky rendering based on the environment, latitu…

You should have added a duck.

Re: Show HN: The current sky at your approximate location, as a CSS gradient

#34
post #11

> the little-known meta http-equiv="Refresh" HTML tag 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.

Thank you! And umm, not to make you feel ancient, but I think I wasn't even alive yet when `setTimeout(() => location.reload(), ...)` first became widely available.

Oh, don't worry about it at all, and I don't just mean in my own case. Every generation learns to age graciously or otherwise, partly through experience, and for me it's a regular source of joy to see you young 'uns independently rediscover things I long since quit bothering to remember.

Re: Show HN: The current sky at your approximate location, as a CSS gradient

#36

Awesome. I remember much earlier in my career I was working on a 3D turn-by-turn navigation software, and one of my tasks was to draw the sky in the background. The more senior guy on the team said, just draw a blue rectangle during the day and a dark gray one at night and call it job done. Of course, I had to do it the hard way, so I looked up the relevant literature on sky rendering based on the environment, latitu…

Whipping down the innovator with the stupidity whip. Great management

Re: Show HN: The current sky at your approximate location, as a CSS gradient

#37
post #22

Curious why a celebration of HTML needed a full stack javascript framework?

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.

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?

Re: Show HN: The current sky at your approximate location, as a CSS gradient

#40
post #37
post #22

Earlier quoted context omitted.

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.

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?

(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
Post reply on HN