-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
99 lines (92 loc) · 6.44 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Scientific Calculator</title>
<link rel="stylesheet" href="style.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<!-- =======================================================
* App Name: Scientific-Calculator
* App URL: https://github.com/rizalfahlevi8/scientific-calculator
* Developer: Muhammad Rizal Fahlevi
======================================================== -->
</head>
<body>
<div class="container">
<h1 class="text-center mt-3">Scientific Calculator</h1>
<div class="row">
<div class="col-12 offset-md-3 col-md-6">
<div class="card">
<div class="card-body">
<div class="output border m-2 p-2 row">
<input id="operation" readonly class="border border-0 mb-2 text-end" type="text">
<input id="result" readonly class="border border-0 text-end" type="text">
</div>
<div class="input p-3">
<div class="row justify-content-start">
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="toggleRadDeg()" id="toggleRadDeg"
value="rad">rad</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="toggleSecond()" id="toggleSecond"
value="0">⇄</button>
</div>
<div class="row justify-content-center">
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="constant('e')">e</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" id="trigonometric-sin"
onclick="trigonometric('sin')">sin</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" id="trigonometric-cos"
onclick="trigonometric('cos')">cos</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" id="trigonometric-tan"
onclick="trigonometric('tan')">tan</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="clearData()">AC</button>
</div>
<div class="row justify-content-center">
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="constant('π')">π</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="math_function('fact')">x!</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="parenthesesOpen()">(</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="parenthesesClose()">)</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="percentage()">%</button>
</div>
<div class="row justify-content-center">
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="math_function('ln')">ln</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number(7)">7</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number(8)">8</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number(9)">9</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="operator('/','÷')">÷</button>
</div>
<div class="row justify-content-center">
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="math_function('log')">log</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number(4)">4</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number(5)">5</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number(6)">6</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="operator('*','×')">×</button>
</div>
<div class="row justify-content-center">
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="math_function('sqrt')">√</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number(1)">1</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number(2)">2</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number(3)">3</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="operator('-','-')">-</button>
</div>
<div class="row justify-content-center">
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="operator('**','^')">x <span
style="position: relative; bottom: .7em; right: .3em; font-size:xx-small;">y</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number(0)">0</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="number('.')">.</button>
<button id="calculate" class="btn col-2 mx-md-2 mx-1 mb-2"
onclick="calculate()">=</button>
<button class="btn col-2 mx-md-2 mx-1 mb-2" onclick="operator('+','+')">+</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="script.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe"
crossorigin="anonymous"></script>
</body>
</html>