@xTITUS-MAXIMUSx nvm… after reviewing my mistakes I actually got it working
Module.register("MMM-CSSswitch", {
defaults: {
morning_start: 5,
morning_stop: 12,
noon_start: 12,
noon_stop: 23,
},
//Do I still need to load the custom.css?
getStyles: function() {
return ["MMM-CSSswitch.css"];
},
// Define start sequence.
start: function() {
Log.info("Starting module: " + this.name);
// Schedule update interval.
var self = this;
self.updatecssswitch();
setInterval(function() {
self.updatecssswitch();
}, 5000);
},
updatecssswitch: function() {
var currentTime = new Date().getHours();
var body = document.querySelector('morning');
if ( currentTime >= this.config.morning_start && currentTime < this.config.morning_end ) {
document.body.className = "morning";
}
else if ( currentTime >= this.config.noon_start && currentTime < this.config.noon_stop ) {
document.body.className = "noon";
}
else {
document.body.className = "night";
}
}
});
CSS
.morning {
background-image: url("morning.png");
margin: 0;
height: 100%;
width: 100%;
}
.noon {
background-image: url("noon.jpg");
margin: 0;
height: 100%;
width: 100%;
}
.night {
background-image: url("night.jpg");
margin: 0;
height: 100%;
width: 100%;
}
Big thanks to @Piranha1605 and his github for a template.