@@ -552,7 +543,6 @@ var effect = (VANTA.CLOUDS2 || VANTA.CLOUDS)({
var moonRiseArrow = document.getElementById('moon-rise-arrow');
var moonsetArrow = document.getElementById('moon-set-arrow');
var sunZenithMarker = document.getElementById('sun-zenith-marker');
- var moonZenithMarker = document.getElementById('moon-zenith-marker');
var SUN_ORBIT_RADIUS = 65;
var MOON_ORBIT_RADIUS = 88;
@@ -885,33 +875,12 @@ if (moonTimes.set) {
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
var moonIllum = SunCalc.getMoonIllumination(now);
document.getElementById('moon-phase-text').textContent =
getMoonPhaseText(moonIllum.phase) + ' ' + Math.round(moonIllum.fraction * 100) + '%';
renderMoonPhaseIcon(moonIllum.phase, moonIllum.fraction);
renderRpgMoon(moonIllum.phase, moonIllum.fraction);
-
- // Moon zenith - cache for 1 hour to save CPU
- if (!window._moonZenithCache || Date.now() - window._moonZenithCache.time > 3600000) {
- window._moonZenithCache = {
- time: Date.now(),
- zenith: findMoonZenith(now)
- };
- }
- var moonZenith = window._moonZenithCache.zenith;
- var moonZenithWhen = moonZenith && moonZenith > now ? formatDateLong(moonZenith) : '';
- document.getElementById('moon-zenith-value').textContent = moonZenith ? formatTimeHM(moonZenith) : '--:--';
- document.getElementById('moon-zenith-when').textContent = moonZenithWhen ? 'ยท ' + moonZenithWhen : '';
}
var startTime = Date.now();
@@ -1034,25 +1003,6 @@ var weatherThemes = {
return (now.getTime() - startOfDay.getTime()) / 86400000;
}
- function findMoonZenith(now) {
- // Sample moon altitude every 15 minutes over next 36 hours
- var maxAlt = -Math.PI;
- var zenith = null;
- for (var i = 0; i < 144; i++) {
- var sample = new Date(now.getTime() + i * 15 * 60 * 1000);
- var pos = SunCalc.getMoonPosition(sample, PASSAU_LAT, PASSAU_LON);
- if (pos.altitude > maxAlt) {
- maxAlt = pos.altitude;
- zenith = sample;
- }
- // Stop early if we found a peak and started rising again
- if (i > 4 && zenith && pos.altitude < maxAlt - 0.1) {
- break;
- }
- }
- return zenith;
- }
-
function updateDebug(t, palette, vantaColors, themeName) {
var now = new Date();
var hh = now.getHours(), mm = now.getMinutes(), ss = now.getSeconds();
@@ -1294,12 +1244,6 @@ var weatherThemes = {
animate();
tick();
- // Initial moon zenith calculation
- window._moonZenithCache = {
- time: Date.now(),
- zenith: findMoonZenith(new Date())
- };
-
fetchWeather();
setInterval(fetchWeather, 15 * 60 * 1000);
tick();