Убрано лишнее
This commit is contained in:
parent
3d76c73afe
commit
86683c96cd
94
index.html
94
index.html
|
@ -14,66 +14,56 @@
|
||||||
|
|
||||||
<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">
|
<div class="modal-header">
|
||||||
<div class="modal-header">
|
<h5 class="modal-title">О странице</h5>
|
||||||
<h5 class="modal-title">О странице</h5>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<span aria-hidden="true">×</span>
|
||||||
<span aria-hidden="true">×</span>
|
</button>
|
||||||
</button>
|
</div>
|
||||||
</div>
|
<div class="modal-body">
|
||||||
<div class="modal-body">
|
<p>Данный сайт не сохраняет никакие cookie и использует только время вашего устройства.</p>
|
||||||
<p>Данный сайт не сохраняет никакие cookie и использует только время вашего устройства.</p>
|
<p>Автор сайта: <a href="https://t.me/dan63047">dan63047</a></p>
|
||||||
<p>Автор сайта: <a href="https://t.me/dan63047">dan63047</a></p>
|
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#debug"
|
||||||
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#debug"
|
aria-expanded="false" aria-controls="collapseExample">
|
||||||
aria-expanded="false" aria-controls="collapseExample">
|
Дебаг информация
|
||||||
Дебаг информация
|
</button>
|
||||||
</button>
|
</p>
|
||||||
</p>
|
<div class="collapse" id="debug">
|
||||||
<div class="collapse" id="debug">
|
<div class="card card-body">
|
||||||
<div class="card card-body">
|
<div class="incard_l">
|
||||||
<div class="incard_l">
|
Отсчёт до:<br>
|
||||||
Отсчёт до:<br>
|
Осталось миллисекунд:<br>
|
||||||
Осталось миллисекунд:<br>
|
Полный таймер:<br>
|
||||||
Полный таймер:<br>
|
Фон:
|
||||||
R:<br>
|
</div>
|
||||||
G:<br>
|
<div class="incard_r">
|
||||||
B:<br>
|
<a id="endtime"></a><br>
|
||||||
color_phase:<br>
|
<a id="left"></a><br>
|
||||||
color_var:<br>
|
<a id="fulltimer"></a><br>
|
||||||
</div>
|
<a id="color"></a>
|
||||||
<div class="incard_r">
|
|
||||||
<a id="endtime"></a><br>
|
|
||||||
<a id="left"></a><br>
|
|
||||||
<a id="fulltimer"></a><br>
|
|
||||||
<a id="color_r"></a><br>
|
|
||||||
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="countdown" class="countdown">
|
<div id="countdown" class="countdown">
|
||||||
|
|
||||||
<div class="countdown-inner">
|
<div class="countdown-inner">
|
||||||
<span class="didts" id="num1"></span>
|
<span class="didts" id="num1"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="countdown-inner"><span id="separator1">:</span></div>
|
<div class="countdown-inner"><span id="separator1">:</span></div>
|
||||||
<div class="countdown-inner">
|
<div class="countdown-inner">
|
||||||
<span class="didts" id="num2"></span>
|
<span class="didts" id="num2"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="countdown-inner"><span id="separator2">:</span></div>
|
<div class="countdown-inner"><span id="separator2">:</span></div>
|
||||||
<div class="countdown-inner">
|
<div class="countdown-inner">
|
||||||
<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>
|
||||||
|
|
14
script.js
14
script.js
|
@ -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 = "д.   ";
|
dots1.innerHTML = "д.   ";
|
||||||
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);
|
Loading…
Reference in New Issue