-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
50 lines (50 loc) · 2.52 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
<!DOCTYPE html>
<html>
<head>
<title>Scientific Calculator</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="calculator">
<div class="theme-toggle">
<button onclick="toggleMode()">Toggle Theme</button>
</div>
<div class="display">
<input type="text" id="input" disabled>
<span id="output"></span>
</div>
<div class="keypad">
<div class="numbers">
<button onclick="appendValue('7')">7</button>
<button onclick="appendValue('8')">8</button>
<button onclick="appendValue('9')">9</button>
<button onclick="appendValue('4')">4</button>
<button onclick="appendValue('5')">5</button>
<button onclick="appendValue('6')">6</button>
<button onclick="appendValue('1')">1</button>
<button onclick="appendValue('2')">2</button>
<button onclick="appendValue('3')">3</button>
<button onclick="appendValue('0')">0</button>
<button onclick="appendValue('.')">.</button>
</div>
<div class="operations">
<button class="operator-btn" onclick="clearDisplay()">C</button>
<button class="operator-btn" onclick="deleteCharacter()">⌫</button>
<button class="operator-btn" onclick="appendValue('(')">(</button>
<button class="operator-btn" onclick="appendValue(')')">)</button>
<button class="operator-btn" onclick="appendValue('Math.PI')">π</button>
<button class="operator-btn" onclick="appendValue('Math.sqrt(')">√</button>
<button class="operator-btn" onclick="appendValue('Math.sin(')">sin</button>
<button class="operator-btn" onclick="appendValue('Math.cos(')">cos</button>
<button class="operator-btn" onclick="appendValue('Math.tan(')">tan</button>
<button class="operator-btn" onclick="appendValue('/')">/</button>
<button class="operator-btn" onclick="appendValue('*')">*</button>
<button class="operator-btn" onclick="appendValue('-')">-</button>
<button class="operator-btn" onclick="appendValue('+')">+</button>
<button class="operator-btn" onclick="calculate()">=</button>
</div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>