Circadian Rhythm Synchronization Tool

Circadian Rhythm

Synchronization Tool

Your Location & Time

This schedule is generated based on the following information. The calculations use your location to determine local solar times.

Location

Pirganj, Bangladesh

Current Date

Your Ideal Daily Schedule

${item.description}

`; timelineContainer.appendChild(timelineItem); }); }; const handlePdfDownload = () => { if (scheduleData.length === 0) return; const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFont('helvetica', 'bold').setFontSize(20); doc.text('Your Ideal Circadian Schedule', 105, 20, { align: 'center' }); doc.setFont('helvetica', 'normal').setFontSize(12); doc.text(`Based on your location: ${LOCATION.name}`, 105, 28, { align: 'center' }); const tableData = scheduleData.map(item => [ item.time.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' }), item.title, item.description ]); doc.autoTable({ startY: 40, head: [['Time', 'Activity', 'Recommendation']], body: tableData, theme: 'grid', headStyles: { fillColor: '#f97316' }, columnStyles: { 0: { cellWidth: 25 }, 1: { cellWidth: 45 }, 2: { cellWidth: 'auto' } } }); doc.save('Circadian_Schedule.pdf'); }; // --- INITIALIZATION --- const init = () => { document.getElementById('date-display').textContent = TODAY.toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); generateBtn.addEventListener('click', handleGenerate); downloadPdfBtn.addEventListener('click', handlePdfDownload); }; init(); });
Scroll to Top