Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const calculateBtn = document.getElementById('calculate');
+ const resultDiv = document.getElementById('result');
+
+ calculateBtn.addEventListener('click', () => {
+ const stipend = parseFloat(document.getElementById('stipend').value) || 25000;
+ const yearsLeft = parseFloat(document.getElementById('years-left').value) || 3;
+ const stressLevel = parseFloat(document.getElementById('stress-level').value);
+ const followers = parseFloat(document.getElementById('followers').value) || 0;
+ const contentHours = parseFloat(document.getElementById('content-hours').value) || 0;
+ const comfortLevel = parseFloat(document.getElementById('comfort-level').value);
+
+ // Calculate PhD potential
+ const phdScore = calculatePhDScore(stipend, yearsLeft, stressLevel);
+ const ofScore = calculateOnlyFansScore(followers, contentHours, comfortLevel);
+
+ // Update UI
+ resultDiv.classList.remove('hidden');
+ updateMeters(phdScore, ofScore);
+ updateEarnings(phdScore, ofScore);
+ updateRecommendation(phdScore, ofScore);
+ });
+
+ function calculatePhDScore(stipend, yearsLeft, stressLevel) {
+ const yearlyValue = stipend * (1 - (stressLevel / 20));
+ const futureValue = yearlyValue * (5 - yearsLeft) * 1.1; // 10% increase post-PhD
+ return Math.max(0, Math.min(100, (futureValue / 300000) * 100));
+ }
+
+ function calculateOnlyFansScore(followers, hours, comfort) {
+ const potentialSubs = followers * 0.05; // 5% conversion rate
+ const monthlyRevenue = potentialSubs * 15 * (comfort / 10); // $15 average sub
+ const yearlyRevenue = monthlyRevenue * 12 * (hours / 40); // Scale by hours
+ return Math.max(0, Math.min(100, (yearlyRevenue / 300000) * 100));
+ }
+
+ function updateMeters(phdScore, ofScore) {
+ document.getElementById('phd-meter').style.width = `${phdScore}%`;
+ document.getElementById('of-meter').style.width = `${ofScore}%`;
+ }
+
+ function updateEarnings(phdScore, ofScore) {
+ const phdEarnings = Math.round(phdScore * 3000);
+ const ofEarnings = Math.round(ofScore * 3000);
+
+ document.getElementById('phd-earnings').textContent = phdEarnings.toLocaleString();
+ document.getElementById('of-earnings').textContent = ofEarnings.toLocaleString();
+ }
+
+ function updateRecommendation(phdScore, ofScore) {
+ const recommendation = document.getElementById('recommendation');
+ const diff = Math.abs(phdScore - ofScore);
+
+ if (diff < 10) {
+ recommendation.textContent = "This is a tough call! Consider your personal values and long-term goals.";
+ } else if (phdScore > ofScore) {
+ recommendation.textContent = "The numbers suggest sticking with your PhD might be more profitable long-term.";
+ } else {
+ recommendation.textContent = "The numbers suggest OnlyFans could be more lucrative, but remember to consider all life factors!";
+ }
+ }
+ });