diff --git a/index.html b/index.html index d3a09bd..39f4c55 100644 --- a/index.html +++ b/index.html @@ -276,6 +276,16 @@ + + + + + + + + + + @@ -301,18 +311,18 @@
Aufgang--:--
-
-
- -
-
Untergang--:--
-
Zenit Sonne--:--
+
+
+ +
+
Untergang--:--
+
@@ -540,6 +550,8 @@ var effect = (VANTA.CLOUDS2 || VANTA.CLOUDS)({ var sunRiseArrow = document.getElementById('sun-rise-arrow'); var sunSetArrow = document.getElementById('sun-set-arrow'); var moonRiseArrow = document.getElementById('moon-rise-arrow'); + var sunZenithMarker = document.getElementById('sun-zenith-marker'); + var moonZenithMarker = document.getElementById('moon-zenith-marker'); var moonSetArrow = document.getElementById('moon-set-arrow'); var SUN_ORBIT_RADIUS = 65; @@ -852,6 +864,11 @@ var effect = (VANTA.CLOUDS2 || VANTA.CLOUDS)({ var ssP = pointOnCircle(sunTimes.sunset, SUN_ORBIT_RADIUS); sunSetArrow.setAttribute('transform', 'translate(' + ssP.x + ', ' + ssP.y + ')'); + // Sun zenith marker (next occurrence) + var sunZenithDate = sunTimes.solarNoon > now ? sunTimes.solarNoon : SunCalc.getTimes(new Date(now.getTime() + 86400000), PASSAU_LAT, PASSAU_LON).solarNoon; + var szP = pointOnCircle(sunZenithDate, SUN_ORBIT_RADIUS); + sunZenithMarker.setAttribute('transform', 'translate(' + szP.x + ', ' + szP.y + ')'); + // Moon rise/set arrows if (moonTimes.rise) { var mrP = pointOnCircle(moonTimes.rise, MOON_ORBIT_RADIUS); @@ -860,12 +877,21 @@ var effect = (VANTA.CLOUDS2 || VANTA.CLOUDS)({ } else { moonRiseArrow.setAttribute('opacity', '0'); } - if (moonTimes.set) { +if (moonTimes.set) { var msP = pointOnCircle(moonTimes.set, MOON_ORBIT_RADIUS); - moonSetArrow.setAttribute('transform', 'translate(' + msP.x + ', ' + msP.y + ')'); - moonSetArrow.setAttribute('opacity', '1'); + moonsetArrow.setAttribute('transform', 'translate(' + msP.x + ', ' + msP.y + ')'); + moonsetArrow.setAttribute('opacity', '1'); } else { - moonSetArrow.setAttribute('opacity', '0'); + moonsetArrow.setAttribute('opacity', '0'); + } + + // Moon zenith marker + if (window._moonZenithCache && window._moonZenithCache.zenith) { + var mzP = pointOnCircle(window._moonZenithCache.zenith, MOON_ORBIT_RADIUS); + moonZenithMarker.setAttribute('transform', 'translate(' + mzP.x + ', ' + mzP.y + ')'); + moonZenithMarker.setAttribute('opacity', '1'); + } else { + moonZenithMarker.setAttribute('opacity', '0'); } // Moon phase @@ -1280,6 +1306,12 @@ var weatherThemes = { animate(); tick(); + // Initial moon zenith calculation + window._moonZenithCache = { + time: Date.now(), + zenith: findMoonZenith(new Date()) + }; + fetchWeather(); setInterval(fetchWeather, 15 * 60 * 1000); tick();