Remove try/catch blocks to debug, clean up debug counter

This commit is contained in:
Richard Zink committed 2026-10-07 11:18:42 +02:00
1 parent 355201b174
commit 5b32f35a07
1 file changed
+15 -32
+15 -32
View File
@@ -771,8 +771,6 @@ var effect = (VANTA.CLOUDS2 || VANTA.CLOUDS)({
}
function updateClockAndEvents() {
try {
window._updateCounter = (window._updateCounter || 0) + 1;
var now = new Date();
// Real-time clock hands and digital
@@ -899,7 +897,7 @@ if (moonTimes.set) {
// Moon phase
var moonIllum = SunCalc.getMoonIllumination(now);
document.getElementById('moon-phase-text').textContent =
getMoonPhaseText(moonIllum.phase) + ' ' + Math.round(moonIllum.fraction * 100) + '%' + ' #' + window._updateCounter;
getMoonPhaseText(moonIllum.phase) + ' ' + Math.round(moonIllum.fraction * 100) + '%';
renderMoonPhaseIcon(moonIllum.phase, moonIllum.fraction);
renderRpgMoon(moonIllum.phase, moonIllum.fraction);
@@ -914,9 +912,6 @@ if (moonTimes.set) {
var moonZenithWhen = moonZenith && moonZenith > now ? formatDateLong(moonZenith) : '';
document.getElementById('moon-zenith-value').textContent = moonZenith ? formatTimeHM(moonZenith) : '--:--';
document.getElementById('moon-zenith-when').textContent = moonZenithWhen ? '· ' + moonZenithWhen : '';
} catch (e) {
console.log('updateClock error:', e);
}
}
var startTime = Date.now();
@@ -1059,7 +1054,6 @@ var weatherThemes = {
}
function updateDebug(t, palette, vantaColors, themeName) {
try {
var now = new Date();
var hh = now.getHours(), mm = now.getMinutes(), ss = now.getSeconds();
document.getElementById('dbg-time').textContent =
@@ -1098,38 +1092,27 @@ var weatherThemes = {
document.getElementById('dbg-vh-' + kk).textContent = '#' + ('00000' + vc.toString(16)).slice(-6);
}
}
} catch (e) {
console.log('updateDebug error:', e);
}
}
function animate() {
try {
var t = (Date.now() - startTime) / CYCLE % 1;
var c = getColor(t);
c = applyWeatherTheme(c);
effect.setOptions({
skyColor: c.sky,
cloudColor: c.cloud,
lightColor: c.light,
backgroundColor: c.bg,
backgroundAlpha: 0,
speed: currentThemeSpeed
});
document.body.style.backgroundColor = '#' + ('00000' + c.sky.toString(16)).slice(-6);
updateDebug(t, null, c, currentWeatherThemeName);
} catch (e) {
console.log('animate error:', e);
}
var t = (Date.now() - startTime) / CYCLE % 1;
var c = getColor(t);
c = applyWeatherTheme(c);
effect.setOptions({
skyColor: c.sky,
cloudColor: c.cloud,
lightColor: c.light,
backgroundColor: c.bg,
backgroundAlpha: 0,
speed: currentThemeSpeed
});
document.body.style.backgroundColor = '#' + ('00000' + c.sky.toString(16)).slice(-6);
updateDebug(t, null, c, currentWeatherThemeName);
requestAnimationFrame(animate);
}
function tick() {
try {
updateClockAndEvents();
} catch (e) {
console.log('tick error:', e);
}
updateClockAndEvents();
setTimeout(tick, 1000);
}