HIIT Timer

HIIT Timer

Ready 00 Round 0 / 0

Rest Interval

${restTime}s

Rounds

${totalRounds}

Total Workout Time

${formatTime(totalWorkoutDuration)}

(${formatTime(totalWorkTime)} work + ${formatTime(totalRestTime > 0 ? totalRestTime : 0)} rest)

`; await new Promise(resolve => setTimeout(resolve, 100)); try { const canvas = await html2canvas(pdfExportContent, { scale: 2 }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: "portrait", unit: "pt", format: "a4" }); const pageWidth = pdf.internal.pageSize.getWidth(); const pageHeight = pdf.internal.pageSize.getHeight(); const margin = 40; const imgProps = pdf.getImageProperties(imgData); const pdfImageWidth = pageWidth - (margin * 2); const pdfImageHeight = (imgProps.height * pdfImageWidth) / imgProps.width; pdf.addImage(imgData, 'PNG', margin, margin, pdfImageWidth, pdfImageHeight); pdf.save(`HIIT-Workout-Summary-${new Date().toISOString().slice(0,10)}.pdf`); } catch (error) { console.error("Error generating PDF:", error); alert("Sorry, there was an error creating the PDF."); } finally { pdfLoader.classList.add('hidden'); pdfDownloadBtn.disabled = false; pdfExportContent.innerHTML = ''; } } // --- INITIALIZE --- updateInitialDisplay(); });
Scroll to Top