Estimate your exposure to magnetic fields from common household appliances. This tool is for educational purposes only and does not provide medical advice.
Enter Your Exposure Details
Your estimated field strength of ${fieldStrength.toFixed(2)} mG is compared to the ICNIRP 2010 reference level of ${SAFETY_GUIDELINE_MG} mG for power-frequency magnetic fields.
${percentageOfGuideline.toFixed(2)}%
Exposure Level: ${exposureLevelText}
Disclaimer: This calculator provides an estimation based on typical values and the inverse square law. Actual EMF levels can vary significantly due to device model, age, and environmental factors. This tool is for educational purposes only and is not a substitute for professional measurement or medical advice. The ICNIRP guideline is for acute exposure and does not address long-term exposure risks, which are a subject of ongoing scientific debate.
`;
resultsContainer.innerHTML = resultsHTML;
resultsContainer.classList.remove('hidden');
document.getElementById('download-pdf-btn').addEventListener('click', downloadPdf);
resultsContainer.scrollIntoView({ behavior: 'smooth' });
}
function downloadPdf() {
if (!calculationResults) return;
const { jsPDF } = window.jspdf;
const doc = new jsPDF();
const { applianceName, distance, duration, fieldStrength, totalExposure } = calculationResults;
// Header
doc.setFontSize(22);
doc.setFont('helvetica', 'bold');
doc.text('EMF Exposure Analysis', 105, 20, { align: 'center' });
// User Inputs
doc.setFontSize(16);
doc.text('Your Inputs', 14, 35);
const inputData = [
['Appliance', applianceName],
['Distance', `${distance} feet`],
['Duration', `${duration} hours/day`]
];
doc.autoTable({ startY: 40, head: [['Parameter', 'Value']], body: inputData, theme: 'striped' });
// Results
let finalY = doc.autoTable.previous.finalY;
doc.setFontSize(16);
doc.text('Estimated Results', 14, finalY + 15);
const resultData = [
['Field Strength', `${fieldStrength.toFixed(2)} mG`],
['Total Exposure Dose', `${totalExposure.toFixed(2)} mG-hours`]
];
doc.autoTable({ startY: finalY + 20, head: [['Metric', 'Value']], body: resultData, theme: 'striped' });
// Guideline
finalY = doc.autoTable.previous.finalY;
doc.setFontSize(12);
doc.text(`The calculated field strength is compared to the ICNIRP 2010 general public`, 14, finalY + 15);
doc.text(`reference level of ${SAFETY_GUIDELINE_MG} mG for power-frequency magnetic fields.`, 14, finalY + 20);
// Disclaimer
finalY = doc.autoTable.previous.finalY;
doc.setFontSize(8);
doc.setTextColor(100);
const disclaimerText = doc.splitTextToSize("Disclaimer: This calculator provides an estimation based on typical values and the inverse square law. Actual EMF levels can vary significantly. This tool is for educational purposes only and is not a substitute for professional measurement or medical advice. The ICNIRP guideline is for acute exposure and does not address long-term exposure risks, which are a subject of ongoing scientific debate.", 180);
doc.text(disclaimerText, 14, finalY + 30);
doc.save('EMF-Exposure-Analysis.pdf');
}
// --- EVENT LISTENERS ---
calculateBtn.addEventListener('click', calculateExposure);
// --- INITIALIZATION ---
populateApplianceSelect();
});