/** * Update components with conf variables each second */ function updateComponents() { setToID("time", updateTime()); if (curHour == 12 && (curMin >= 24 && curMin <= 30)) { document.getElementById("time").style.color = "red"; document.getElementById("rainbow").style.display = "inherit"; } else { document.getElementById("time").style.color = "inherit"; document.getElementById("rainbow").style.display = "none"; } let timer = document.getElementById("stopwatch").getElementsByClassName("timer")[0]; if (confs.get("timerMsec") == 1) { timer.getElementsByClassName("msec")[0].style.display = "flex"; document.getElementById("stopwatch-msec-dot").style.display = "flex"; } else { timer.getElementsByClassName("msec")[0].style.display = "none"; document.getElementById("stopwatch-msec-dot").style.display = "none"; } } function updateTime() { var d = new Date(); curHour = getDigits(d.getHours(), 2); curMin = getDigits(d.getMinutes(), 2); curSeconds = getDigits(d.getSeconds(), 2); if (confs.get("clockSecond") == "1") { return curHour + "." + curMin + "." + curSeconds; } else { return curHour + "." + curMin; } } function DEVupdateSettings() { let devData = "confs: " + JSON.stringify(confs, (key, value) => (value instanceof Map ? [...value] : value)) + "
" + "schoolPeriods: " + JSON.stringify(schoolPeriods, (key, value) => (value instanceof Map ? [...value] : value)) + "
" + "specialPeriods: " + JSON.stringify(specialPeriods, (key, value) => (value instanceof Map ? [...value] : value)) + "
" + "info: " + navigator.userAgent + "
" + "local-settings:" + (urlParams = new URLSearchParams(window.location.search)) + "
"; document.getElementById("DEV").innerHTML = devData; }