Curious why a celebration of HTML needed a full stack javascript framework?
Show HN: The current sky at your approximate location, as a CSS gradient
31–40 of 171 posts
Re: Show HN: The current sky at your approximate location, as a CSS gradient
#32Awesome. 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…
Re: Show HN: The current sky at your approximate location, as a CSS gradient
#33Re: Show HN: The current sky at your approximate location, as a CSS gradient
#34> 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.
Re: Show HN: The current sky at your approximate location, as a CSS gradient
#35Re: Show HN: The current sky at your approximate location, as a CSS gradient
#36Awesome. 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…
Re: Show HN: The current sky at your approximate location, as a CSS gradient
#37Curious 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.
Re: Show HN: The current sky at your approximate location, as a CSS gradient
#38Re: Show HN: The current sky at your approximate location, as a CSS gradient
#39Re: Show HN: The current sky at your approximate location, as a CSS gradient
#40Earlier 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?
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