Merge pull request #17 from woud420/master

Apply consistency and not redifine unnecesary variables
This commit is contained in:
Miguel R. Ávila 2021-01-01 18:34:29 -06:00 committed by GitHub
commit b56bb5706a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 15 deletions

View File

@ -1,17 +1,22 @@
// Get the hour
var today = new Date();
var hour = today.getHours();
if (today === undefined) {
const today = new Date();
}
if (today === undefined) {
const hour = today.getHours();
}
// Here you can change your name
var name = 'John Doe';
const name = 'John Doe';
// Here you can change your greetings
var gree1 = 'Go to Sleep! ';
var gree2 = 'Good morning! ';
var gree3 = 'Good afternoon ';
var gree4 = 'Good evening ';
var gree5 = 'Good evening ';
var gree6 = 'Good evening ';
const gree1 = 'Go to Sleep! ';
const gree2 = 'Good morning! ';
const gree3 = 'Good afternoon ';
const gree4 = 'Good evening ';
const gree5 = 'Good evening ';
const gree6 = 'Good evening ';
// Define the hours of the greetings
if (hour >= 23 && hour < 5) {

View File

@ -32,14 +32,18 @@ themeToggle.addEventListener('click', () => {
});
// Change the theme with the time
// const today = new Date();
// const Hr = today.getHours();
/*
if (Hr >= 19 || Hr < 5) {
if (today === undefined) {
const today = new Date();
}
if (today === undefined) {
const hour = today.getHours();
}
if (hour >= 19 || hour < 5) {
enableDark();
} else {
disableDark();
}
*/
*/