The code consists of a few helper methods, reading/setting the theme from localStorage, generating the 1-31 days elements and updating the calendar and clock once a second. It's also using requestAnimationFrame to not be a battery drain when the tab is not visible.