Personalized Sleep Schedule Generator

Personalized Sleep Schedule Generator

Find your ideal bedtime based on your wake-up time and natural sleep cycles.

What is your age group?

to get your recommended ${profile.sleepDuration} of sleep before waking at ${profile.wakeUp}.

Your Evening & Morning Timeline

    ${timelineOrder.map(item => `
  1. ${item.time}

    ${item.title}

    ${item.description}

  2. `).join('')}
`; resultsPlaceholder.classList.add('hidden'); downloadPdfBtn.classList.remove('hidden'); } // --- PDF Generation --- async function handleDownloadPdf() { const { jsPDF } = window.jspdf; if (!pdfContentWrapper) return; toolContainer.classList.add('pdf-generating'); try { const canvas = await html2canvas(pdfContentWrapper, { scale: 2, useCORS: true, backgroundColor: '#ffffff' }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'portrait', unit: 'px', format: [canvas.width, canvas.height] }); pdf.addImage(imgData, 'PNG', 0, 0, pdf.internal.pageSize.getWidth(), pdf.internal.pageSize.getHeight()); pdf.save('Personalized-Sleep-Schedule.pdf'); } catch (error) { console.error("Error generating PDF:", error); } finally { toolContainer.classList.remove('pdf-generating'); } } // --- Initialize Tool --- updateNavButtons(); });
Scroll to Top