-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
231 lines (178 loc) · 11.1 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Geometry Gem</title>
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.12.10/dist/full.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.tailwindcss.com"></script>
<!-- Google font -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body class="m-0 p-0">
<header
class="flex flex-col justify-center items-center md:mx-12 md:mt-12 md:flex-row md:justify-between bg-cyan-100">
<!-- texts -->
<div class="text-center py-4 px-10 md:text-left">
<h1 class="inter-font font-bold text-3xl md:text-5xl">Interactive</h1>
<p class="inter-font font-normal text-2xl md:text-3xl">Geometry Genius</p>
</div>
<!-- button -->
<div class="py-4 px-10">
<button
class="inter-font text-xl font-bold text-white bg-sky-500 hover:bg-sky-400 px-9 py-2 rounded cursor-pointer"
onclick="window.open('https://www.facebook.com/codewithredoy/', '_blank');">Learn JS DOM from me</button>
</div>
</header>
<main class="md:mx-12 md:mt-12">
<div class="grid grid-cols-1 md:grid-cols-12 md:grid-rows-2 gap-6">
<!-- shapes -->
<div class="md:col-span-7 lg:col-span-9 row-span-2">
<!-- shapes container -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- Triangle -->
<div class="bg-base-100 shadow-xl">
<figure class="flex justify-center items-center mt-12">
<img src="./images/triangle.png" alt="Triangle" class="" />
</figure>
<div class="py-12 px-10">
<h2 id="title_triangle"
class="inter-font text-[#414141] font-bold text-xl text-center mb-2">Triangle</h2>
<p class="text-center mt-2 mb-5">Area (A) = 0.5 x b x h</p>
<div class="flex items-center">
<input id="base_triangle" class="bg-[#F1F1F1] rounded p-2 w-1/2" type="number"
placeholder="b"> <span class="mx-1">cm</span>
<input id="height_triangle" class="bg-[#F1F1F1] rounded p-2 w-1/2" type="number"
placeholder="h"> <span class="mx-1">cm</span>
</div>
<div class="mt-12">
<button id="btn_triangle" onclick="area('triangle', 'base_triangle', 'height_triangle')"
class="bg-sky-500 text-white inter-font font-bold text-xl rounded w-full py-1 cursor-pointer hover:bg-sky-400">Calculate
</button>
</div>
</div>
</div>
<!-- Rectangle -->
<div class="bg-base-100 shadow-xl">
<figure class="flex justify-center items-center mt-12">
<img src="./images/rectangle.png" alt="Rectangle" class="" />
</figure>
<div class="py-12 px-10">
<h2 id="title_rectangle"
class="inter-font text-[#414141] font-bold text-xl text-center mb-2">Rectangle</h2>
<p class="text-center mt-2 mb-5">Area (A) = w x l</p>
<div class="flex items-center">
<input id="width_rectangle" class="bg-[#F1F1F1] rounded p-2 w-1/2" type="number"
placeholder="w"> <span class="mx-1">cm</span>
<input id="length_rectangle" class="bg-[#F1F1F1] rounded p-2 w-1/2" type="number"
placeholder="l"> <span class="mx-1">cm</span>
</div>
<div class="mt-12">
<button id="btn_rectangle"
onclick="area('rectangle', 'width_rectangle', 'length_rectangle')"
class="bg-sky-500 text-white inter-font font-bold text-xl rounded w-full py-1 cursor-pointer hover:bg-sky-400">Calculate
</button>
</div>
</div>
</div>
<!-- Ellipse -->
<div class="bg-base-100 shadow-xl">
<figure class="flex justify-center items-center mt-12">
<img src="./images/ellipse.png" alt="Ellipse" class="" />
</figure>
<div class="py-12 px-10">
<h2 class="inter-font text-[#414141] font-bold text-xl text-center mb-2">Ellipse</h2>
<p class="text-center mt-2 mb-5">Area (A) = 3.1416 x a x b</p>
<div class="flex items-center">
<input id="aEllipse" class="bg-[#F1F1F1] rounded p-2 w-1/2" type="number"
placeholder="a">
<span class="mx-1">cm</span>
<input id="bEllipse" class="bg-[#F1F1F1] rounded p-2 w-1/2" type="number"
placeholder="b">
<span class="mx-1">cm</span>
</div>
<div class="mt-12">
<button onclick="area('ellipse', 'aEllipse', 'bEllipse')"
class="bg-sky-500 text-white inter-font font-bold text-xl rounded w-full py-1 cursor-pointer hover:bg-sky-400">Calculate
</button>
</div>
</div>
</div>
<!-- Parallelogram -->
<div class="bg-base-100 shadow-xl">
<figure class="flex justify-center items-center mt-12">
<img src="./images/parallelogram.png" alt="Parallelogram" class="" />
</figure>
<div class="py-12 px-10">
<h2 class="inter-font text-[#414141] font-bold text-xl text-center mb-2">Parallelogram</h2>
<p class="text-center mt-2 mb-5">Area (A) = b x h</p>
<div class="flex items-center">
<input id="bParallelogram" class="bg-[#F1F1F1] rounded p-2 w-1/2" type="number"
placeholder="b"> <span class="mx-1">cm</span>
<input id="hParallelogram" class="bg-[#F1F1F1] rounded p-2 w-1/2" type="number"
placeholder="h"> <span class="mx-1">cm</span>
</div>
<div class="mt-12">
<button onclick="area('parallelogram', 'bParallelogram', 'hParallelogram')"
class="bg-sky-500 text-white inter-font font-bold text-xl rounded w-full py-1 cursor-pointer hover:bg-sky-400">Calculate
</button>
</div>
</div>
</div>
<!-- Pentagon -->
<div class="bg-base-100 shadow-xl">
<figure class="flex justify-center items-center mt-12">
<img src="./images/pentagon.png" alt="Pentagon" class="" />
</figure>
<div class="py-12 px-10">
<h2 class="inter-font text-[#414141] font-bold text-xl text-center mb-2">Pentagon</h2>
<p class="text-center mt-2 mb-5">Area (A) = 0.5 x p x b</p>
<div class="flex items-center">
<input id="pPentagon" class="bg-[#F1F1F1] rounded p-2 w-1/2" type="number"
placeholder="p"> <span class="mx-1">cm</span>
<input id="bPentagon" class="bg-[#F1F1F1] rounded p-2 w-1/2" type="number"
placeholder="b"> <span class="mx-1">cm</span>
</div>
<div class="mt-12">
<button onclick="area('pentagon', 'pPentagon', 'bPentagon')"
class="bg-sky-500 text-white inter-font font-bold text-xl rounded w-full py-1 cursor-pointer hover:bg-sky-400">Calculate
</button>
</div>
</div>
</div>
<!-- Rhombus -->
<div class="bg-base-100 shadow-xl">
<figure class="flex justify-center items-center mt-12">
<img src="./images/rhombus.png" alt="Rhombus" class="" />
</figure>
<div class="py-12 px-10">
<h2 class="inter-font text-[#414141] font-bold text-xl text-center mb-2">Rhombus</h2>
<p class="text-center mt-2 mb-5">Area (A) = 0.5 x d<sub>1</sub> x d<sub>2</sub></p>
<div class="flex items-center">
<input id="d1rhombus" class="bg-[#F1F1F1] rounded p-2 w-1/2" type="number"
placeholder="b"> <span class="mx-1">cm</span>
<input id="d2rhombus" class="bg-[#F1F1F1] rounded p-2 w-1/2" type="number"
placeholder="h"> <span class="mx-1">cm</span>
</div>
<div class="mt-12">
<button onclick="area('rhombus', 'd1rhombus', 'd2rhombus')"
class="bg-sky-500 text-white inter-font font-bold text-xl rounded w-full py-1 cursor-pointer hover:bg-sky-400">Calculate
</button>
</div>
</div>
</div>
</div>
</div>
<!-- calculation result -->
<div id="calculation_container" class="md:col-span-5 lg:col-span-3 row-span-1 bg-base-100 shadow-xl">
<h1 class="inter-font text-xl font-bold text-center underline underline-offset-8 mt-7">Area Calculation
</h1>
</div>
</div>
</main>
<script src="./scripts/area.js"></script>
</body>
</html>