Add a function for easily testing the background timing

This commit is contained in:
Neil Brommer 2018-01-06 14:46:39 -08:00
parent b05337e1ca
commit 9a66a9c101

View file

@ -45,3 +45,12 @@ function setBackground(num) {
$(".navbar-toggler").removeClass("toggler-bg-light btn-light").addClass("toggler-bg-dark btn-dark"); $(".navbar-toggler").removeClass("toggler-bg-light btn-light").addClass("toggler-bg-dark btn-dark");
} }
} }
function setBackgroundByTime(hours, mins) {
var total = (hours * 60) + mins;
var period = (24 / backgroundList.length) * 60; // in minutes
var index = Math.floor(total / period);
setBackground(index);
}