Work-Life Balance Score Analyzer

Work-Life Balance Score Analyzer

Take this quick assessment to understand and improve your work-life balance.

Section 1: Work Boundaries

"I am able to disconnect from work and stop thinking about it during my personal time."

Section 2: Personal Time & Fulfillment

"I have sufficient time for hobbies, relaxation, and activities that I personally enjoy."

Section 3: Stress & Energy Levels

"I feel energized and manage my stress effectively, rather than feeling drained or overwhelmed."

Section 4: Relationships & Social Connection

"I have enough time and energy to nurture my relationships with family and friends."

Your Work-Life Balance Score

Personalized Action Plan:

${resultLevel}

${resultMessage}

`; const sortedScores = Object.entries(scores).sort((a, b) => a[1] - b[1]); const lowAreas = sortedScores.slice(0, 2); let tipsHTML = ''; lowAreas.forEach(([category, score]) => { const categoryTitle = category.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase()); const areaTips = db.tips[category]; tipsHTML += `

Focus Area: ${categoryTitle}

    ${areaTips.map(tip => `
  • ${tip}
  • `).join('')}
`; }); elements.resultTips.innerHTML = tipsHTML; assessmentData.tips = lowAreas.map(([category]) => ({ category, tips: db.tips[category] })); }; const downloadPDF = () => { if (typeof window.jspdf === 'undefined') { alert('Could not generate PDF. The required library is missing.'); return; } const { jsPDF } = window.jspdf; const doc = new jsPDF(); const colors = { primary: '#0369a1', secondary: '#06b6d4', textPrimary: '#1f2937', textSecondary: '#6b7280' }; doc.setFillColor(colors.primary); doc.rect(0, 0, 210, 28, 'F'); doc.setFont('helvetica', 'bold'); doc.setFontSize(20); doc.setTextColor('#FFFFFF'); doc.text('My Work-Life Balance Assessment', 105, 18, { align: 'center' }); let yPos = 40; doc.setFontSize(16); doc.setFont('helvetica', 'bold'); doc.setTextColor(colors.primary); doc.text('Your Assessment Summary', 14, yPos); yPos += 10; doc.setFontSize(12); doc.setFont('helvetica', 'normal'); doc.setTextColor(colors.textPrimary); doc.text(`Overall Score:`, 20, yPos); doc.setFont('helvetica', 'bold'); doc.text(`${assessmentData.totalScore} / 20 (${assessmentData.resultLevel})`, 55, yPos); yPos += 7; doc.setFont('helvetica', 'normal'); doc.setFontSize(11); const splitMessage = doc.splitTextToSize(assessmentData.resultMessage, 180); doc.text(splitMessage, 14, yPos); yPos += (splitMessage.length * 5) + 10; doc.setFontSize(16); doc.setFont('helvetica', 'bold'); doc.setTextColor(colors.primary); doc.text('Your Personalized Action Plan', 14, yPos); yPos += 8; assessmentData.tips.forEach(area => { const categoryTitle = area.category.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase()); doc.setFontSize(12); doc.setFont('helvetica', 'bold'); doc.setTextColor(colors.textSecondary); doc.text(`Focus Area: ${categoryTitle}`, 14, yPos); yPos += 7; area.tips.forEach(tip => { doc.setFontSize(11); doc.setFont('helvetica', 'normal'); doc.setTextColor(colors.textPrimary); const splitTip = doc.splitTextToSize(`• ${tip}`, 170); doc.text(splitTip, 20, yPos); yPos += (splitTip.length * 5) + 2; }); yPos += 5; }); yPos = 280; doc.setDrawColor(colors.secondary); doc.line(14, yPos, 196, yPos); doc.setFontSize(9); doc.setFont('helvetica', 'italic'); doc.setTextColor(colors.textSecondary); doc.text('This assessment is a tool for self-reflection. Use these suggestions as a starting point to build healthier habits.', 105, yPos + 8, { align: 'center', maxWidth: 180 }); doc.save('My_Work-Life_Balance_Plan.pdf'); }; // --- Event Listeners --- elements.nextBtn.addEventListener('click', nextStep); elements.prevBtn.addEventListener('click', prevStep); elements.downloadPdfBtn.addEventListener('click', downloadPDF); // --- Initialization --- updateFormUI(); });
Scroll to Top