Longevity-Focused Fitness Plan

Generate a weekly fitness plan designed to enhance healthspan by focusing on stability, strength, and cardiovascular health.

Important Medical Disclaimer

This tool provides general fitness recommendations. Always consult a qualified healthcare professional before starting any new exercise program, especially if you have pre-existing health conditions.

Select Your Current Fitness Level

${day.focus}

    ${day.workout.map(item => `
  • ${item}
  • `).join('')}
`; }); const resultsHTML = `

Your Weekly Longevity Plan

Level: ${planResults.title}

${daysHTML}
`; resultsContainer.innerHTML = resultsHTML; resultsContainer.classList.remove('hidden'); document.getElementById('download-pdf-btn').addEventListener('click', downloadPdf); resultsContainer.scrollIntoView({ behavior: 'smooth' }); } function downloadPdf() { if (!planResults) return; const { jsPDF } = window.jspdf; const doc = new jsPDF(); // Header doc.setFontSize(22); doc.setFont('helvetica', 'bold'); doc.text('Longevity-Focused Fitness Plan', 105, 20, { align: 'center' }); doc.setFontSize(16); doc.text(`Level: ${planResults.title}`, 105, 28, { align: 'center' }); // Table of Exercises const tableData = planResults.days.map(day => [day.day, day.focus, day.workout.join('\n')]); doc.autoTable({ startY: 40, head: [['Day', 'Focus', 'Workout Routine']], body: tableData, theme: 'grid', headStyles: { fillColor: [79, 70, 229] }, // Indigo columnStyles: { 2: { cellWidth: 90 } } }); let finalY = doc.autoTable.previous.finalY; // Disclaimer if (finalY > 240) { doc.addPage(); finalY = 20; } doc.setFontSize(12); doc.setFont('helvetica', 'bold'); doc.setTextColor(239, 68, 68); // Red doc.text('Important Medical Disclaimer', 14, finalY + 15); doc.setFontSize(10); doc.setTextColor(0, 0, 0); // Black const disclaimerText = doc.splitTextToSize("This tool provides general fitness recommendations. Always consult a qualified healthcare professional before starting any new exercise program, especially if you have pre-existing health conditions.", 180); doc.text(disclaimerText, 14, finalY + 22); doc.save(`Longevity-Plan-${planResults.title}.pdf`); } // --- EVENT LISTENERS --- generateBtn.addEventListener('click', generatePlan); });
Scroll to Top