Social Media Usage & Mental Health Analyzer

Social Media Usage & Mental Health Analyzer

Step 1: Log Your Social Media Habits


Overall Habits

${recommendations.emotion}

⚖️

${state.config.sectionTitles.comparison}

${recommendations.comparison}

🧐

${state.config.sectionTitles.consumption}

${recommendations.consumption}

☀️

${state.config.sectionTitles.morning}

${recommendations.morning}

This plan provides general recommendations for improving your relationship with social media. Consistency is key.

`; document.body.appendChild(reportContainer); try { const canvas = await html2canvas(reportContainer, { scale: 2, useCORS: true, logging: false }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'portrait', unit: 'mm', format: 'a4' }); const pageHeight = pdf.internal.pageSize.getHeight(); const pageWidth = pdf.internal.pageSize.getWidth(); const margin = 15; const contentWidth = pageWidth - (margin * 2); const imgProps = pdf.getImageProperties(imgData); const contentHeight = (imgProps.height * contentWidth) / imgProps.width; let heightLeft = contentHeight; let position = 0; pdf.addImage(imgData, 'PNG', margin, margin, contentWidth, contentHeight); heightLeft -= (pageHeight - (margin * 2)); while (heightLeft > 0) { position -= (pageHeight - (margin * 2)); pdf.addPage(); pdf.addImage(imgData, 'PNG', margin, position + margin, contentWidth, contentHeight); heightLeft -= (pageHeight - (margin * 2)); } pdf.save('Social-Media-Mental-Health-Plan.pdf'); } catch (error) { console.error("Error generating PDF:", error); alert("Sorry, there was an error creating the PDF report."); } finally { document.body.removeChild(reportContainer); } }; // --- INITIALIZATION --- switchTab(1); populateConfig(); addPlatformEntry(); // Start with one entry by default });
Scroll to Top