-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
381 lines (375 loc) · 20.7 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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- Bootstrap CSS -->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin="anonymous"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css"
integrity="sha512-MV7K8+y+gLIBoVD59lQIYicR65iaqukzvf/nwasF0nqhPay5w/9lJmVM2hMDcnK1OnMGCdVK+iQrJ7lzPJQd1w=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<!-- to Resolve the Error with Permissions-Policy header: Origin trial controlled feature not enabled: 'interest-cohort'. -->
<meta http-equiv="Permissions-Policy" content="interest-cohort=()">
<link type="text/css" rel="stylesheet" href="./CSS/style.css" />
<link
rel="icon"
href="./img/js.png"
/>
<link rel="stylesheet" href="./CSS/style.css" />
<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=Poppins:ital,wght@1,200;1,400&family=Roboto:wght@300&display=swap" rel="stylesheet">
<title>Javascript</title>
</head>
<body>
<div class="container-fluid">
<!-- Calculator Start -->
<div class="container border calculator shadow-sm rounded">
<!-- input start -->
<div class="row ms-0 row-1 d-flex">
<div class="col-12 input-bar d-flex justify-content-end">
<div class="display-container"></div>
</div>
</div>
<!-- input End -->
<div class="row row-2 mt-1 d-flex">
<div class="col-2 functionscolor btn">
<span style="font-size: 1.2rem;"> <button class="degbtn" type="button" id="deg">DEG</button></span>
</div>
<div class="col-2 functionscolor mt-0">
<span style="font-size: 1.2rem;"> <button type="button" id="febtn"><strong>F-E</strong></button></span>
</div>
</div>
<!-- Memory functions start -->
<div class="row row-3 ms-0 d-flex justify-content-around text-center">
<div class="col-2 functionscolor">
<span style="font-size: 1.2rem;"><button type="button" id="memoryclear" disabled>MC</button></span>
</div>
<div class="col-2 functionscolor">
<span style="font-size: 1.2rem;"><button type="button" id="memoryrecall" disabled>MR</button></span>
</div>
<div class="col-2 functionscolor">
<span style="font-size: 1.2rem;"><button type="button" id="memoryplus">M+</button></span>
</div>
<div class="col-2 functionscolor">
<span style="font-size: 1.2rem;"><button type="button" id="memoryminus">M-</button></span>
</div>
<div class="col-2 functionscolor">
<span style="font-size: 1.2rem;"><button type="button" id="memorysave">MS</button></span>
</div>
</div>
<!-- Memory functions end -->
<!-- Trigonometry &Function Start-->
<div class="row row-4 d-flex">
<div class="col-5 ms-2 functionscolor ">
<div class="dropdown">
<button class="dropbtn"><span style="font-size: 1.1rem;"><img src="img/trigonometry-icon-18-16.png" alt="Trigonometry"> Trigonometry<i class="fa-solid fa-angle-down"></i></span></button>
<div class="dropdown-content trigonomerty mt-1 text-center">
<div class="row g-1">
<div class="col-6 mt-2">
<div class="p-0"><button type="button" id="trigonosecond">2<sup style="font-size: 1rem;">nd</sup></button></div>
</div>
<div class="col-6 mt-2">
<div ><button type="button" id="trigonohyper">hyp</button></div>
</div>
</div>
<!-- Simple trigonometry functions -->
<div class="row g-1" style="display: flex;" id="trigo_func">
<div class="col-6">
<div ><button type="button" id="sin">sin</button></div>
</div>
<div class="col-6">
<div class="p-0"><button type="button" id="cos">cos</button></div>
</div>
<div class="col-6">
<div ><button type="button" id="cot">cot</button></div>
</div>
<div class="col-6">
<div ><button type="button" id="sec">sec</button></div>
</div>
<div class="col-6">
<div ><button type="button" id="csc">csc</button></div>
</div>
<div class="col-6">
<div ><button type="button" id="tan">tan</button></div>
</div>
</div>
<!-- Simple trigonometry functions -->
<!-- Hyper trigonometry function Start -->
<div class="row g-1 anothertrigo" id="hyp_trigo_func">
<div class="col-6 border">
<div ><button type="button" id="hsin">sinh</button></div>
</div>
<div class="col-6">
<div class="p-0"><button type="button" id="hcos">cosh</button></div>
</div>
<div class="col-6">
<div><button type="button" id="hcot">coth</button></div>
</div>
<div class="col-6">
<div><button type="button" id="hsec">sech</button></div>
</div>
<div class="col-6">
<div><button type="button" id="hcsc">csch</button></div>
</div>
<div class="col-6">
<div><button type="button" id="htan">tanh</button></div>
</div>
</div>
<!-- Hyper trigonometry function End -->
<!-- trigonometry inverse start -->
<div class="row g-1 anothertrigo" id="inverse_trigo_func">
<div class="col-6 ">
<div ><button type="button" id="insin">sin<sup>-1</sup></button></div>
</div>
<div class="col-6 ">
<div class="p-0"><button type="button" id="incos">cos<sup>-1</sup></button></div>
</div>
<div class="col-6 ">
<div ><button type="button" id="incot">cot<sup>-1</sup></button></div>
</div>
<div class="col-6 ">
<div ><button type="button" id="insec">sec<sup>-1</sup></button></div>
</div>
<div class="col-6 ">
<div ><button type="button" id="incsc">csc<sup>-1</sup></button></div>
</div>
<div class="col-6 ">
<div ><button type="button" id="intan">tan<sup>-1</sup></button></div>
</div>
</div>
<!-- trigonometry inverse End -->
<!-- Hyper inverse trigonometry function Start -->
<div class="row g-1 anothertrigo" id="hyp_inverse_trigo_func">
<div class="col-6 ">
<div><span style="font-size: 1.1rem;"><button type="button" id="hinsin">sinh<sup>-1</sup></button></div></span>
</div>
<div class="col-6 ">
<div class="p-0"><span style="font-size: 1.1rem;"><button type="button" id="hincos">cosh<sup>-1</sup></button></div></span>
</div>
<div class="col-6 ">
<div><span style="font-size: 1.1rem;"><button type="button" id="hincot">coth<sup>-1</sup></button></div></span>
</div>
<div class="col-6 ">
<div><span style="font-size: 1.1rem;"><button type="button" id="hinsec">sech<sup>-1</sup></button></div></span>
</div>
<div class="col-6 ">
<div><span style="font-size: 1.1rem;"><button type="button" id="hincsc">csch<sup>-1</sup></button></div></span>
</div>
<div class="col-6 ">
<div><span style="font-size: 1.1rem;"><button type="button" id="hintan">tanh<sup>-1</sup></button></div></span>
</div>
</div>
<!-- Hyper inverse trigonometry function End -->
</div>
</div>
</div>
<div class="col-4 functionscolor ">
<div class="dropdown">
<button type="button"><span style="font-size: 1.1rem;"><img src="img/formula.png" class="formula" alt="formula"> Function<i class="fa-solid fa-angle-down"></i></span></button>
<div class="dropdown-content trigonomerty mt-1 text-center">
<div class="row g-1">
<div class="col-6 mt-2 ">
<div ><button type="button" id="ceil">⌈x⌉</button></div>
</div>
<div class="col-6 ">
<div ><button type="button" id="floor">⌊x⌋</button></div>
</div>
<div class="col-12 w-100">
<div class="p-0"><button type="button" id="random">RAN</button></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Trigonometry &Function Start-->
<!-- 2nd, pi, e, C, clear start -->
<div class="row row-5 mt-1 ms-0 d-flex justify-content-around text-center">
<div class="col-2 functionscolor shadow-sm">
<button type="button" onclick="changeButtonfunction()">2<sup style="font-size: 1rem;">nd</sup></button>
</div>
<div class="col-2 functionscolor shadow-sm">
<span style="font-size: 1.5rem;"><button type="button" id="pi" value="3.14">π</button></span>
</div>
<div class="col-2 functionscolor shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="constantE" value="2.718281828459045">e</button></span>
</div>
<div class="col-2 functionscolor shadow-sm">
<span style="font-size: 1.8rem;"><button type="button" id="erase-all-sign" data-all-clear>C</button></span>
</div>
<div class="col-2 functionscolor shadow-sm">
<span style="font-size: 1.2rem;"><button type="button" id="erase-button" data-backspace><img src="img/backspace.png" id="erase-icon" class="delete" alt=""></button></span>
</div>
</div>
<!-- nd, pi, e, C, clear End -->
<!-- x2, 1/x, |x|, exp, mod Start -->
<div class="row row-6 my-1 ms-0 d-flex justify-content-around text-center">
<div class="col-2 functionscolor shadow-sm firstvalue">
<span style="font-size: 1.7rem; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><button type="button" id="xsqure">x<sup>2</sup></button></span>
</div>
<div class="col-2 functionscolor shadow-sm secondvalue" id="showsecondval">
<span style="font-size: 1.7rem; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><button type="button" id="xcube">x<sup>3</sup></button></span>
</div>
<div class="col-2 functionscolor shadow-sm ">
<span style="font-size: 1.5rem;"><button type="button" id="oneuponx">1/<sub style="font-size: 1.5rem;">x</sub></button></span>
</div>
<div class="col-2 functionscolor shadow-sm ">
<div class="x"><span style="font-size: 1.4rem;"><button type="button" id="modx">|X|</button></span></div>
</div>
<div class="col-2 functionscolor shadow-sm ">
<span style="font-size: 1.5rem;"><button type="button" id="exp">exp</button></span>
</div>
<div class="col-2 functionscolor shadow-sm ">
<span style="font-size: 1.5rem;"><button type="button" id="modulo">mod</button></span>
</div>
</div>
<!-- x2, 1/x, |x|, exp, mod End -->
<!-- 2√x, (, ), n!, ÷ Start -->
<div class="row row-7 my-1 ms-0 d-flex justify-content-around text-center">
<div class="col-2 functionscolor shadow-sm firstvalue">
<span style="font-size: 1.7rem; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><button type="button" id="sqrt"><sup style="font-size: 1.3rem;"></sup>√x</button></span>
</div>
<div class="col-2 functionscolor shadow-sm secondvalue">
<span style="font-size: 1.7rem; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><button type="button" id="cbrt"><sup style="font-size: 1.3rem;">3</sup>√x</button></span>
</div>
<div class="col-2 functionscolor shadow-sm ">
<span style="font-size: 1.5rem;"><button type="button" id="opened-parenthesis">(</button></sub></span>
</div>
<div class="col-2 functionscolor shadow-sm ">
<span style="font-size: 1.4rem;"><button type="button" id="closed-parenthesis">)</button></span>
</div>
<div class="col-2 functionscolor shadow-sm ">
<span style="font-size: 1.5rem;"><button type="button" id="factorial">n!</button></span>
</div>
<div class="col-2 functionscolor shadow-sm ">
<span style="font-size: 1.5rem;"><button type="button" id="split-operator">÷</button></span>
</div>
</div>
<!-- 2√x, (, ), n!, ÷ End -->
<!-- xy, 7, 8, 9, * Start -->
<div class="row row-8 my-1 ms-0 d-flex justify-content-around text-center">
<div class="col-2 functionscolor shadow-sm firstvalue">
<span style="font-size: 1.7rem; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><button type="button" id="exponent" >x<sup style="font-size: 1.3rem;">y</sup></button></span>
</div>
<div class="col-2 functionscolor shadow-sm secondvalue">
<span style="font-size: 1.7rem; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><button type="button" id="ysqrx"><sup style="font-size: 1.3rem;">y</sup>√x</button></span>
</div>
<div class="col-2 numberscolor shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="seven" data-number="7">7</button></span>
</div>
<div class="col-2 numberscolor shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="eight" data-number="8">8</button></span>
</div>
<div class="col-2 numberscolor shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="nine" data-number="9">9</button></span>
</div>
<div class="col-2 functionscolor shadow-sm ">
<span style="font-size: 1.7rem;"><button type="button" id="multiplication-operator">×</button></span>
</div>
</div>
<!-- xy, 7, 8, 9, * End -->
<!-- 10x, 4, 5, 6, - Start -->
<div class="row row-9 my-1 ms-0 d-flex justify-content-around text-center">
<div class="col-2 functionscolor shadow-sm firstvalue">
<span style="font-size: 1.7rem; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><button type="button" id="tenrestox">10<sup>x</sup></button></span>
</div>
<div class="col-2 functionscolor shadow-sm secondvalue">
<span style="font-size: 1.7rem; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><button type="button" id="tworesx">2<sup style="font-size: 1.3rem;">x</sup></button></span>
</div>
<div class="col-2 numberscolor shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="four" data-number="4">4</button></span>
</div>
<div class="col-2 numberscolor shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="five" data-number="5">5</button></span>
</div>
<div class="col-2 numberscolor shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="six" data-number="6">6</button></span>
</div>
<div class="col-2 functionscolor shadow-sm ">
<span style="font-size: 1.8rem; width: 100px;"><button type="button" id="less-operator">−</button></span>
</div>
</div>
<!-- xy, 7, 8, 9, * End -->
<!-- log, 1, 2, 3, + Start -->
<div class="row row-10 my-1 ms-0 d-flex justify-content-around text-center">
<div class="col-2 functionscolor shadow-sm firstvalue">
<span style="font-size: 1.7rem; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><button type="button" id="log">log</button></span>
</div>
<div class="col-2 functionscolor shadow-sm secondvalue">
<span style="font-size: 1.4rem; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><button type="button" id="logyx">log<sub>y</sub>x</button></span>
</div>
<div class="col-2 numberscolor shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="one" data-number="1">1</button></span>
</div>
<div class="col-2 numberscolor shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="two" data-number="2">2</button></span>
</div>
<div class="col-2 numberscolor shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="three" data-number="3">3</button></span>
</div>
<div class="col-2 functionscolor shadow-sm ">
<span style="font-size: 1.7rem;"><button type="button" id="plus-operator">+</button></span>
</div>
</div>
<!-- xy, 7, 8, 9, * End -->
<!-- ln, +/-, 0, ., = Start -->
<div class="row row-11 my-1 ms-0 d-flex justify-content-around text-center">
<div class="col-2 functionscolor shadow-sm firstvalue">
<span style="font-size: 1.7rem; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><button type="button" id="ln">ln</button></span>
</div>
<div class="col-2 functionscolor shadow-sm secondvalue">
<span style="font-size: 1.7rem; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;"><button type="button" id="eraisedtox">e<sup>x</sup></button></span>
</div>
<div class="col-2 numberscolor shadow-sm ">
<span style="font-size: 1.7rem;"><button type="button" id="sigchange">±</button></span>
</div>
<div class="col-2 numberscolor shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="zero" data-number="0">0</button></span>
</div>
<div class="col-2 numberscolor shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="decimal-operator">.</button></span>
</div>
<div class="col-2 row11col-b shadow-sm">
<span style="font-size: 1.7rem;"><button type="button" id="equal-button">=</button></span>
</div>
</div>
<!-- ln, +/-, 0, ., = End -->
</div>
<!-- Calculator End -->
</div>
<!-- Container End -->
<!-- Option 1: Bootstrap Bundle with Popper -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"
></script>
<!-- Option 2: Separate Popper and Bootstrap JS -->
<script
src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"
integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF"
crossorigin="anonymous"
></script>
<!-- Jquery Link Start-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- JavaScript -->
<script type="text/javascript" src="script/script.js"></script>
</body>
</html>