Build a Solar Oven Tool

Solar Oven Tool

Solar Oven Performance Estimator

Select your oven parameters to estimate its performance. Factors can be edited in the 'Data Configuration' tab.

Add, edit, or remove the factors used in the estimation. (Spec #4, #6)

Oven Types (Base Factor)
Insulation Quality (Multiplier)
Weather (Multiplier)

${resultTempEl.innerHTML}

Est. Cook Time (1kg Chicken)

${resultTimeEl.textContent}

`; pdfOutputContent.innerHTML = pdfHtml; } /** * Downloads the output as a PDF * (Spec II.C) */ function downloadSolarPDF() { if ( typeof jspdf === "undefined" || typeof html2canvas === "undefined" ) { console.error("PDF libraries not loaded."); return; } if (!pdfOutputContent || resultsContainer.classList.contains("hidden")) { console.error("No results to download."); return; } const { jsPDF } = jspdf; const pdfOutputElement = document.getElementById("solar-pdf-output-content"); pdfOutputElement.style.display = "block"; pdfOutputElement.style.position = "absolute"; pdfOutputElement.style.left = "-9999px"; html2canvas(pdfOutputElement, { scale: 2, backgroundColor: "#ffffff", }).then((canvas) => { pdfOutputElement.style.display = "none"; pdfOutputElement.style.position = "static"; const imgData = canvas.toDataURL("image/png"); const pdf = new jsPDF({ orientation: "p", unit: "px", format: "a4", }); const pdfWidth = pdf.internal.pageSize.getWidth(); const canvasWidth = canvas.width; const canvasHeight = canvas.height; const ratio = canvasWidth / canvasHeight; const imgWidth = pdfWidth - 40; // 20px margin const imgHeight = imgWidth / ratio; pdf.addImage(imgData, "PNG", 20, 20, imgWidth, imgHeight); pdf.save("solar-oven-estimation.pdf"); }); } pdfDownloadBtn.addEventListener("click", downloadSolarPDF); // --- 6. Initialization --- buildDashboard(); buildConfig(); showSolarTab("solar-tab-dashboard"); // Start on the dashboard tab });