Merge pull request #8 from SergeyAverin/SergeyAverin-patch-1

added a change of theme depending at the time
This commit is contained in:
Miguel R. Ávila 2020-10-16 20:17:29 -05:00 committed by GitHub
commit 857c2392bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,3 +30,12 @@ themeToggle.addEventListener('click', () => {
disableDark();
}
});
const today = new Date();
const Hr = today.getHours();
if (Hr >= 19 || Hr < 5) {
enableDark();
} else {
disableDark();
}