understandable debug info

This commit is contained in:
dan63047 2021-12-22 22:27:51 +03:00
parent 2ce22f6ae8
commit b27f7da3be
2 changed files with 8 additions and 5 deletions

View File

@ -37,13 +37,15 @@
Отсчёт до:<br>
Осталось миллисекунд:<br>
Полный таймер:<br>
Фон:
Фон:<br>
Фаза фона:
</div>
<div class="incard_r">
<a id="endtime"></a><br>
<a id="left"></a><br>
<a id="fulltimer"></a><br>
<a id="color"></a>
<a id="color"></a><br>
<a id="phase"></a>
</div>
</div>
</div>

View File

@ -16,7 +16,7 @@ function getTimeRemaining(endtime) {
'mseconds': mseconds
};
}
let phases = ["Переходная (с ночи на день)", "Дневная", "Переходная (со дня на ночь)", "Ночная"]
function changeBackgroundColor() {
let t = new Date();
let local_t = t.getTime() - t.getTimezoneOffset()*60000 - 180*60000;
@ -35,8 +35,9 @@ function changeBackgroundColor() {
currect = colors[0]
}
document.getElementsByTagName("body")[0].style.backgroundColor = "#"+("0"+Math.round(currect[0]).toString(16)).slice(-2)+("0"+Math.round(currect[1]).toString(16)).slice(-2)+("0"+Math.round(currect[2]).toString(16)).slice(-2);
var num_f = 3;
document.getElementById("color").innerHTML = "R:" + currect[0].toFixed(num_f) + "; G:" + currect[1].toFixed(num_f) + "; B:" + currect[2].toFixed(num_f) + "; P:" + Math.trunc(color_phase) + "; V:" + (color_var*100).toFixed(num_f)+"%";
var num_f = 2;
document.getElementById("color").innerHTML = "R:" + currect[0].toFixed(num_f) + "; G:" + currect[1].toFixed(num_f) + "; B:" + currect[2].toFixed(num_f);
document.getElementById("phase").innerHTML = phases[Math.trunc(color_phase)] + ", " + ((color_phase % 1)*100).toFixed(num_f)+"%"
}
function initializeClock(endtime) {