4 ms·
I do a (better-looking, I dare say) version of this on my site https://joeldueck.com https://joeldueck.com , which changes the color scheme depending on the out
by velcrovan 2y ago
I do a (better-looking, I dare say) version of this on my site https://joeldueck.com https://joeldueck.com , which changes the color scheme depending on the outside temp. Currently it's blue because it's a little cold outside. I also have a 1D slider you can play with in the page footer.
I have a script [1] grab the local temp and convert that to two hue values, which it stores as CSS variables --base-temp and --accent.
Then in my CSS I set colors of various things using hsl() values based on one or the other, e.g.:
background-color: hsl(var(--base-temp),50%,96%);
[1]: https://joeldueck.com/code/jdcom/file?ci=tip&name=static/res/windfinger.js&ln=5-9 https://joeldueck.com/code/jdcom/file?ci=tip&name=static/res...
- karaterobot 2y agoNice! My blog calculates a new color scheme every day, by interpolating between some predefined colors (which are based on the season), so sort of a similar thing.
- przemub 2y agoJesus, -18 degrees Celcius? Is that what you mean by "a little cold"? :)
- velcrovan 2y agoHaha, yeah, when I wrote the comment it was more like -11 C (or +11 F) which is more normal. We're in a deep freeze now though, until tonight when we'll get back up to 0C/32F which is pretty warm for December in Minnesota. (The other thing I'm proud of in that little script is that it shows you Celsius degrees unless it can determine your time zone has an American name.)