add conv and dark anchors

This commit is contained in:
ivan 2022-07-16 16:42:32 +03:00
parent b79d2f879c
commit 5657b28280
2 changed files with 23 additions and 6 deletions

View File

@ -7,9 +7,12 @@ html {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
font-size: 55px;
}
body {
background: #f1f1f1; background: #f1f1f1;
color: #326f0c; color: #326f0c;
font-size: 55px;
} }
#wrap { #wrap {

View File

@ -2,15 +2,19 @@
* https://gitlab.com/zlax/dtime-js discrodian date and time converter * https://gitlab.com/zlax/dtime-js discrodian date and time converter
*/ */
function showconv() {
document.getElementById("dconv").innerHTML = converterhtml();
var currentdate = new Date();
document.getElementById("ctimeoffset").value = currentdate.getTimezoneOffset();
filltimes(currentdate);
}
function timeclick() { function timeclick() {
if (window.dtimescreen) window.dtimescreen++; if (window.dtimescreen) window.dtimescreen++;
else window.dtimescreen = 1; else window.dtimescreen = 1;
switch (window.dtimescreen) { switch (window.dtimescreen) {
case 1: case 1:
document.getElementById("dconv").innerHTML = converterhtml(); showconv();
var currentdate = new Date();
document.getElementById("ctimeoffset").value = currentdate.getTimezoneOffset();
filltimes(currentdate);
break; break;
case 2: case 2:
document.getElementById("dconv").innerHTML = ""; document.getElementById("dconv").innerHTML = "";
@ -145,3 +149,13 @@ function converterhtml() {
`; `;
return convinnerhtml; return convinnerhtml;
} }
document.addEventListener("DOMContentLoaded", function() {
if (window.location.hash == "#c" || window.location.hash == "#conv" || window.location.hash == "#converter") {
window.dtimescreen = 1;
showconv();
}
if (window.location.hash == "#d" || window.location.hash == "#dark") {
document.body.style.background = '#2e3235';
}
});