Biofeedback-Based Health Improvement Planner

Biofeedback-Based Health Improvement Planner

Create a personalized weekly plan to leverage biofeedback for your health goals.

Step 1: What is your primary goal?

Step 2: Choose a biofeedback method

Select the primary method you'd like to use.

Step 3: What area needs the most support?

Your Personalized Biofeedback Plan

${tip}

Important Disclaimer

This planner provides general suggestions and is not medical advice. Consult with a qualified healthcare professional before making significant changes to your health routine, especially if you have a pre-existing medical condition.

`; elements.planResultContainer.innerHTML = planHTML; }; 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 { goal, method, lifestyle, protocol, tip } = planData; const colors = { primary: '#0e7490', 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 Biofeedback Health Plan', 105, 18, { align: 'center' }); let yPos = 40; const goalTitle = goal.charAt(0).toUpperCase() + goal.slice(1); doc.setFontSize(12); doc.setFont('helvetica', 'normal'); doc.setTextColor(colors.textPrimary); doc.text(`This weekly plan is designed to help you achieve your goal of`, 14, yPos); doc.setFont('helvetica', 'bold'); doc.text(goalTitle, 115, yPos); yPos += 15; doc.setFontSize(14); doc.setFont('helvetica', 'bold'); doc.setTextColor(colors.primary); doc.text(`Core Biofeedback Protocol (${method.toUpperCase()})`, 14, yPos); yPos += 8; doc.setFontSize(11); doc.setFont('helvetica', 'normal'); doc.text(doc.splitTextToSize(protocol, 180), 14, yPos); yPos += 25; doc.setFontSize(14); doc.setFont('helvetica', 'bold'); doc.setTextColor(colors.primary); doc.text(`Complementary Habit (${lifestyle.charAt(0).toUpperCase() + lifestyle.slice(1)})`, 14, yPos); yPos += 8; doc.setFontSize(11); doc.setFont('helvetica', 'normal'); doc.text(doc.splitTextToSize(tip, 180), 14, yPos); yPos += 25; yPos = Math.max(yPos, 260); doc.setFillColor('#fffbeb'); doc.rect(14, yPos, 182, 25, 'F'); doc.setFontSize(11); doc.setFont('helvetica', 'bold'); doc.setTextColor('#b45309'); doc.text('Important Disclaimer', 20, yPos + 7); doc.setFontSize(9); doc.setFont('helvetica', 'normal'); doc.setTextColor('#92400e'); const disclaimer = "This plan is for informational purposes and is not a substitute for professional medical advice. Consult a healthcare provider before making significant changes to your health routine."; doc.text(doc.splitTextToSize(disclaimer, 170), 20, yPos + 12); doc.save('My_Biofeedback_Plan.pdf'); }; // --- Event Listeners --- elements.nextBtn.addEventListener('click', nextStep); elements.prevBtn.addEventListener('click', prevStep); elements.downloadPdfBtn.addEventListener('click', downloadPDF); // --- Initialization --- updateFormUI(); });
Scroll to Top