Window Frames Quantity Calculator

Window Frames Quantity Calculator

body {
font-family: Arial, sans-serif;
margin: 20px;
}

h1 {
color: #333;
}

.credit {
font-size: 14px;
color: #666;
margin-bottom: 20px;
}

form {
margin-bottom: 20px;
}

label {
display: block;
margin: 5px 0;
}

input {
margin-bottom: 10px;
padding: 8px;
width: 100%;
box-sizing: border-box;
}

button {
padding: 10px 15px;
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
}

button:hover {
background-color: #45a049;
}

#results {
margin-top: 20px;
}

p {
font-size: 16px;
margin: 5px 0;
}

Window Frames Quantity Calculator

Prepared By: Parag Kamlakar Pal – Owner of www.civilnotess.com

Results

Total Window Area:

Total Frame Length Required:

function calculateFrames() {
// Get input values
const numWindows = parseFloat(document.getElementById(‘numWindows’).value);
const windowWidth = parseFloat(document.getElementById(‘windowWidth’).value);
const windowHeight = parseFloat(document.getElementById(‘windowHeight’).value);

// Check if inputs are valid
if (isNaN(numWindows) || isNaN(windowWidth) || isNaN(windowHeight) || numWindows <= 0 || windowWidth <= 0 || windowHeight <= 0) {
alert('Please enter valid numbers greater than zero.');
return;
}

// Calculate areas and frame length
const windowArea = windowWidth * windowHeight;
const totalWindowArea = numWindows * windowArea;

const perimeterOneWindow = 2 * (windowWidth + windowHeight);
const totalFrameLength = numWindows * perimeterOneWindow;

// Display results
document.getElementById('totalArea').textContent = `Total Window Area: ${totalWindowArea.toFixed(2)} square meters`;
document.getElementById('totalFrameLength').textContent = `Total Frame Length Required: ${totalFrameLength.toFixed(2)} meters`;
}

Leave a Reply

Your email address will not be published. Required fields are marked *