Profile memory
Comment cleanup
This commit is contained in:
fraxle
2026-05-18 23:02:41 +01:00
parent dded468bec
commit 85c415d1f5
16 changed files with 504 additions and 581 deletions
+7 -7
View File
@@ -1,14 +1,14 @@
// ════════════════════════════════════════════════════════════════════════
// almanac-calendar.js Extended event calendar for the "What's Coming"
// ------------------------------------------------------------------------
// almanac-calendar.js - Extended event calendar for the "What's Coming"
// panel and getUpcomingEvents() export.
//
// Includes all events from COSMIC_CALENDAR plus multi-year entries.
// Each entry has a `latHint`:
// Each entry has a 'latHint':
// null = global / no hint
// 'north' = better from northern latitudes
// 'south' = better from southern latitudes
// 'path:...' = specific eclipse path note
// ════════════════════════════════════════════════════════════════════════
// ------------------------------------------------------------------------
export const ALMANAC_CALENDAR = [
// 2026 events (covers rest of year from today)
@@ -133,7 +133,7 @@ export const ALMANAC_CALENDAR = [
type: 'meteor',
},
// ── 2027 ─────────────────────────────────────────────────────────────
// -- 2027 -------------------------------------------------------------
{
id: 'quadrantids-2027',
emoji: '☄️',
@@ -276,8 +276,8 @@ export function getVisibilityNote(entry, lat) {
return null;
}
// ─── MAIN ALMANAC EXPORT ─────────────────────────────────────────────────
// Returns events with peak dates in the next `days` days (default 90),
// --- MAIN ALMANAC EXPORT -------------------------------------------------
// Returns events with peak dates in the next 'days' days (default 90),
// sorted by peak date, with a visibility note added.
export function getUpcomingEvents(location, days = 90) {
const today = new Date();
+9 -9
View File
@@ -1,5 +1,5 @@
// ════════════════════════════════════════════════════════════════════════
// cosmic-calendar.js Hardcoded cosmic events (meteor showers, eclipses,
// ------------------------------------------------------------------------
// cosmic-calendar.js - Hardcoded cosmic events (meteor showers, eclipses,
// planetary oppositions/conjunctions) used by getActiveEvents.
//
// Each entry: { id, start: 'YYYY-MM-DD', end: 'YYYY-MM-DD',
@@ -7,11 +7,11 @@
// Active if today falls within [start, end] (inclusive).
// Night-only events (meteor showers, eclipses) are marked nightOnly: true
// so the cell icons only appear in night-time rows.
// ════════════════════════════════════════════════════════════════════════
// ------------------------------------------------------------------------
export const COSMIC_CALENDAR = [
// ── METEOR SHOWERS ──────────────────────────────────────────────────
// -- METEOR SHOWERS --------------------------------------------------
{
id: 'quadrantids-2026',
emoji: '☄️',
@@ -101,7 +101,7 @@ export const COSMIC_CALENDAR = [
start: '2026-12-17', end: '2026-12-26', peak: '2026-12-22',
},
// ── ECLIPSES ────────────────────────────────────────────────────────
// -- ECLIPSES --------------------------------------------------------
{
id: 'solar-eclipse-2026-aug',
emoji: '🌑',
@@ -125,7 +125,7 @@ export const COSMIC_CALENDAR = [
start: '2026-03-03', end: '2026-03-03',
},
// ── PLANETARY EVENTS ────────────────────────────────────────────────
// -- PLANETARY EVENTS ------------------------------------------------
{
id: 'saturn-opposition-2026',
emoji: '🪐',
@@ -160,7 +160,7 @@ export const COSMIC_CALENDAR = [
start: '2026-06-30', end: '2026-07-02',
},
// ── 2027 METEOR SHOWERS ─────────────────────────────────────────────
// -- 2027 METEOR SHOWERS ---------------------------------------------
{
id: 'quadrantids-2027',
emoji: '☄️',
@@ -234,7 +234,7 @@ export const COSMIC_CALENDAR = [
start: '2027-12-17', end: '2027-12-26', peak: '2027-12-22',
},
// ── 2027 ECLIPSES ───────────────────────────────────────────────────
// -- 2027 ECLIPSES ---------------------------------------------------
{
id: 'annular-solar-eclipse-2027-feb',
emoji: '🌑',
@@ -254,7 +254,7 @@ export const COSMIC_CALENDAR = [
start: '2027-08-02', end: '2027-08-02', peak: '2027-08-02',
},
// ── 2027 PLANETARY EVENTS ───────────────────────────────────────────
// -- 2027 PLANETARY EVENTS -------------------------------------------
{
id: 'mars-opposition-2027',
emoji: '🔴',
+6 -6
View File
@@ -1,13 +1,13 @@
// ════════════════════════════════════════════════════════════════════════
// dynamic-message.js Rewrites a cosmic event's message based on where
// ------------------------------------------------------------------------
// dynamic-message.js - Rewrites a cosmic event's message based on where
// today sits vs. the peak.
//
// Before peak : "is active and building peak on <date>. <detail>"
// On peak ±1d : "peaks tonight <detail>"
// After peak : "is past its peak (<date>) but still possibly visible <detail>"
// Before peak : "is active and building - peak on <date>. <detail>"
// On peak -1d : "peaks tonight - <detail>"
// After peak : "is past its peak (<date>) but still possibly visible - <detail>"
//
// Single-day events (start === end) keep their static message unchanged.
// ════════════════════════════════════════════════════════════════════════
// ------------------------------------------------------------------------
export function dynamicCosmicMessage(ev, dateStr) {
if (!ev.peak || ev.start === ev.end) return ev.message;
+4 -4
View File
@@ -1,14 +1,14 @@
// ════════════════════════════════════════════════════════════════════════
// lens-overlay.js Returns an SVG string for the event overlay inside
// ------------------------------------------------------------------------
// lens-overlay.js - Returns an SVG string for the event overlay inside
// the big ScopeReticle.
//
// Rendered INSIDE the lens clip path, BELOW the glass shine/shade layers.
// cx, cy = lens centre coords; lensR = lens radius.
//
// To add a new overlay for an event: add another `if (...)` block below
// To add a new overlay for an event: add another 'if (...)' block below
// that matches by event.emoji or event.id and returns an SVG fragment
// string. Return null when no overlay applies.
// ════════════════════════════════════════════════════════════════════════
// ------------------------------------------------------------------------
export function getLensOverlaySVG(event, cx, cy, lensR) {
if (!event) return null;
+6 -6
View File
@@ -1,5 +1,5 @@
// ════════════════════════════════════════════════════════════════════════
// weather-checks.js Weather-derived event detectors.
// ------------------------------------------------------------------------
// weather-checks.js - Weather-derived event detectors.
//
// Computed in real-time from the forecast data.
// Each checker function receives (rows [, location]) and returns an event
@@ -9,7 +9,7 @@
// To add a new weather event: write a checkXxx(rows, location) function
// below, export it, and add it to the checks[] array inside
// getActiveEvents() (in events.js).
// ════════════════════════════════════════════════════════════════════════
// ------------------------------------------------------------------------
export function checkStargazing(rows) {
// Great stargazing: mostly clear night hours with low cloud
@@ -31,7 +31,7 @@ export function checkStargazing(rows) {
export function checkSunset(rows, location) {
// Find the actual sunset window: the LAST contiguous run of rows where
// solar elevation is in the golden/civil-twilight band (-3° to 8°).
// solar elevation is in the golden/civil-twilight band (-3- to 8-).
// This distinguishes sunset from sunrise (which is the first such run).
const twilightIndices = rows
.map((r, i) => ({ r, i }))
@@ -52,11 +52,11 @@ export function checkSunset(rows, location) {
runs.push(run);
// Use the LAST run (sunset). If only one run exists it's either sunrise-only
// or a single dusk window use it but we'll label generically.
// or a single dusk window - use it but we'll label generically.
const sunsetRun = runs[runs.length - 1];
const sunsetRows = sunsetRun.map(({ r }) => r);
const isSunrise = runs.length === 1 && sunsetRows[0].elev < sunsetRows[sunsetRows.length - 1].elev;
// If sun is rising through the band this is a sunrise window, not sunset skip.
// If sun is rising through the band this is a sunrise window, not sunset - skip.
if (isSunrise) return null;
const avgCloud = sunsetRows.reduce((s, r) => s + r.cc, 0) / sunsetRows.length;