Estimated Coating Rate:
—
This estimate includes coating, preparation, and an averaged cure time per square foot.
function calculateCoatingRate() {
var surfaceArea = parseFloat(document.getElementById("surfaceArea").value);
var coatingTimePerSqFt = parseFloat(document.getElementById("coatingTimePerSqFt").value);
var prepTimePerSqFt = parseFloat(document.getElementById("prepTimePerSqFt").value);
var cureTimePerPart = parseFloat(document.getElementById("cureTimePerPart").value);
var partsPerHour = parseFloat(document.getElementById("partsPerHour").value);
var resultElement = document.getElementById("result");
if (isNaN(surfaceArea) || isNaN(coatingTimePerSqFt) || isNaN(prepTimePerSqFt) || isNaN(cureTimePerPart) || isNaN(partsPerHour) ||
surfaceArea <= 0 || coatingTimePerSqFt <= 0 || prepTimePerSqFt <= 0 || cureTimePerPart <= 0 || partsPerHour <= 0) {
resultElement.innerHTML = "Please enter valid positive numbers for all fields.";
return;
}
var totalCoatingPrepTime = surfaceArea * (coatingTimePerSqFt + prepTimePerSqFt); // Total minutes for coating and prep
var averageCureTimePerSqFt = (cureTimePerPart / partsPerHour) * (surfaceArea / (12.0)); // Approximate cure time factored into sq ft rate (assuming average part size needing 12 sq ft for simplicity, adjust if needed)
var totalTimeMinutes = totalCoatingPrepTime + averageCureTimePerSqFt;
var totalTimeHours = totalTimeMinutes / 60;
if (totalTimeHours === 0) {
resultElement.innerHTML = "Cannot calculate rate with zero time.";
return;
}
var coatingRateSqFtPerHour = surfaceArea / totalTimeHours;
resultElement.innerHTML = coatingRateSqFtPerHour.toFixed(2) + " sq ft per hour";
}
.calculator-container {
font-family: sans-serif;
border: 1px solid #ccc;
padding: 20px;
border-radius: 8px;
max-width: 600px;
margin: 20px auto;
background-color: #f9f9f9;
}
.calculator-form h2, .calculator-result h3 {
text-align: center;
color: #333;
margin-bottom: 20px;
}
.form-group {
margin-bottom: 15px;
display: flex;
align-items: center;
}
.form-group label {
flex: 1;
margin-right: 10px;
font-weight: bold;
color: #555;
}
.form-group input[type="number"] {
flex: 1;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
button {
display: block;
width: 100%;
padding: 12px 20px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
margin-top: 20px;
}
button:hover {
background-color: #45a049;
}
.calculator-result {
margin-top: 30px;
padding: 15px;
background-color: #e9e9e9;
border-radius: 4px;
text-align: center;
}
#result {
font-size: 1.5em;
font-weight: bold;
color: #2c3e50;
margin-top: 10px;
}
.calculator-container p {
color: #666;
line-height: 1.6;
text-align: justify;
}