diff --git a/services/frontend/src/app/globals.css b/services/frontend/src/app/globals.css index 4b331b1..7c80eb4 100644 --- a/services/frontend/src/app/globals.css +++ b/services/frontend/src/app/globals.css @@ -220,6 +220,28 @@ td.num { font-variant-numeric: tabular-nums; white-space: nowrap; } .legend-square { background: var(--square); } .legend-opposition { background: var(--tense); } .aspect-tag { white-space: nowrap; } + +/* Aspect grid */ +.aspect-grid-wrap { overflow-x: auto; } +.aspect-grid { width: auto; border-collapse: collapse; font-size: 16px; } +.aspect-grid td, .aspect-grid th { + width: 30px; min-width: 30px; height: 30px; padding: 0; text-align: center; vertical-align: middle; + border: 1px solid var(--line); line-height: 1; +} +.aspect-grid th { color: var(--ink); font-weight: 400; font-size: 17px; background: var(--panel-2); } +.aspect-grid .grid-angle { font: 600 11px var(--font-body); color: var(--gold); letter-spacing: 0.3px; } +.asp-conjunction { color: var(--gold); } +.asp-trine, .asp-sextile { color: var(--harmonic); } +.asp-square { color: var(--square); } +.asp-opposition { color: var(--tense); } +.details > summary { cursor: pointer; color: var(--gold); min-height: 44px; display: flex; align-items: center; } +.details[open] > summary { margin-bottom: 8px; } +@media (max-width: 640px) { + .aspect-grid { font-size: 13px; } + .aspect-grid td, .aspect-grid th { width: 23px; min-width: 23px; height: 23px; } + .aspect-grid th { font-size: 14px; } + .aspect-grid .grid-angle { font-size: 9px; } +} .aspect-harmonic { color: var(--harmonic); } .aspect-tense { color: var(--tense); } .aspect-neutral { color: var(--gold); } diff --git a/services/frontend/src/components/ChartTables.tsx b/services/frontend/src/components/ChartTables.tsx index d49463a..ef8b4a4 100644 --- a/services/frontend/src/components/ChartTables.tsx +++ b/services/frontend/src/components/ChartTables.tsx @@ -1,5 +1,5 @@ import { ANGLES, ASPECTS, POINTS, SIGNS, dms, orbText, pointName, signName } from "@/lib/astro"; -import type { Chart, Position } from "@/lib/types"; +import type { Aspect, Chart, Position } from "@/lib/types"; function Pos({ p }: { p: Position }) { return ( @@ -46,6 +46,77 @@ export function BigThree({ chart }: { chart: Chart }) { ); } +// Rows and columns of the aspect grid: the points drawn on the wheel, then the angles. +const GRID_POINTS = [ + "sun", + "moon", + "mercury", + "venus", + "mars", + "jupiter", + "saturn", + "uranus", + "neptune", + "pluto", + "north_node", + "lilith", + "chiron", +]; +const GRID_ANGLES: [string, string][] = [ + ["ascendant", "AC"], + ["midheaven", "MC"], +]; + +/** The usual triangular aspect grid: only the aspect symbols, the values are in the details below. */ +function AspectGrid({ chart }: { chart: Chart }) { + const result = chart.chart; + const present = new Set(result.points.map((p) => p.id)); + const rows: [string, string][] = GRID_POINTS.filter((id) => present.has(id)).map((id) => [ + id, + POINTS[id]?.glyph ?? id, + ]); + if (chart.highlights.time_known) { + for (const [key, label] of GRID_ANGLES) if (result.angles?.[key]) rows.push([key, label]); + } + const byPair = new Map(); + for (const a of result.aspects ?? []) { + byPair.set(`${a.point1}|${a.point2}`, a); + byPair.set(`${a.point2}|${a.point1}`, a); + } + + return ( +
+ + + {rows.map(([id, label], i) => ( + + {rows.slice(0, i).map(([other]) => { + const a = byPair.get(`${id}|${other}`); + const info = a ? ASPECTS[a.aspect] : undefined; + const text = a ? `${pointName(other)} ${info?.hu ?? a.aspect} ${pointName(id)}` : undefined; + return ( + + ); + })} + + + ))} + +
+ {a && ( + + {info?.glyph ?? "?"} + + )} + + 2 ? "sym" : "grid-angle"} aria-label={pointName(id)} role="img"> + {label} + +
+
+ ); +} + /** Positions, angles, house cusps and aspects of a natal chart. */ export function ChartTables({ chart }: { chart: Chart }) { const result = chart.chart; @@ -140,48 +211,54 @@ export function ChartTables({ chart }: { chart: Chart }) { )} {aspects.length > 0 && ( -
-

Fényszögek

- - - - - - - - - - {aspects.map((a) => { - const info = ASPECTS[a.aspect]; - return ( - - - - +
+

Fényszögek

+ +
+ Részletek: orbisz, közeledő vagy távolodó +
+
FényszögOrbisz - Közeledő vagy távolodó -
- {" "} - {pointName(a.point1)}{" "} - - {" "} - {info?.hu ?? a.aspect} - {" "} - {" "} - {pointName(a.point2)} - {orbText(a.orb)} - {a.applying === true ? "közeledő" : a.applying === false ? "távolodó" : ""} -
+ + + + + - ); - })} - -
FényszögOrbisz + Közeledő vagy távolodó +
+ + + {aspects.map((a) => { + const info = ASPECTS[a.aspect]; + return ( + + + {" "} + {pointName(a.point1)}{" "} + + {" "} + {info?.hu ?? a.aspect} + {" "} + {" "} + {pointName(a.point2)} + + {orbText(a.orb)} + + {a.applying === true ? "közeledő" : a.applying === false ? "távolodó" : ""} + + + ); + })} + + +
+ )} {!timeKnown && (