Tempo (Ecc-Pau-Con)
${lastCalculation.tempo}
Total Time Under Tension
${lastCalculation.totalTUT}s
Primary Training Goal
${lastCalculation.assessment}
Disclaimer: This analysis is a general guideline. The optimal Time Under Tension can vary based on individual goals, fitness level, and the specific exercise performed. This report is not a substitute for professional coaching or medical advice.
`;
pdfContent.style.position = 'absolute';
pdfContent.style.left = '-9999px';
pdfContent.classList.remove('hidden');
try {
const canvas = await html2canvas(pdfContent.firstElementChild, { scale: 2 });
const imgData = canvas.toDataURL('image/png');
const pdf = new jsPDF({ orientation: 'portrait', unit: 'in', format: 'letter' });
pdf.addImage(imgData, 'PNG', 0, 0, pdf.internal.pageSize.getWidth(), pdf.internal.pageSize.getHeight());
pdf.save('TUT_Analysis_Report.pdf');
} catch (error) {
console.error("Error generating PDF:", error);
statusMessage.textContent = "An error occurred during PDF creation.";
statusMessage.classList.add('text-red-600');
} finally {
setTimeout(() => {
statusMessage.textContent = '';
}, 4000);
pdfContent.classList.add('hidden');
pdfContent.innerHTML = '';
downloadBtn.disabled = false;
}
};
});