Cold Exposure & Brown Fat Activation Tracker

Log your cold exposure sessions to track consistency and build resilience over time.

Important Medical Disclaimer

Cold exposure can pose significant health risks, especially for individuals with cardiovascular conditions. This tool is for informational purposes only. Always consult a qualified healthcare professional before beginning any form of cold therapy.

Log Your Cold Exposure Session

No sessions logged yet. Add one from the 'Log Session' tab.

`; return; } let tableHTML = ``; [...data].reverse().slice(0, 10).forEach(entry => { // Show 10 most recent tableHTML += ``; }); tableHTML += `
Date Type Duration (min) Temp (°F)
${new Date(entry.date).toLocaleDateString()} ${entry.type} ${entry.duration} ${entry.temp !== null ? entry.temp : '-'}
`; container.innerHTML = tableHTML; } function downloadPdf() { if (exposureData.length === 0) { alert("No data to download. Please log at least one session."); return; } const { jsPDF } = window.jspdf; const doc = new jsPDF(); // Header doc.setFontSize(22); doc.setFont('helvetica', 'bold'); doc.text('Cold Exposure Progress Report', 105, 20, { align: 'center' }); // Charts if (durationChart && tempChart) { doc.setFontSize(16); doc.text('Visual Overview (Last 30 Sessions)', 14, 40); const durationImg = durationChart.toBase64Image(); const tempImg = tempChart.toBase64Image(); doc.addImage(durationImg, 'PNG', 14, 45, 90, 60); doc.addImage(tempImg, 'PNG', 108, 45, 90, 60); } // Log Table doc.addPage(); doc.setFontSize(16); doc.text('Detailed Session Log', 14, 20); const tableData = exposureData.map(entry => [ new Date(entry.date).toLocaleDateString(), entry.type, entry.duration, entry.temp !== null ? entry.temp : '-' ]); doc.autoTable({ startY: 25, head: [['Date', 'Type', 'Duration (min)', 'Temp (°F)']], body: tableData, theme: 'grid', headStyles: { fillColor: [14, 165, 233] } // sky-500 }); doc.save('Cold-Exposure-Report.pdf'); } // --- EVENT LISTENERS --- Object.keys(tabButtons).forEach(key => { tabButtons[key].addEventListener('click', () => switchTab(key)); }); saveBtn.addEventListener('click', saveEntry); downloadBtn.addEventListener('click', downloadPdf); // --- INITIALIZATION --- document.getElementById('entry-date').valueAsDate = new Date(); });
Scroll to Top