-
+
-
-
-
-
-
-
@@ -275,68 +273,11 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 2. Truth Booth
-
-
-
-
-
- 3. Matching Night
-
-
+
-
+
+
@@ -356,7 +297,8 @@
- Match-Matrix
@@ -373,15 +315,68 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
@@ -516,7 +511,6 @@
initialPossibilitiesText.textContent = `${group1Names.length} in Gruppe A • ${group2Names.length} in Gruppe B`;
inputSections.classList.remove("hidden");
- inputSections.classList.add("grid");
statusDashboard.classList.remove("hidden");
gridSection.classList.remove("hidden");
@@ -644,7 +638,6 @@
ceremonies: ceremonies.map(c => ({ pairs: c.pairs, beams: c.beams }))
};
- // The browser proxy resolves /api/solve to the backend automatically
const res = await fetch('/api/solve', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
@@ -694,7 +687,7 @@
badgeStyle = 'background: rgba(255,51,51,0.05); color: var(--error); opacity: 0.4;';
textContent = '0%';
} else {
- // Dynamic heatmap using CSS color-mix
+ // Unified heatmap using CSS color-mix
const mixColor = `color-mix(in srgb, var(--success) ${prob}%, var(--error))`;
badgeStyle = `background: color-mix(in srgb, ${mixColor} 15%, transparent); color: ${mixColor}; font-weight: 800; border: 1px solid color-mix(in srgb, ${mixColor} 30%, transparent);`;
}
@@ -727,13 +720,22 @@
const s = JSON.parse(ev.target.result);
g1NamesText.value = s.group1Names.join('\n');
g2NamesText.value = s.group2Names.join('\n');
- handleSetupContestants(true); // skip initial calc
+
+ // First, setup the contestants but skip auto-calc
+ handleSetupContestants(true);
+
+ // Second, load truth booths and ceremonies into state
truthBooths = s.truthBooths || [];
ceremonies = s.ceremonies || [];
+
+ // Third, render the UI for both
truthBooths.forEach(renderTruthBoothUI);
ceremonies.forEach((c, i) => renderCeremonyUI(c, i + 1));
- handleCalculate(); // Calc once all data is loaded
+
+ // Fourth, trigger ONE final calculation
+ handleCalculate();
} catch(err) {
+ console.error(err);
showError("Fehler beim Laden der Datei. Ist sie beschädigt?");
}
};
@@ -742,7 +744,7 @@
});
// Event Listeners
- setupButton.addEventListener("click", handleSetupContestants);
+ setupButton.addEventListener("click", () => handleSetupContestants());
tbForm.addEventListener("submit", handleAddTruthBooth);
ceremonyForm.addEventListener("submit", handleAddCeremony);
calculateButton.addEventListener("click", handleCalculate);
+
+
+
+
+ 2. Truth Booth
+
+
+
+
+
+