Fix tables colours and moon phase
This commit is contained in:
fraxle
2026-05-24 01:21:14 +01:00
parent 7824ceb9f6
commit 0853b9852b
3 changed files with 75 additions and 78 deletions
+4 -4
View File
@@ -179,9 +179,9 @@ export function SkyScope({ elev, dt, glob = 0, size = 26 }) {
const phase = moonPhaseFraction(dt);
const moonR = innerR * 0.55;
const phaseOffset = Math.cos(2 * Math.PI * phase) * moonR;
const phaseOffset = Math.cos(Math.PI * phase) * moonR;
const moonLitFromRight = phase < 0.5;
const shadowCx = r + (moonLitFromRight ? -phaseOffset : phaseOffset);
const shadowCx = r + phaseOffset;
const grass = grassFillForElev(elev);
const uid = `ss-${size}-${Math.round(elev * 10)}-${Math.round(phase * 1000)}-${isRising ? 'r' : 's'}`;
@@ -424,9 +424,9 @@ export function ScopeReticle({ value, cat, loading, elev = 0, dt = new Date(), g
const sunGlowPeak = 0.30 + radFrac * 0.45 + horizFrac * 0.15; // centre opacity
const moonDrawR = 15;
const moonY = cy - 45;
const phaseOffset = Math.cos(2 * Math.PI * phase) * moonDrawR;
const phaseOffset = Math.cos(Math.PI * phase) * moonDrawR;
const moonLitFromRight = phase < 0.5;
const moonShadowCx = cx + (moonLitFromRight ? -phaseOffset : phaseOffset);
const moonShadowCx = cx + phaseOffset;
// Readout text colours flip with day/night for legibility against the sky.
const readoutColor = isDay ? '#1e1208' : '#f5edd6';
const readoutMutedColor = isDay ? '#9a7d5a' : '#d4c5a8';