Moon and retrograde calendars, "today in the sky" on the own chart
CI / test (push) Successful in 2m6s
CI / build (push) Skipped
CI / deploy (push) Skipped

New public pages: /holdnaptar (new and full moons, quarters, eclipses and
the Moon's sign changes, month by month, with the Moon of today) and
/retrograd (the retrograde periods of Mercury to Pluto with their shadows,
and which planets are retrograde now), each with a page per year around
the current one. The own chart gets a "Ma az égen" card: the Moon's sign,
phase and natal house, the tightest transits to the chart in fixed
sentences, and the retrograde planets. No AI, nothing stored.

The events come from astro-engine (sampling and bisection, checked against
swetest and the 2026 eclipses) through horoscope-api GET /v1/sky and
/v1/sky/events; the backend serves them at /v1/public/sky… and keeps them
in memory (the sky now for five minutes, a year's events for good). Links
in the mobile menu, the footer, the sitemap and the free tools on the home
page; the desktop header is unchanged (it is full at 1280 px).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-23 17:21:36 +00:00
co-authored by Claude Opus 5.5
parent 3255e939c4
commit 699ce2abbd
30 changed files with 2230 additions and 5 deletions
@@ -12,6 +12,8 @@ export function PublicFooter() {
<Link href="/szuletesi-horoszkop">Születési horoszkóp</Link>
<Link href="/csillagjegyek">Csillagjegyek</Link>
<Link href="/hires-emberek">Híres emberek</Link>
<Link href="/holdnaptar">Holdnaptár</Link>
<Link href="/retrograd">Retrográd bolygók</Link>
<Link href="/pelda">Példaelemzés</Link>
<Link href="/kartyajoslas/pelda">Példajóslás</Link>
<Link href="/aszf">ÁSZF</Link>
@@ -41,7 +41,7 @@ export function PublicHeader({
current,
}: {
onHome?: boolean;
current?: "pelda" | "horoszkop" | "csillagjegyek" | "hires";
current?: "pelda" | "horoszkop" | "csillagjegyek" | "hires" | "holdnaptar" | "retrograd";
}) {
const home = onHome ? "" : "/";
const here = (page: typeof current) => (current === page ? "page" : undefined);
@@ -88,6 +88,8 @@ export function PublicHeader({
{ href: "/szuletesi-horoszkop", label: "Születési horoszkóp" },
{ href: "/csillagjegyek", label: "Csillagjegyek" },
{ href: "/hires-emberek", label: "Híres emberek" },
{ href: "/holdnaptar", label: "Holdnaptár" },
{ href: "/retrograd", label: "Retrográd bolygók" },
],
},
]}
@@ -0,0 +1,151 @@
import Link from "next/link";
import { MOON_PHASES, POINTS, SIGNS, orbText } from "@/lib/astro";
import {
HOUSE_THEMES,
LUNATION_NAMES,
MOON_IN_SIGN,
SIGN_IN,
SIGN_INTO,
dayWord,
localDate,
transitLine,
transitMeaning,
until,
withArticle,
} from "@/lib/skyText";
import { natalHouse, todaysTransits } from "@/lib/transits";
import type { ChartResult, SkyNow } from "@/lib/types";
/**
* "Today in the sky" on the user's own chart: the Moon (sign, phase, the natal
* house it crosses), the tightest transits to the chart, and the retrograde
* planets. Calculated from the shared sky; nothing is stored, no AI.
*/
export function SkyToday({ sky, chart, timeKnown }: { sky: SkyNow; chart: ChartResult; timeKnown: boolean }) {
const moon = sky.moon;
const sign = moon.position.sign;
const house = timeKnown ? natalHouse(chart, moon.position.longitude) : null;
const transits = todaysTransits(sky.planets, chart, timeKnown);
const retro = sky.planets.filter((p) => p.retrograde);
const mercury = sky.planets.find((p) => p.id === "mercury");
const nextMercury = mercury && !mercury.retrograde ? mercury.next_station : null;
const full = moon.next_phases.find((p) => p.kind === "full_moon");
const fresh = moon.next_phases.find((p) => p.kind === "new_moon");
const thisYear = sky.local_time.slice(0, 4);
return (
<section className="card sky-today" aria-labelledby="sky-today-title">
<div className="sky-today-head">
<h2 id="sky-today-title">Ma az égen</h2>
<span className="hint">Frissítve {sky.local_time.slice(11, 16)}-kor</span>
</div>
<div className="sky-grid">
<div className="sky-col">
<span className="eyebrow">A Hold</span>
<p className="sky-lead">
<span className="sky-glyph" aria-hidden="true">
{SIGNS[sign]?.glyph}
</span>
<strong>Hold {withArticle(SIGN_IN[sign] ?? sign)}</strong>
</p>
<p className="hint">
{MOON_PHASES[moon.phase] ?? moon.phase}, {Math.round(moon.illumination * 100)}% megvilágítás.{" "}
{MOON_IN_SIGN[sign]}
</p>
{house && (
<p>
Ma a {house}. házadban jár: {HOUSE_THEMES[house]} kerülnek előtérbe.
</p>
)}
{moon.sign_change && (
<p className="hint">
{capitalize(dayWord(moon.sign_change.local_time, sky.local_time))} {moon.sign_change.local_time.slice(11, 16)}-kor
lép {withArticle(SIGN_INTO[moon.sign_change.sign] ?? moon.sign_change.sign)}.
</p>
)}
<ul className="sky-list">
{[full, fresh]
.filter((p) => p !== undefined)
.sort((a, b) => a.local_time.localeCompare(b.local_time))
.map((p) => (
<li key={p.kind}>
<span>{LUNATION_NAMES[p.kind]}</span>
<span className="num">
{localDate(p.local_time, { short: true, time: true })}, {SIGNS[p.position.sign]?.hu}
</span>
</li>
))}
</ul>
<Link href="/holdnaptar" className="sky-more">
Holdnaptár →
</Link>
</div>
<div className="sky-col">
<span className="eyebrow">A képletedhez</span>
{transits.length === 0 ? (
<p className="hint">Most nincs szoros fényszög az égbolt és a képleted között.</p>
) : (
<ul className="sky-transits">
{transits.map((t) => (
<li key={`${t.transiting}-${t.aspect}-${t.natal}`}>
<strong>{transitLine(t.transiting, t.aspect, t.natal)}</strong>
<span>{transitMeaning(t.transiting, t.aspect, t.natal)}</span>
<span className="hint">
{t.applying ? "Erősödik" : "Már gyengül"}, {orbText(t.orb)} a pontostól.
</span>
</li>
))}
</ul>
)}
{!timeKnown && (
<p className="hint">Születési idő nélkül a Holdad és az aszcendensed kimarad, mert nem pontos.</p>
)}
</div>
<div className="sky-col">
<span className="eyebrow">Retrográd bolygók</span>
{retro.length === 0 ? (
<p>Most egy bolygó sem retrográd.</p>
) : (
<ul className="sky-list">
{retro.map((p) => (
<li key={p.id}>
<span>
<span className="sky-glyph-sm" aria-hidden="true">
{POINTS[p.id]?.glyph}
</span>{" "}
{POINTS[p.id]?.hu} <span className="hint">{withArticle(SIGN_IN[p.position.sign] ?? "")}</span>
</span>
{p.next_station && (
<span className="num">
{until(p.next_station.local_time, {
short: true,
year: p.next_station.local_time.slice(0, 4) !== thisYear,
})}
</span>
)}
</li>
))}
</ul>
)}
{nextMercury && (
<p className="hint">
A következő Merkúr-retrográd:{" "}
{localDate(nextMercury.local_time, { year: nextMercury.local_time.slice(0, 4) !== thisYear })},{" "}
{withArticle(SIGN_IN[nextMercury.position.sign] ?? "")}.
</p>
)}
<Link href="/retrograd" className="sky-more">
Retrográd naptár →
</Link>
</div>
</div>
</section>
);
}
function capitalize(text: string): string {
return text.charAt(0).toUpperCase() + text.slice(1);
}
@@ -0,0 +1,25 @@
import Link from "next/link";
/** Previous and next year of a calendar page; the current year is the page without a year. */
export function YearNav({ base, year, current, around }: { base: string; year: number; current: number; around: number }) {
const href = (y: number) => (y === current ? base : `${base}/${y}`);
return (
<nav className="year-nav" aria-label="Év választása">
{year - 1 >= current - around ? (
<Link href={href(year - 1)} className="btn btn-sm">
‹ {year - 1}
</Link>
) : (
<span />
)}
<strong className="num">{year}</strong>
{year + 1 <= current + around ? (
<Link href={href(year + 1)} className="btn btn-sm">
{year + 1} ›
</Link>
) : (
<span />
)}
</nav>
);
}