81 lines
1.8 KiB
JavaScript
81 lines
1.8 KiB
JavaScript
import { t } from "./i18n.js";
|
|
import { state } from "./state.js";
|
|
import { $ } from "./dom.js";
|
|
import { configureUiRuntime } from "./ui-runtime.js";
|
|
import {
|
|
setAuthUI,
|
|
setAuthMode,
|
|
handleAuthError,
|
|
renderWelcome,
|
|
} from "./auth-ui.js";
|
|
import {
|
|
renderMySuggestions,
|
|
renderAllSuggestions,
|
|
renderPhaseTitles,
|
|
buildCard,
|
|
openNewSuggestionModal,
|
|
normalizeSuggestionForm,
|
|
} from "./suggestions-ui.js";
|
|
import {
|
|
renderVotes,
|
|
scoreToEmoji,
|
|
syncVoteScores,
|
|
neutralEmoji,
|
|
updatePhaseNav,
|
|
} from "./votes-ui.js";
|
|
import { renderResults } from "./results-ui.js";
|
|
import {
|
|
openConfirmModal,
|
|
openLightbox,
|
|
openResultsRelockModal,
|
|
openSuggestionsChangedModal,
|
|
} from "./modals-ui.js";
|
|
|
|
export function renderPhasePill() {
|
|
document
|
|
.querySelectorAll(".phase-view")
|
|
.forEach((el) => el.classList.add("hidden"));
|
|
const viewMap = {
|
|
Suggest: "suggest-view",
|
|
Vote: "vote-view",
|
|
Results: "results-view",
|
|
};
|
|
const id = viewMap[state.phase];
|
|
if (id) $(id).classList.remove("hidden");
|
|
|
|
updatePhaseNav();
|
|
}
|
|
|
|
export function renderCounts() {
|
|
if (!state.counts) return;
|
|
$("counts").textContent = t("counts.format", {
|
|
players: state.counts.players,
|
|
suggestions: state.counts.suggestions,
|
|
votes: state.counts.votes,
|
|
});
|
|
}
|
|
|
|
export {
|
|
buildCard,
|
|
configureUiRuntime,
|
|
handleAuthError,
|
|
neutralEmoji,
|
|
normalizeSuggestionForm,
|
|
openConfirmModal,
|
|
openLightbox,
|
|
openNewSuggestionModal,
|
|
openResultsRelockModal,
|
|
openSuggestionsChangedModal,
|
|
renderAllSuggestions,
|
|
renderMySuggestions,
|
|
renderWelcome,
|
|
renderPhaseTitles,
|
|
renderResults,
|
|
renderVotes,
|
|
scoreToEmoji,
|
|
setAuthMode,
|
|
setAuthUI,
|
|
syncVoteScores,
|
|
updatePhaseNav,
|
|
};
|