updated relationship display in cycle details to use inline links instead of alpha nav buttons, and added related cycle links to planet details; added element display to astrology alphabet details; updated decan range display in calendar detail panels; updated tarot card detail script to latest version; added element script to index.html
This commit is contained in:
+42
-3
@@ -95,6 +95,18 @@
|
||||
return normalizePlanetInfluence(ICHING_PLANET_BY_PLANET_ID[planetId]);
|
||||
}
|
||||
|
||||
function resolvePlanetId(value) {
|
||||
const normalizedValue = normalizePlanetInfluence(value);
|
||||
if (!normalizedValue) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return Object.entries(ICHING_PLANET_BY_PLANET_ID).find(([planetId, label]) => (
|
||||
normalizePlanetInfluence(planetId) === normalizedValue
|
||||
|| normalizePlanetInfluence(label) === normalizedValue
|
||||
))?.[0] || "";
|
||||
}
|
||||
|
||||
function getBinaryPattern(value, expectedLength = 0) {
|
||||
const raw = String(value || "").trim();
|
||||
if (!raw) {
|
||||
@@ -437,6 +449,35 @@
|
||||
});
|
||||
}
|
||||
|
||||
function renderPlanetInfluence(entry, elements) {
|
||||
if (!elements?.ichingDetailPlanetEl) {
|
||||
return;
|
||||
}
|
||||
|
||||
clearChildren(elements.ichingDetailPlanetEl);
|
||||
|
||||
const label = entry?.planetaryInfluence || "--";
|
||||
const planetId = resolvePlanetId(entry?.planetaryInfluence)
|
||||
|| resolvePlanetId(resolveAssociationPlanetInfluence(entry?.associations));
|
||||
|
||||
if (!planetId) {
|
||||
elements.ichingDetailPlanetEl.textContent = label;
|
||||
return;
|
||||
}
|
||||
|
||||
const button = document.createElement("button");
|
||||
button.type = "button";
|
||||
button.className = "detail-inline-link";
|
||||
button.textContent = label;
|
||||
button.addEventListener("click", () => {
|
||||
document.dispatchEvent(new CustomEvent("nav:planet", {
|
||||
detail: { planetId }
|
||||
}));
|
||||
});
|
||||
|
||||
elements.ichingDetailPlanetEl.appendChild(button);
|
||||
}
|
||||
|
||||
function renderDetail(entry, elements) {
|
||||
if (!entry || !elements) {
|
||||
return;
|
||||
@@ -482,9 +523,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (elements.ichingDetailPlanetEl) {
|
||||
elements.ichingDetailPlanetEl.textContent = entry.planetaryInfluence || "--";
|
||||
}
|
||||
renderPlanetInfluence(entry, elements);
|
||||
|
||||
renderKeywords(entry, elements);
|
||||
renderTrigrams(entry, elements);
|
||||
|
||||
Reference in New Issue
Block a user