Main #3
@@ -230,6 +230,8 @@ td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|||||||
}
|
}
|
||||||
.aspect-grid th { color: var(--ink); font-weight: 400; font-size: 17px; background: var(--panel-2); }
|
.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; }
|
.aspect-grid .grid-angle { font: 600 11px var(--font-body); color: var(--gold); letter-spacing: 0.3px; }
|
||||||
|
.aspect-grid td.void, .aspect-grid td.corner { border: 0; background: none; }
|
||||||
|
.aspect-grid tbody td:not(.void):hover { background: var(--panel-2); }
|
||||||
.asp-conjunction { color: var(--gold); }
|
.asp-conjunction { color: var(--gold); }
|
||||||
.asp-trine, .asp-sextile { color: var(--harmonic); }
|
.asp-trine, .asp-sextile { color: var(--harmonic); }
|
||||||
.asp-square { color: var(--square); }
|
.asp-square { color: var(--square); }
|
||||||
|
|||||||
@@ -84,13 +84,37 @@ function AspectGrid({ chart }: { chart: Chart }) {
|
|||||||
byPair.set(`${a.point2}|${a.point1}`, a);
|
byPair.set(`${a.point2}|${a.point1}`, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const label = ([id, text]: [string, string]) => (
|
||||||
|
<span className={text.length > 2 ? "sym" : "grid-angle"} aria-label={pointName(id)} role="img">
|
||||||
|
{text}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
// Lower triangle with both headers: rows from the 2nd point, columns up to the last but one.
|
||||||
|
const cols = rows.slice(0, -1);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="aspect-grid-wrap">
|
<div className="aspect-grid-wrap">
|
||||||
<table className="aspect-grid" aria-label="Fényszögmátrix">
|
<table className="aspect-grid" aria-label="Fényszögmátrix">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td className="corner" />
|
||||||
|
{cols.map((c) => (
|
||||||
|
<th key={c[0]} scope="col" title={pointName(c[0])}>
|
||||||
|
{label(c)}
|
||||||
|
</th>
|
||||||
|
))}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{rows.map(([id, label], i) => (
|
{rows.slice(1).map((row, r) => {
|
||||||
|
const [id] = row;
|
||||||
|
return (
|
||||||
<tr key={id}>
|
<tr key={id}>
|
||||||
{rows.slice(0, i).map(([other]) => {
|
<th scope="row" title={pointName(id)}>
|
||||||
|
{label(row)}
|
||||||
|
</th>
|
||||||
|
{cols.map(([other], j) => {
|
||||||
|
if (j > r) return <td key={other} className="void" />;
|
||||||
const a = byPair.get(`${id}|${other}`);
|
const a = byPair.get(`${id}|${other}`);
|
||||||
const info = a ? ASPECTS[a.aspect] : undefined;
|
const info = a ? ASPECTS[a.aspect] : undefined;
|
||||||
const text = a ? `${pointName(other)} ${info?.hu ?? a.aspect} ${pointName(id)}` : undefined;
|
const text = a ? `${pointName(other)} ${info?.hu ?? a.aspect} ${pointName(id)}` : undefined;
|
||||||
@@ -104,13 +128,9 @@ function AspectGrid({ chart }: { chart: Chart }) {
|
|||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
<th scope="row" title={pointName(id)}>
|
|
||||||
<span className={label.length > 2 ? "sym" : "grid-angle"} aria-label={pointName(id)} role="img">
|
|
||||||
{label}
|
|
||||||
</span>
|
|
||||||
</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user