Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ const calculateBtn = document.getElementById('calculate');
+ const sliders = document.querySelectorAll('input[type="range"]');
+
+ calculateBtn.addEventListener('click', calculateEarnings);
+ sliders.forEach(slider => slider.addEventListener('input', updateRecommendation));
+
+ function calculateEarnings() {
+ const stipend = parseFloat(document.getElementById('stipend').value);
+ const subscribers = parseFloat(document.getElementById('subscribers').value);
+ const subscription = parseFloat(document.getElementById('subscription').value);
+
+ const yearlyOnlyFans = subscribers * subscription * 12 * 0.8; // 80% after platform fees
+ const resultDiv = document.getElementById('result');
+
+ resultDiv.innerHTML = `
+
Annual Earnings Comparison
+
PhD Stipend: $${stipend.toLocaleString()}
+
Potential OnlyFans: $${yearlyOnlyFans.toLocaleString()}
+
Difference: $${(yearlyOnlyFans - stipend).toLocaleString()}
+ `;
+
+ resultDiv.style.animation = 'fadeIn 0.5s ease';
+ }
+
+ function updateRecommendation() {
+ const workLife = parseInt(document.getElementById('work-life').value);
+ const income = parseInt(document.getElementById('income').value);
+ const prestige = parseInt(document.getElementById('prestige').value);
+
+ const phdScore = (prestige * 0.4) + (workLife * 0.3) + (income * 0.3);
+ const ofScore = (income * 0.5) + (workLife * 0.4) + (prestige * 0.1);
+
+ const recommendationDiv = document.getElementById('recommendation');
+ const phdPercentage = (phdScore / (phdScore + ofScore) * 100).toFixed(1);
+ const ofPercentage = (ofScore / (phdScore + ofScore) * 100).toFixed(1);
+
+ recommendationDiv.innerHTML = `
+
Career Match Analysis
+
PhD Compatibility: ${phdPercentage}%
+
OnlyFans Compatibility: ${ofPercentage}%
+
${phdScore > ofScore ? 'Stick with your PhD!' : 'Consider the career change!'}
+ `;
+ }
+ });
+
+ @keyframes fadeIn {
+ from { opacity: 0; transform: translateY(10px); }
+ to { opacity: 1; transform: translateY(0); }
+ }