/
index.html
97 lines (90 loc) · 3.71 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="style.css" />
<title>Scientific Calculator</title>
</head>
<body>
<div class="container">
<form action="#" name="calculator">
<input type="text" name="display" placeholder="0" />
<div class="row-1">
<button type="button" value="sin" onclick="sin()">sin</button>
<button type="button" value="cos" onclick="cos()">cos</button>
<button type="button" value="tan" onclick="tan()">tan</button>
<button type="button" value="x^2" onclick="squared()">
x<sup>2</sup>
</button>
</div>
<div class="row-2">
<button type="button" value="x^3" onclick="cubed()">
x<sup>3</sup>
</button>
<button type="button" value="sqrt" onclick="squareRoot()">
√
</button>
<button type="button" value="cbrt" onclick="cubeRoot()">
∛
</button>
<button type="button" value="log" onclick="log()">
log <sub>10</sub>
</button>
</div>
<div class="row-3">
<button type="button" value="ln" onclick="ln()">ln</button>
<button type="button" value="(" onclick="number(value)">(</button>
<button type="button" value=")" onclick="number(value)">)</button>
<button type="button" value="%" onclick="number(value)">%</button>
</div>
<div class="row-4">
<button type="button" class="erase-btn" onclick="erase()">C</button>
<button type="button" value="undo" onclick="undo()">CE</button>
<button type="button" value="backspace" onclick="backspace()">
Del
</button>
<button type="button" value="/" onclick="number(value)">/</button>
</div>
<div class="row-5">
<button type="button" value="7" onclick="number(value)">7</button>
<button type="button" value="8" onclick="number(value)">8</button>
<button type="button" value="9" onclick="number(value)">9</button>
<button type="button" value="*" onclick="number(value)">x</button>
</div>
<div class="row-6">
<button type="button" value="4" onclick="number(value)">4</button>
<button type="button" value="5" onclick="number(value)">5</button>
<button type="button" value="6" onclick="number(value)">6</button>
<button type="button" value="-" onclick="number(value)">-</button>
</div>
<div class="row-7">
<button type="button" value="1" onclick="number(value)">1</button>
<button type="button" value="2" onclick="number(value)">2</button>
<button type="button" value="3" onclick="number(value)">3</button>
<button
type="button"
class="add-btn"
value="+"
onclick="number(value)"
>
+
</button>
</div>
<div class="row-8">
<button type="button" value="0" onclick="number(value)">0</button>
<button type="button" value="." onclick="number(value)">.</button>
<button type="button" class="equal-btn" value="=" onclick="equal()">
=
</button>
</div>
</form>
</div>
<script src="./script.js"></script>
</body>
</html>