From 69c73e522a7822ea34528508d1300fe4a34fe7c6 Mon Sep 17 00:00:00 2001 From: zyphlar Date: Wed, 24 May 2023 13:28:40 -0700 Subject: [PATCH] add some description --- index.html | 27 ++++++++++++++------------- sundial.svg | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index 22945fd..2ab54df 100644 --- a/index.html +++ b/index.html @@ -13,9 +13,7 @@ height: 180px; } #sundial { - background-image: url('roman-sundial.jpg'); - width: 664px; - height: 1000px; + display: none; } @@ -34,7 +32,7 @@ height="300" viewBox="0 0 79.374999 79.375" version="1.1" - id="svg5" + id="sundial" xml:space="preserve" inkscape:version="1.2 (dc2aedaf03, 2022-05-15)" sodipodi:docname="sundial.svg" @@ -400,19 +398,22 @@ console.log("It is", romanMinuteEnglish, "hora", romanHour, romanNumeralHour); if (msAfterSunrise > 0) { - document.getElementById('clock').innerText = "It is "+romanMinuteEnglish+" Hora "+romanHour+" ("+romanNumeralHour+")"; + document.getElementById('clock').innerHTML = "It is "+romanMinuteEnglish+" Hora "+romanHour+" ("+romanNumeralHour+")
AKA "+(Math.round(percentOfDay*10000)/100)+"% through today's daylight."; + + let zeroHrDeg = 77; + let twelveHrDeg = -81.5; + let degreeSweep = twelveHrDeg-zeroHrDeg; + let sundialDegree = percentOfDay*degreeSweep*.975+zeroHrDeg; // .975 fudge factor + + let sundial = document.getElementById("sundial"); + sundial.style["display"] = "block"; + let sunshadow = document.getElementById("sunshadow"); + sunshadow.style["transform"] = "rotate("+sundialDegree+"deg)"; + sunshadow.style["transform-origin"] = "top center"; } else { document.getElementById('clock').innerText = "The sun isn't in the sky, go check the moon."; } - let zeroHrDeg = 77; - let twelveHrDeg = -81.5; - let degreeSweep = twelveHrDeg-zeroHrDeg; - let sundialDegree = percentOfDay*degreeSweep*.975+zeroHrDeg; // .95 fudge factor - - let sunshadow = document.getElementById("sunshadow"); - sunshadow.style["transform"] = "rotate("+sundialDegree+"deg)"; - sunshadow.style["transform-origin"] = "top center"; } getLocation(); diff --git a/sundial.svg b/sundial.svg index a619038..9d4fdb4 100644 --- a/sundial.svg +++ b/sundial.svg @@ -6,7 +6,7 @@ height="300" viewBox="0 0 79.374999 79.375" version="1.1" - id="svg5" + id="sundial" xml:space="preserve" inkscape:version="1.2 (dc2aedaf03, 2022-05-15)" sodipodi:docname="sundial.svg"