Personalized Biohacking Plan Generator

Personalized Biohacking Plan Generator

Unlock your potential with a customized plan based on your goals and lifestyle.

Step 1: What is your primary health goal?

Step 2: Tell us about your lifestyle.

Step 3: What's your commitment level?

Your Personalized Biohacking Blueprint

This plan provides general suggestions and is not medical advice. Consult with a qualified healthcare professional before making any significant changes to your diet, supplement regimen, or lifestyle, 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, commitment, recommendations } = planData; const colors = { primary: '#1d4ed8', secondary: '#3b82f6', 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('Your Personalized Biohacking Blueprint', 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 blueprint is tailored for your goal of`, 14, yPos); doc.setFont('helvetica', 'bold'); doc.text(goalTitle, 80, yPos); yPos += 7; doc.setFont('helvetica', 'normal'); doc.text(`with a commitment level of`, 14, yPos); doc.setFont('helvetica', 'bold'); doc.text(commitment.charAt(0).toUpperCase() + commitment.slice(1), 60, yPos); yPos += 15; doc.setFontSize(14); doc.setFont('helvetica', 'bold'); doc.setTextColor(colors.primary); doc.text('Your Actionable Steps', 14, yPos); yPos += 8; recommendations.forEach(rec => { const cleanRec = rec.replace(/\*\*/g, ''); // Remove markdown bold for PDF const parts = cleanRec.split(':'); const title = parts[0]; const description = parts.slice(1).join(':').trim(); doc.setFontSize(11); doc.setFont('helvetica', 'bold'); doc.setTextColor(colors.textPrimary); doc.text(`• ${title}:`, 20, yPos); doc.setFont('helvetica', 'normal'); const splitDesc = doc.splitTextToSize(description, 150); doc.text(splitDesc, 25, yPos + 5); yPos += (splitDesc.length * 5) + 5; if (yPos > 250) { doc.addPage(); yPos = 20; } }); 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 safetyText = "This plan is for informational purposes only and does not constitute medical advice. Always consult with a qualified healthcare professional before starting new supplements, diets, or lifestyle protocols."; doc.text(doc.splitTextToSize(safetyText, 170), 20, yPos + 12); doc.save('My_Biohacking_Blueprint.pdf'); }; // --- Event Listeners --- elements.nextBtn.addEventListener('click', nextStep); elements.prevBtn.addEventListener('click', prevStep); elements.downloadPdfBtn.addEventListener('click', downloadPDF); // --- Initialization --- updateFormUI(); });
Scroll to Top