-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
47 lines (44 loc) · 2.58 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Bree+Serif&family=Chakra+Petch&family=Pacifico&family=Pixelify+Sans&display=swap">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<title>Calculator</title>
</head>
<body>
<h1 class="title">Calculator</h1>
<div class="calculator">
<input type="text" id="display" disabled class="display">
<div class="buttons">
<button class="operator blue" onclick="clearDisplay()">C</button>
<button class="operator blue" onclick="toggleNegation()">+/-</button>
<button class="operator blue" onclick="appendToDisplay('%')"><i class="fas fa-percent"></i></button>
<button class="operator red" onclick="appendToDisplay('/')"><i class="fas fa-divide"></i></button>
<button onclick="appendToDisplay('7')">7</button>
<button onclick="appendToDisplay('8')">8</button>
<button onclick="appendToDisplay('9')">9</button>
<button class="operator red" onclick="appendToDisplay('*')"><i class="fas fa-times"></i></button>
<button onclick="appendToDisplay('4')">4</button>
<button onclick="appendToDisplay('5')">5</button>
<button onclick="appendToDisplay('6')">6</button>
<button class="operator red" onclick="appendToDisplay('-')"><i class="fas fa-minus"></i></button>
<button onclick="appendToDisplay('1')">1</button>
<button onclick="appendToDisplay('2')">2</button>
<button onclick="appendToDisplay('3')">3</button>
<button class="operator red" onclick="appendToDisplay('+')"><i class="fas fa-plus"></i></button>
<button class="zero" colspan="2" onclick="appendToDisplay('0')">0</button>
<button onclick="appendToDisplay('.')">.</button>
<button class="operator red" onclick="calculateResult()"><i class="fas fa-equals"></i></button>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/12.3.0/math.min.js"
integrity="sha512-k2XqlNMT3e0wVsA5tq6GAYn50wC6/vLk4jS5ytmtEz5ZOcug2eOzQtn8N3Q5Jd61kjLtjTjvZMIHISovqG6aMw=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/npm/darkmode-js@1.3.4/lib/darkmode-js.min.js"></script>
<script src="script.js"></script>
</body>
</html>