A countdown to Crepusculus, the earliest sunset of the year. The page shows today's sunset on a clock face, with lines for the next two weeks of sunsets and the earliest sunset of the year.
A working version of this page is deployed here:
The page uses JavaScript modules, so it has to be served over HTTP; opening
index.html directly from disk won't work. Use VS Code's Live Server
(configured for port 5501) or any static file server.
index.html– page markupstyles.css– layout, theme colours and dark modecalc.js– sunset calculations and time formatting (no DOM access)clock.js– draws the clock face and hands on a canvasmain.js– picks the location, runs the calculations and renders the pagefavicon.svg– browser tab icon
Sunset times come from the SunCalc library, loaded from cdnjs.
- Add option to show either sunrise or sunset times
- Put in a pink line to show the day of the earliest sunset
- Make sure the times match the geo-located position
- Clean up table at the bottom
- Use the SunCalc library instead of the current (very old) one
- Remove Material Design Lite; split the code into modules
- Fix the days-until count, sunset time zone handling, and stale saved location
- Redesign: dusk palette, dark mode, classic clock face, compact layout
- Show which location is in use, with a link to it on Google Maps
- Refresh the page when the day changes