show both models at the same time

This commit is contained in:
Tobias Brunner 2025-07-23 11:16:15 +02:00
parent aa57082a1b
commit 4746cfac25
Signed by: tobru
SSH key fingerprint: SHA256:kOXg1R6c11XW3/Pt9dbLdQvOJGFAy+B2K6v6PtRWBGQ
6 changed files with 488 additions and 326 deletions

View file

@ -373,11 +373,7 @@ class ROICalculatorApp {
}
});
// Check direct model radio button
const directModel = document.getElementById('direct-model');
if (directModel) {
directModel.checked = true;
}
// Both models are now calculated simultaneously
// Reset scenarios
['conservative', 'moderate', 'aggressive'].forEach(scenario => {
@ -395,8 +391,7 @@ class ROICalculatorApp {
// Reset advanced parameters
this.resetAdvancedParameters();
// Reset investment model toggle
this.toggleInvestmentModel();
// Both models are now calculated simultaneously, no toggle needed
// Recalculate
this.updateCalculations();
@ -405,27 +400,7 @@ class ROICalculatorApp {
}
}
toggleInvestmentModel() {
try {
const selectedModelElement = document.querySelector('input[name="investment-model"]:checked');
const selectedModel = selectedModelElement ? selectedModelElement.value : 'direct';
const loanSection = document.getElementById('loan-rate-section');
const modelDescription = document.getElementById('model-description');
if (selectedModel === 'loan') {
if (loanSection) loanSection.style.display = 'block';
if (modelDescription) modelDescription.textContent = 'Loan Model: 3-7% guaranteed annual returns with predictable monthly payments and low risk';
} else {
if (loanSection) loanSection.style.display = 'none';
if (modelDescription) modelDescription.textContent = 'Direct Investment: Performance-based returns with progressive scaling, bonuses up to 15%, and dynamic grace periods';
}
this.updateCalculations();
} catch (error) {
console.error('Error toggling investment model:', error);
}
}
// toggleInvestmentModel removed - both models are now calculated simultaneously
logout() {
if (!confirm('Are you sure you want to logout?')) {