-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
117 lines (101 loc) · 3.55 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html>
<head>
<title>Cooling Load Calculator</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #1a1a1a;
color: #f7f7f7;
line-height: 1.6;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
max-width: 500px;
padding: 20px;
background-color: #292929;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
h2 {
margin-bottom: 20px;
text-align: center;
color: #42a5f5;
}
label {
display: block;
margin-bottom: 10px;
font-weight: bold;
color: #ccc;
}
input,
select {
width: 90%;
margin-bottom: 20px;
padding: 10px;
background-color: #3a3a3a;
border: 1px solid #555;
border-radius: 4px;
color: #f7f7f7;
}
button {
width: 100%;
padding: 12px 20px;
background-color: #42a5f5;
color: #f7f7f7;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #1e88e5;
}
#result {
margin-top: 20px;
font-weight: bold;
text-align: center;
color: #42a5f5;
}
</style>
</head>
<body>
<div class="container">
<h2>Cooling Load Calculator</h2>
<h2>21BCE2931 CHIRANJEEVI KARANKI</h2>
<label for="area">Area of the building (in square meters):</label>
<input type="number" id="area" required>
<label for="num_occupants">Number of occupants in the building:</label>
<input type="number" id="num_occupants" required>
<label for="building_type">Type of building:</label>
<select id="building_type" required>
<option value="residential">Residential</option>
<option value="commercial">Commercial</option>
</select>
<label for="outdoor_temp">Outdoor temperature (in Celsius):</label>
<input type="number" id="outdoor_temp" required>
<label for="indoor_temp">Indoor desired temperature (in Celsius):</label>
<input type="number" id="indoor_temp" required>
<button onclick="calculateCoolingLoad()">Calculate</button>
<div id="result"></div>
</div>
<script>
function calculateCoolingLoad() {
const area = parseFloat(document.getElementById("area").value);
const num_occupants = parseInt(document.getElementById("num_occupants").value);
const building_type = document.getElementById("building_type").value;
const outdoor_temp = parseFloat(document.getElementById("outdoor_temp").value);
const indoor_temp = parseFloat(document.getElementById("indoor_temp").value);
const coolingLoad = building_type === "residential" ? 100 * num_occupants : 150 * num_occupants;
const uCoefficient = 30;
const qConduction = uCoefficient * area * (outdoor_temp - indoor_temp);
const sensibleCoolingLoad = qConduction + coolingLoad;
document.getElementById("result").innerText = `The sensible cooling load is: ${sensibleCoolingLoad} W`;
}
</script>
</body>
</html>