Merge pull request #17 from woud420/master
Apply consistency and not redifine unnecesary variables
This commit is contained in:
commit
b56bb5706a
@ -1,17 +1,22 @@
|
|||||||
// Get the hour
|
// Get the hour
|
||||||
var today = new Date();
|
if (today === undefined) {
|
||||||
var hour = today.getHours();
|
const today = new Date();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (today === undefined) {
|
||||||
|
const hour = today.getHours();
|
||||||
|
}
|
||||||
|
|
||||||
// Here you can change your name
|
// Here you can change your name
|
||||||
var name = 'John Doe';
|
const name = 'John Doe';
|
||||||
|
|
||||||
// Here you can change your greetings
|
// Here you can change your greetings
|
||||||
var gree1 = 'Go to Sleep! ';
|
const gree1 = 'Go to Sleep! ';
|
||||||
var gree2 = 'Good morning! ';
|
const gree2 = 'Good morning! ';
|
||||||
var gree3 = 'Good afternoon ';
|
const gree3 = 'Good afternoon ';
|
||||||
var gree4 = 'Good evening ';
|
const gree4 = 'Good evening ';
|
||||||
var gree5 = 'Good evening ';
|
const gree5 = 'Good evening ';
|
||||||
var gree6 = 'Good evening ';
|
const gree6 = 'Good evening ';
|
||||||
|
|
||||||
// Define the hours of the greetings
|
// Define the hours of the greetings
|
||||||
if (hour >= 23 && hour < 5) {
|
if (hour >= 23 && hour < 5) {
|
||||||
|
14
js/theme.js
14
js/theme.js
@ -32,12 +32,16 @@ themeToggle.addEventListener('click', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Change the theme with the time
|
// 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();
|
enableDark();
|
||||||
} else {
|
} else {
|
||||||
disableDark();
|
disableDark();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user