-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
128 lines (115 loc) · 4.93 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
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3D Shapes Volume Calculator</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
</head>
<body>
<h1>Volume of 3D Shapes Calculator</h1><br><br>
<label for="Shape">Select the Shape: </label>
<select name="Shape" onchange=showDiv(this)>
<option value="None">None</option>
<option value="Cube">Cube</option>
<option value="Cuboid">Cuboid</option>
<option value="Cylinder">Cylinder</option>
<option value="Cone">Right Circular Cone</option>
<option value="Sphere">Sphere</option>
<option value="Hemisphere">Hemisphere</option>
<option value="Prism">Prism</option>
<option value="Pyramid">Pyramid</option>
<option value="Ellipsoid">Ellipsoid</option>
<option value="Tetrahedron">Tetrahedron</option>
</select><br><br><br>
<div id="None" class="shape"></div>
<div id="Cube" class="shape">
<p>V =
<input id="cube-length" type="text" placeholder="length"> <sup> 3 </sup>
</p>
<p id="cubeAnswer" class="answer"></p>
<button onclick=calculate()>Calculate</button>
<h6>length = Length of edge or side</h6>
</div>
<div id="Cuboid" class="shape">
<p>V =
<input id="cuboid-length" type="text" placeholder="length"> *
<input id="cuboid-width" type="text" placeholder="width"> *
<input id="cuboid-height" type="text" placeholder="height">
</p>
<p id="cuboidAnswer" class="answer"></p>
<button onclick=calculate()>Calculate</button>
</div>
<div id="Cylinder" class="shape">
<p>V = π *
<input id="cylinder-radius" type="text" placeholder="radius"> <sup> 2 * </sup>
<input id="cylinder-height" type="text" placeholder="height">
</p>
<p id="cylinderAnswer" class="answer"></p>
<button onclick=calculate()>Calculate</button>
<h6>radius = Radius of the circular base</h6>
</div>
<div id="Cone" class="shape">
<p>V = (1/3) * π *
<input id="cone-radius" type="text" placeholder="radius"> <sup> 2 </sup> *
<input id="cone-height" type="text" placeholder="height">
</p>
<p id="coneAnswer" class="answer"></p>
<button onclick=calculate()>Calculate</button>
<h6>radius = Radius of the circular base</h6>
</div>
<div id="Sphere" class="shape">
<p>V = (4/3) * π *
<input id="sphere-radius" type="text" placeholder="radius"> <sup> 3 </sup>
</p>
<p id="sphereAnswer" class="answer"></p>
<button onclick=calculate()>Calculate</button>
</div>
<div id="Hemisphere" class="shape">
<p>V = (2/3) * π *
<input id="hemisphere-radius" type="text" placeholder="radius"> <sup> 3 </sup>
</p>
<p id="hemisphereAnswer" class="answer"></p>
<button onclick=calculate()>Calculate</button>
</div>
<div id="Prism" class="shape">
<p>V =
<input id="prism-length" type="text" placeholder="length"> *
<input id="prism-width" type="text" placeholder="width"> *
<input id="prism-height" type="text" placeholder="height">
</p>
<p id="prismAnswer" class="answer"></p>
<button onclick=calculate()>Calculate</button>
</div>
<div id="Pyramid" class="shape">
<p>V = (1/3)
<input id="pyramid-length" type="text" placeholder="length">
<input id="pyramid-width" type="text" placeholder="width">
<input id="pyramid-height" type="text" placeholder="height">
</p>
<p id="pyramidAnswer" class="answer"></p>
<button onclick=calculate()>Calculate</button>
</div>
<div id="Ellipsoid" class="shape">
<p>V = (4/3) π
<input id="axis-a" type="text" placeholder="axis-a">
<input id="axis-b" type="text" placeholder="axis-b">
<input id="axis-c" type="text" placeholder="axis-c">
</p>
<p id="ellipsoidAnswer" class="answer"></p>
<button onclick=calculate()>Calculate</button>
<h6>axis-a, axis-b, axis-c = semi-axes of an ellipsoid</h6>
</div>
<div id="Tetrahedron" class="shape">
<p>V = (1/6√2 ) *
<input id="tetrahedron-length" type="text" placeholder="length"> <sup> 3 </sup>
</p>
<p id="tetrahedronAnswer" class="answer"></p>
<button onclick=calculate()>Calculate</button>
<h6>length = Length of the edge</h6>
</div>
</body>
<script src="script.js"></script>
</html>