From 5657b28280cec912ee95912462f9595922087ffa Mon Sep 17 00:00:00 2001 From: zlax Date: Sat, 16 Jul 2022 16:42:32 +0300 Subject: [PATCH] add conv and dark anchors --- dtime.css | 5 ++++- dtimeconv.js | 24 +++++++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/dtime.css b/dtime.css index 20f6fab..c2f005f 100644 --- a/dtime.css +++ b/dtime.css @@ -7,9 +7,12 @@ html { width: 100%; height: 100%; position: relative; + font-size: 55px; +} + +body { background: #f1f1f1; color: #326f0c; - font-size: 55px; } #wrap { diff --git a/dtimeconv.js b/dtimeconv.js index 718c13a..0a55398 100644 --- a/dtimeconv.js +++ b/dtimeconv.js @@ -2,15 +2,19 @@ * https://gitlab.com/zlax/dtime-js discrodian date and time converter */ -function timeclick () { +function showconv() { + document.getElementById("dconv").innerHTML = converterhtml(); + var currentdate = new Date(); + document.getElementById("ctimeoffset").value = currentdate.getTimezoneOffset(); + filltimes(currentdate); +} + +function timeclick() { if (window.dtimescreen) window.dtimescreen++; else window.dtimescreen = 1; switch (window.dtimescreen) { case 1: - document.getElementById("dconv").innerHTML = converterhtml(); - var currentdate = new Date(); - document.getElementById("ctimeoffset").value = currentdate.getTimezoneOffset(); - filltimes(currentdate); + showconv(); break; case 2: document.getElementById("dconv").innerHTML = ""; @@ -145,3 +149,13 @@ function converterhtml() { `; 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'; + } +});