Forum: the attached chart's wheel in the question

A question with a shared chart shows the chart's wheel, one with a shared
synastry the two charts on one wheel, at a fixed size beside the details
(above them on phones). The forum sends the wheel's data (positions, angles,
houses, aspects; never birth date, time or place) to logged-in members only.

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-26 16:57:04 +00:00
co-authored by Claude Opus 5.5
parent e7767573d7
commit 67cb3c6b8c
5 changed files with 114 additions and 39 deletions
@@ -725,3 +725,12 @@ a.fh-online-item:hover { color: var(--gold); }
.flink-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.flink-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.flink .fp-link { display: inline-flex; align-items: center; padding: 0; text-decoration: none; }
/* The attached chart's wheel: a fixed size, beside the details (above them on phones). */
.fshare-info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.fshare-drawn { flex-direction: column; align-items: center; }
.fshare-wheel { flex: none; width: 240px; height: 240px; }
.fshare-wheel svg { display: block; width: 100%; height: 100%; }
@media (min-width: 640px) {
.fshare-drawn { flex-direction: row; align-items: center; gap: 18px; }
}
@@ -1,5 +1,7 @@
import Link from "next/link";
import { ChartWheel } from "@/components/ChartWheel";
import { SynastryWheel } from "@/components/SynastryWheel";
import { POINTS, SIGNS, signName } from "@/lib/astro";
import type { ShareCardData } from "@/lib/forum";
@@ -36,44 +38,60 @@ export function ShareCard({ share, onRemove }: { share: ShareCardData; onRemove?
);
}
const points = share.points ?? [];
const drawing = share.chart ? (
<ChartWheel chart={share.chart} timeKnown={share.time_known ?? false} title="A csatolt képlet" />
) : share.pair ? (
<SynastryWheel
chart1={share.pair.chart1}
chart2={share.pair.chart2}
time1={share.pair.time1}
time2={share.pair.time2}
aspects={share.pair.aspects}
name1="Első képlet"
name2="Második képlet"
/>
) : null;
return (
<div className="fshare">
<div className="fshare-head">
<span className="eyebrow">{EYEBROW[share.kind]}</span>
{onRemove && (
<button type="button" className="fp-link" onClick={onRemove} aria-label="Képlet levétele">
×
</button>
<div className={drawing ? "fshare fshare-drawn" : "fshare"}>
{drawing && <div className="fshare-wheel">{drawing}</div>}
<div className="fshare-info">
<div className="fshare-head">
<span className="eyebrow">{EYEBROW[share.kind]}</span>
{onRemove && (
<button type="button" className="fp-link" onClick={onRemove} aria-label="Képlet levétele">
×
</button>
)}
</div>
<strong className="fshare-title">{share.title}</strong>
{share.summary && <span className="fshare-summary">„{share.summary}”</span>}
{points.length > 0 && (
<ul className="fshare-points">
{points.map((p) => (
<li key={p.id}>
<span className="sym" aria-hidden="true">
{POINTS[p.id]?.glyph ?? ""}
</span>{" "}
{POINT_LABEL[p.id] ?? p.id}{" "}
<span className="sym" aria-hidden="true">
{SIGNS[p.sign]?.glyph ?? ""}
</span>{" "}
{signName(p.sign)}
{p.degree !== null && ` ${p.degree}°`}
{p.house !== null && <span className="hint"> · {p.house}. ház</span>}
</li>
))}
</ul>
)}
{share.kind !== "synastry" && share.time_known === false && (
<span className="hint">A születési idő ismeretlen, ezért házak és Aszcendens nincsenek.</span>
)}
{share.slug && (
<Link href={`/s/${share.slug}`} className="btn btn-sm fshare-open" target="_blank" rel="noopener">
Megnyitom ›
</Link>
)}
</div>
<strong className="fshare-title">{share.title}</strong>
{share.summary && <span className="fshare-summary">„{share.summary}”</span>}
{points.length > 0 && (
<ul className="fshare-points">
{points.map((p) => (
<li key={p.id}>
<span className="sym" aria-hidden="true">
{POINTS[p.id]?.glyph ?? ""}
</span>{" "}
{POINT_LABEL[p.id] ?? p.id}{" "}
<span className="sym" aria-hidden="true">
{SIGNS[p.sign]?.glyph ?? ""}
</span>{" "}
{signName(p.sign)}
{p.degree !== null && ` ${p.degree}°`}
{p.house !== null && <span className="hint"> · {p.house}. ház</span>}
</li>
))}
</ul>
)}
{share.kind !== "synastry" && share.time_known === false && (
<span className="hint">A születési idő ismeretlen, ezért házak és Aszcendens nincsenek.</span>
)}
{share.slug && (
<Link href={`/s/${share.slug}`} className="btn btn-sm fshare-open" target="_blank" rel="noopener">
Megnyitom ›
</Link>
)}
</div>
);
}
+6
View File
@@ -2,6 +2,8 @@
// by its server and client components.
/** The forum's colours: light by default, dark on request (a cookie). */
import type { ChartResult, InterAspect } from "./types";
export const FORUM_THEME_COOKIE = "sf_forum_theme";
export type ForumTheme = "light" | "dark";
@@ -149,6 +151,10 @@ export interface ShareCardData {
summary?: string | null;
points?: { id: string; sign: string; degree: number | null; house: number | null }[];
time_known?: boolean;
/** The chart's wheel (a shared chart). */
chart?: ChartResult | null;
/** The two charts on one wheel (a shared synastry). */
pair?: { chart1: ChartResult; chart2: ChartResult; time1: boolean; time2: boolean; aspects: InterAspect[] } | null;
}
export interface ThreadPage {