diff --git a/app/public/app-ui.css b/app/public/app-ui.css index 136755c..f1e4b19 100644 --- a/app/public/app-ui.css +++ b/app/public/app-ui.css @@ -5,7 +5,8 @@ --topbar-h: 58px; } html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; } -body { overscroll-behavior-y: none; } +/* on (the viewport): putting this on can block wheel scrolling when body is a scroll container */ +html { overscroll-behavior-y: none; } button, a, summary { touch-action: manipulation; } /* ── Layout ── */ diff --git a/app/public/dashboard-ui.js b/app/public/dashboard-ui.js index 3cb5870..e743063 100644 --- a/app/public/dashboard-ui.js +++ b/app/public/dashboard-ui.js @@ -106,7 +106,9 @@ function sunTimes(noonMs, lat, lon) { if (cosW > 1 || cosW < -1) return null; // polar day/night const w = Math.acos(cosW) / RAD; const toMs = (j) => (j - 2440587.5) * MS_DAY; - return { rise: toMs(Jt - w / 360), set: toMs(Jt + w / 360), noon: toMs(Jt) }; + // The julian-day rounding above can land on the neighbouring day; align to the requested day + const shift = Math.round((noonMs - toMs(Jt)) / MS_DAY) * MS_DAY; + return { rise: toMs(Jt - w / 360) + shift, set: toMs(Jt + w / 360) + shift, noon: toMs(Jt) + shift }; } const SYNODIC = 29.530588853; const NEW_MOON = Date.UTC(2000, 0, 6, 18, 14); diff --git a/app/public/dashboard.html b/app/public/dashboard.html index 3fbe434..deb2a95 100644 --- a/app/public/dashboard.html +++ b/app/public/dashboard.html @@ -335,7 +335,8 @@ canvas.sparkline { display: block; width: 100%; height: 22px; margin-top: 0.4rem /* ── iPhone / touch ── */ html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; } -body { overscroll-behavior-y: none; min-height: 100vh; min-height: 100dvh; } +html { overscroll-behavior-y: none; } +body { min-height: 100vh; min-height: 100dvh; } .header { padding-top: calc(1rem + env(safe-area-inset-top)); padding-left: calc(1.5rem + env(safe-area-inset-left)); padding-right: calc(1.5rem + env(safe-area-inset-right)); } .page { padding-left: calc(1rem + env(safe-area-inset-left)); padding-right: calc(1rem + env(safe-area-inset-right)); padding-bottom: calc(4rem + env(safe-area-inset-bottom)); } /* Let the page scroll when a finger starts on a chart; taps/long-press still show tooltips */