building new tarot frame component for custom layout
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
getSelectedCardId: () => "",
|
||||
getHouseTopCardsVisible: () => true,
|
||||
getHouseTopInfoModes: () => ({}),
|
||||
getMagickDataset: () => null,
|
||||
getHouseBottomCardsVisible: () => true,
|
||||
getHouseBottomInfoModes: () => ({})
|
||||
};
|
||||
@@ -326,12 +327,33 @@
|
||||
const courtWindow = getFirstCardRelationByType(card, "courtDateWindow")?.data || null;
|
||||
const decan = getFirstCardRelationByType(card, "decan")?.data || null;
|
||||
const calendar = getFirstCardRelationByType(card, "calendarMonth")?.data || null;
|
||||
const zodiac = getFirstCardRelationByType(card, "zodiacCorrespondence")?.data
|
||||
|| getFirstCardRelationByType(card, "zodiac")?.data
|
||||
|| null;
|
||||
|
||||
const primary = normalizeLabelText(courtWindow?.dateRange || decan?.dateRange || calendar?.dateRange || calendar?.name);
|
||||
let zodiacDateRange = "";
|
||||
if (zodiac?.signId || zodiac?.id || zodiac?.name) {
|
||||
const zodiacId = normalizeLabelText(zodiac.signId || zodiac.id || zodiac.name).toLowerCase();
|
||||
const sign = config.getMagickDataset?.()?.grouped?.astrology?.zodiac?.[zodiacId] || null;
|
||||
const rulesFrom = Array.isArray(sign?.rulesFrom) ? sign.rulesFrom : [];
|
||||
if (rulesFrom.length === 2) {
|
||||
const [[startMonth, startDay], [endMonth, endDay]] = rulesFrom;
|
||||
const monthLabels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
||||
const startLabel = Number.isFinite(Number(startMonth)) && Number.isFinite(Number(startDay))
|
||||
? `${monthLabels[Math.max(0, Math.min(11, Number(startMonth) - 1))]} ${Number(startDay)}`
|
||||
: "";
|
||||
const endLabel = Number.isFinite(Number(endMonth)) && Number.isFinite(Number(endDay))
|
||||
? `${monthLabels[Math.max(0, Math.min(11, Number(endMonth) - 1))]} ${Number(endDay)}`
|
||||
: "";
|
||||
zodiacDateRange = normalizeLabelText(startLabel && endLabel ? `${startLabel} - ${endLabel}` : startLabel || endLabel);
|
||||
}
|
||||
}
|
||||
|
||||
const primary = normalizeLabelText(courtWindow?.dateRange || decan?.dateRange || calendar?.dateRange || zodiacDateRange || calendar?.name);
|
||||
const secondary = normalizeLabelText(
|
||||
calendar?.name && primary !== calendar.name
|
||||
? calendar.name
|
||||
: decan?.signName
|
||||
: decan?.signName || zodiac?.name
|
||||
);
|
||||
|
||||
if (!primary) {
|
||||
@@ -442,6 +464,10 @@
|
||||
pushLine(buildPathNumberLabel(card)?.primary);
|
||||
}
|
||||
|
||||
if (getTopInfoModeEnabled("date")) {
|
||||
pushLine(buildDateLabel(card)?.primary);
|
||||
}
|
||||
|
||||
if (!lines.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user