@@ -272,9 +273,10 @@
+
-
-
+
+
@@ -494,7 +496,7 @@
}
// --- Core Logic ---
- function handleSetupContestants() {
+ function handleSetupContestants(skipCalc = false) {
const g1 = g1NamesText.value.split('\n').map(s => s.trim()).filter(s => s.length > 0);
const g2 = g2NamesText.value.split('\n').map(s => s.trim()).filter(s => s.length > 0);
@@ -514,14 +516,14 @@
initialPossibilitiesText.textContent = `${group1Names.length} in Gruppe A • ${group2Names.length} in Gruppe B`;
inputSections.classList.remove("hidden");
- inputSections.classList.add("flex");
+ inputSections.classList.add("grid");
statusDashboard.classList.remove("hidden");
gridSection.classList.remove("hidden");
saveButton.disabled = false;
lucide.createIcons();
- handleCalculate(); // Auto-calculate on start
+ if (!skipCalc) handleCalculate(); // Auto-calculate on start
return true;
}
@@ -692,9 +694,9 @@
badgeStyle = 'background: rgba(255,51,51,0.05); color: var(--error); opacity: 0.4;';
textContent = '0%';
} else {
- // Dynamic opacity calculation (e.g. 20% = 0.2 opacity of the primary color)
- const intensity = Math.max(0.1, prob / 100);
- badgeStyle = `background: rgba(var(--primary-rgb), ${intensity}); color: var(--text-main); font-weight: 700; border: 1px solid rgba(var(--primary-rgb), 0.3);`;
+ // Dynamic 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);`;
}
return `
@@ -725,12 +727,12 @@
const s = JSON.parse(ev.target.result);
g1NamesText.value = s.group1Names.join('\n');
g2NamesText.value = s.group2Names.join('\n');
- handleSetupContestants();
+ handleSetupContestants(true); // skip initial calc
truthBooths = s.truthBooths || [];
ceremonies = s.ceremonies || [];
truthBooths.forEach(renderTruthBoothUI);
ceremonies.forEach((c, i) => renderCeremonyUI(c, i + 1));
- handleCalculate();
+ handleCalculate(); // Calc once all data is loaded
} catch(err) {
showError("Fehler beim Laden der Datei. Ist sie beschädigt?");
}