added a change of theme depending at the time

This commit is contained in:
SergeyAverin 2020-10-16 21:10:55 +06:00 committed by GitHub
parent 2349c3ad0b
commit be244b68c7
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();
}Wasd