update to frame and tarot times
This commit is contained in:
@@ -795,6 +795,48 @@
|
||||
return request;
|
||||
}
|
||||
|
||||
function openCardLightboxById(cardIdToOpen, options = {}) {
|
||||
const normalizedCardId = String(cardIdToOpen || "").trim();
|
||||
if (!normalizedCardId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const primaryCardRequest = buildLightboxCardRequestById(normalizedCardId);
|
||||
if (!primaryCardRequest?.src) {
|
||||
return;
|
||||
}
|
||||
|
||||
const activeDeckId = String(getActiveDeck?.() || primaryCardRequest.deckId || "").trim();
|
||||
const availableCompareDecks = getRegisteredDeckList().filter((deck) => deck.id && deck.id !== activeDeckId);
|
||||
const onSelectCardId = typeof options?.onSelectCardId === "function"
|
||||
? options.onSelectCardId
|
||||
: (nextCardId) => {
|
||||
const latestElements = getElements();
|
||||
selectCardById(nextCardId, latestElements);
|
||||
scrollCardIntoView(nextCardId, latestElements);
|
||||
};
|
||||
|
||||
window.TarotUiLightbox?.open?.({
|
||||
src: primaryCardRequest.src,
|
||||
altText: primaryCardRequest.altText,
|
||||
label: primaryCardRequest.label,
|
||||
cardId: primaryCardRequest.cardId,
|
||||
deckId: primaryCardRequest.deckId || activeDeckId,
|
||||
deckLabel: primaryCardRequest.deckLabel || "",
|
||||
compareDetails: primaryCardRequest.compareDetails || [],
|
||||
allowOverlayCompare: true,
|
||||
allowDeckCompare: true,
|
||||
activeDeckId,
|
||||
activeDeckLabel: primaryCardRequest.deckLabel || "",
|
||||
availableCompareDecks,
|
||||
maxCompareDecks: 2,
|
||||
sequenceIds: state.cards.map((card) => card.id),
|
||||
resolveCardById: buildLightboxCardRequestById,
|
||||
resolveDeckCardById: buildDeckLightboxCardRequest,
|
||||
onSelectCardId
|
||||
});
|
||||
}
|
||||
|
||||
function renderList(elements) {
|
||||
if (!elements?.tarotCardListEl) {
|
||||
return;
|
||||
@@ -858,31 +900,15 @@
|
||||
selectCardById,
|
||||
openCardLightbox: (src, altText, options = {}) => {
|
||||
const cardId = String(options?.cardId || "").trim();
|
||||
const primaryCardRequest = cardId ? buildLightboxCardRequestById(cardId) : null;
|
||||
const activeDeckId = String(getActiveDeck?.() || primaryCardRequest?.deckId || "").trim();
|
||||
const availableCompareDecks = getRegisteredDeckList().filter((deck) => deck.id && deck.id !== activeDeckId);
|
||||
if (cardId) {
|
||||
openCardLightboxById(cardId);
|
||||
return;
|
||||
}
|
||||
|
||||
window.TarotUiLightbox?.open?.({
|
||||
src: primaryCardRequest?.src || src,
|
||||
altText: primaryCardRequest?.altText || altText || "Tarot card enlarged image",
|
||||
label: primaryCardRequest?.label || altText || "Tarot card enlarged image",
|
||||
cardId: primaryCardRequest?.cardId || cardId,
|
||||
deckId: primaryCardRequest?.deckId || activeDeckId,
|
||||
deckLabel: primaryCardRequest?.deckLabel || "",
|
||||
compareDetails: primaryCardRequest?.compareDetails || [],
|
||||
allowOverlayCompare: true,
|
||||
allowDeckCompare: Boolean(cardId),
|
||||
activeDeckId,
|
||||
activeDeckLabel: primaryCardRequest?.deckLabel || "",
|
||||
availableCompareDecks,
|
||||
maxCompareDecks: 2,
|
||||
sequenceIds: state.cards.map((card) => card.id),
|
||||
resolveCardById: buildLightboxCardRequestById,
|
||||
resolveDeckCardById: buildDeckLightboxCardRequest,
|
||||
onSelectCardId: (nextCardId) => {
|
||||
const latestElements = getElements();
|
||||
selectCardById(nextCardId, latestElements);
|
||||
scrollCardIntoView(nextCardId, latestElements);
|
||||
}
|
||||
src,
|
||||
altText: altText || "Tarot card enlarged image",
|
||||
label: altText || "Tarot card enlarged image"
|
||||
});
|
||||
},
|
||||
shouldOpenCardLightboxOnSelect: (latestElements) => Boolean(
|
||||
@@ -1116,6 +1142,7 @@
|
||||
ensureTarotSection,
|
||||
selectCardByTrump,
|
||||
selectCardByName,
|
||||
openCardLightboxById,
|
||||
getCards: () => state.cards,
|
||||
getHouseTopCardsVisible: () => state.houseTopCardsVisible,
|
||||
getHouseTopInfoModes: () => ({ ...state.houseTopInfoModes }),
|
||||
|
||||
Reference in New Issue
Block a user