Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const calculateButton = document.getElementById('calculate');
+ const resultDiv = document.getElementById('result');
+
+ calculateButton.addEventListener('click', () => {
+ const stipend = parseFloat(document.getElementById('stipend').value);
+ const yearsLeft = parseFloat(document.getElementById('years-left').value);
+ const stressLevel = parseFloat(document.getElementById('stress-level').value);
+ const attractiveness = parseFloat(document.getElementById('attractiveness').value);
+ const socialMedia = parseFloat(document.getElementById('social-media').value);
+ const comfortLevel = parseFloat(document.getElementById('comfort-level').value);
+
+ // Calculate PhD score (max 100)
+ const phdScore = calculatePhdScore(stipend, yearsLeft, stressLevel);
+
+ // Calculate OnlyFans score (max 100)
+ const ofScore = calculateOnlyFansScore(attractiveness, socialMedia, comfortLevel);
+
+ displayResults(phdScore, ofScore);
+ resultDiv.classList.remove('hidden');
+ });
+
+ function calculatePhdScore(stipend, yearsLeft, stressLevel) {
+ const stipendScore = Math.min(40, (stipend / 50000) * 40);
+ const yearsScore = Math.max(0, 30 - (yearsLeft * 3));
+ const stressScore = Math.max(0, 30 - (stressLevel * 3));
+ return Math.round(stipendScore + yearsScore + stressScore);
+ }
+
+ function calculateOnlyFansScore(attractiveness, socialMedia, comfortLevel) {
+ const attractivenessScore = attractiveness * 4;
+ const socialScore = Math.min(30, (socialMedia / 10000) * 30);
+ const comfortScore = comfortLevel * 3;
+ return Math.round(attractivenessScore + socialScore + comfortScore);
+ }
+
+ function displayResults(phdScore, ofScore) {
+ const phdScoreElement = document.getElementById('phd-score');
+ const ofScoreElement = document.getElementById('of-score');
+ const recommendationElement = document.getElementById('recommendation');
+ const phdFactors = document.getElementById('phd-factors');
+ const ofFactors = document.getElementById('of-factors');
+
+ phdScoreElement.textContent = `Career Score: ${phdScore}/100`;
+ ofScoreElement.textContent = `Career Score: ${ofScore}/100`;
+
+ phdFactors.innerHTML = '';
+ ofFactors.innerHTML = '';
+
+ // Add factors for PhD
+ addFactor(phdFactors, 'Long-term career stability', phdScore > 70);
+ addFactor(phdFactors, 'Academic prestige', phdScore > 60);
+ addFactor(phdFactors, 'Research impact', phdScore > 50);
+
+ // Add factors for OnlyFans
+ addFactor(ofFactors, 'Income potential', ofScore > 70);
+ addFactor(ofFactors, 'Work flexibility', ofScore > 60);
+ addFactor(ofFactors, 'Creative freedom', ofScore > 50);
+
+ const difference = Math.abs(phdScore - ofScore);
+ let recommendation;
+
+ if (difference < 10) {
+ recommendation = "This is a close call! Consider trying OnlyFans as a side hustle while continuing your PhD.";
+ } else if (phdScore > ofScore) {
+ recommendation = "The numbers suggest sticking with your PhD program. Knowledge is power! 🎓";
+ } else {
+ recommendation = "The numbers suggest OnlyFans might be more lucrative. But remember, this is just for fun! 📸";
+ }
+
+ recommendationElement.textContent = recommendation;
+ }
+
+ function addFactor(element, text, positive) {
+ const li = document.createElement('li');
+ li.textContent = `${text}: ${positive ? '✅' : '❌'}`;
+ element.appendChild(li);
+ }
+ });