update ui and add new audio components
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|| typeof nowUiHelpers.getSignStartDate !== "function"
|
||||
|| typeof nowUiHelpers.getDisplayTarotName !== "function"
|
||||
|| typeof nowUiHelpers.setNowCardImage !== "function"
|
||||
|| typeof nowUiHelpers.renderNowPlanetPositions !== "function"
|
||||
|| typeof nowUiHelpers.updateNowStats !== "function"
|
||||
) {
|
||||
throw new Error("NowUiHelpers module must load before ui-now.js");
|
||||
@@ -41,19 +42,10 @@
|
||||
|
||||
function renderNowStatsFromSnapshot(elements, stats) {
|
||||
if (elements.nowStatsPlanetsEl) {
|
||||
elements.nowStatsPlanetsEl.replaceChildren();
|
||||
|
||||
const planetPositions = Array.isArray(stats?.planetPositions) ? stats.planetPositions : [];
|
||||
if (!planetPositions.length) {
|
||||
elements.nowStatsPlanetsEl.textContent = "--";
|
||||
} else {
|
||||
planetPositions.forEach((position) => {
|
||||
const item = document.createElement("div");
|
||||
item.className = "now-stats-planet";
|
||||
item.textContent = String(position?.label || "").trim() || "--";
|
||||
elements.nowStatsPlanetsEl.appendChild(item);
|
||||
});
|
||||
}
|
||||
nowUiHelpers.renderNowPlanetPositions(
|
||||
elements.nowStatsPlanetsEl,
|
||||
Array.isArray(stats?.planetPositions) ? stats.planetPositions : []
|
||||
);
|
||||
}
|
||||
|
||||
if (elements.nowStatsSabianEl) {
|
||||
|
||||
Reference in New Issue
Block a user