Убрано лишнее

This commit is contained in:
dan63047 2021-09-22 13:53:34 +03:00
parent 3d76c73afe
commit 86683c96cd
2 changed files with 49 additions and 61 deletions

View File

@ -14,7 +14,6 @@
<body> <body>
<h1 class="countdown-title">До нового <span id="future_year"></span> года осталось:</h1> <h1 class="countdown-title">До нового <span id="future_year"></span> года осталось:</h1>
<div class=".container-fluid">
<div class="modal" tabindex="-1" role="dialog" id="about"> <div class="modal" tabindex="-1" role="dialog" id="about">
<div class="modal-dialog" role="document"> <div class="modal-dialog" role="document">
<div class="modal-content"> <div class="modal-content">
@ -38,21 +37,13 @@
Отсчёт до:<br> Отсчёт до:<br>
Осталось миллисекунд:<br> Осталось миллисекунд:<br>
Полный таймер:<br> Полный таймер:<br>
R:<br> Фон:
G:<br>
B:<br>
color_phase:<br>
color_var:<br>
</div> </div>
<div class="incard_r"> <div class="incard_r">
<a id="endtime"></a><br> <a id="endtime"></a><br>
<a id="left"></a><br> <a id="left"></a><br>
<a id="fulltimer"></a><br> <a id="fulltimer"></a><br>
<a id="color_r"></a><br> <a id="color"></a>
<a id="color_g"></a><br>
<a id="color_b"></a><br>
<a id="color_phase"></a><br>
<a id="color_var"></a>
</div> </div>
</div> </div>
</div> </div>
@ -75,7 +66,6 @@
<span class="didts" id="num3"></span> <span class="didts" id="num3"></span>
</div> </div>
</div> </div>
</div>
<a class="nav-link" data-toggle="modal" href='#about' style="color: #ffffff; text-decoration: underline; width: 100%; position: absolute; bottom: 0;">О странице</a> <a class="nav-link" data-toggle="modal" href='#about' style="color: #ffffff; text-decoration: underline; width: 100%; position: absolute; bottom: 0;">О странице</a>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"

View File

@ -35,11 +35,8 @@ function changeBackgroundColor() {
currect = colors[0] 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); 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);
document.getElementById("color_r").innerHTML = currect[0].toFixed(6) var num_f = 3;
document.getElementById("color_g").innerHTML = currect[1].toFixed(6) 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)+"%";
document.getElementById("color_b").innerHTML = currect[2].toFixed(6)
document.getElementById("color_phase").innerHTML = color_phase.toFixed(6)
document.getElementById("color_var").innerHTML = color_var.toFixed(6)
} }
function initializeClock(endtime) { function initializeClock(endtime) {
@ -51,12 +48,13 @@ function initializeClock(endtime) {
var debug1 = document.getElementById('endtime'); var debug1 = document.getElementById('endtime');
var debug2 = document.getElementById('left'); var debug2 = document.getElementById('left');
var debug3 = document.getElementById('fulltimer'); var debug3 = document.getElementById('fulltimer');
var time_to = new Date(endtime)
var updateTime = 1000 / 60; var updateTime = 1000 / 60;
function updateClock() { function updateClock() {
var t = getTimeRemaining(endtime); var t = getTimeRemaining(endtime);
if (t.days > 0) { if (t.days > 0) {
num1.innerHTML = (t.days > 99) ? t.days : ('0' + t.days).slice(-2); num1.innerHTML = t.days;
dots1.innerHTML = "д. &#8201&#8201"; dots1.innerHTML = "д. &#8201&#8201";
dots1.style.fontSize = "3rem"; dots1.style.fontSize = "3rem";
dots1.style.width = dots2.style.width; dots1.style.width = dots2.style.width;
@ -95,7 +93,7 @@ function initializeClock(endtime) {
debug2.innerHTML = t.total.toLocaleString('ru'); debug2.innerHTML = t.total.toLocaleString('ru');
debug3.innerHTML = t.days + ':' + ('0' + t.hours).slice(-2) + ':' + ('0' + t.minutes).slice(-2) + ':' + ('0' + t.seconds).slice(-2) + '.' + ('00' + t.mseconds).slice(-3); debug3.innerHTML = t.days + ':' + ('0' + t.hours).slice(-2) + ':' + ('0' + t.minutes).slice(-2) + ':' + ('0' + t.seconds).slice(-2) + '.' + ('00' + t.mseconds).slice(-3);
} }
debug1.innerHTML = endtime; debug1.innerHTML = time_to.toLocaleString();
updateClock(); updateClock();
var timeinterval = setInterval(updateClock, updateTime); var timeinterval = setInterval(updateClock, updateTime);
} }
@ -104,5 +102,5 @@ let d_for_setting = new Date();
let future_year = (d_for_setting.getMonth() == 0 && d_for_setting.getDate() < 7) ? d_for_setting.getFullYear() : d_for_setting.getFullYear() + 1 let future_year = (d_for_setting.getMonth() == 0 && d_for_setting.getDate() < 7) ? d_for_setting.getFullYear() : d_for_setting.getFullYear() + 1
document.getElementById("future_year").innerHTML = future_year; document.getElementById("future_year").innerHTML = future_year;
initializeClock("Jan 01 " + future_year + " 00:00:00"); initializeClock("Jan 01 " + future_year + " 00:00:00");
//initializeClock("Sep 22 2021 19:21:00"); //initializeClock("Sep 23 2021 13:24:00");
setInterval(changeBackgroundColor, 1000/60); setInterval(changeBackgroundColor, 1000/60);