CSS styles based on sunset and sunrise for visitor location. Like F.lux, for the web. Also known as "Night Light" in Windows or "Night Shift" on macOS/iOS/iPadOS.
Easier on the eyes for night-time reading, useful for blogs and newspapers by eliminating blue light. Read more on F.lux website.
type
for you at lat, long
.…
…
…
…
…
…
…
…
…
…
…
…
…
…
HTML5 Geolocation API
localStorage
to prevent page flickering while navigating or reloading$("html").flucss();
// for any element you want, mostly you want html
or body
Colors are modeled by dividing sun states into 4 groups — but you can add more variation if you need.
Overlay color has eliminated blue channel - rgb(200,125,
- keeping red and green, while maintaing contrast between background and text.0)
All color combinations pass the WebAIM Color Contrast Checker. Click on each color to validate.
Start value: pure white, End value: pure gray (middle between black and white), with 2 equal distance steps in between. Overlaid by #c27c00.
Start value: pure white, End value: pure black, with 2 equal distance steps in between. Overlaid by #c27c00. Last 2 background colors get white text.