-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalculator.html
More file actions
54 lines (53 loc) · 2.9 KB
/
calculator.html
File metadata and controls
54 lines (53 loc) · 2.9 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Calculator</title>
<meta name="description" content = "" />
<meta name="viewport" content="width=device.width, initial-scale=1" />
<link rel="stylesheet" href="light.css" id="theme"/>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300&display=swap" rel="stylesheet" />
</head>
<body>
<div class="wrapper">
<div class="container">
<h1>Calculator</h1>
<div class="first-row">
<input type="text" name="result" class="result" id="result" value="" placeholder="Result" readonly />
<input type="button" value="C" onclick="clearScreen()" id="clear" />
</div>
<div class="second-row">
<input type="button" value="1" onclick="liveScreen(1)" id="one"/>
<input type="button" value="2" onclick="liveScreen(2)" id="two"/>
<input type="button" value="3" onclick="liveScreen(3)" id="three"/>
<input type="button" value="+" onclick="liveScreen('+')"/>
</div>
<div class="third-row">
<input type="button" value="4" onclick="liveScreen(4)" id="four"/>
<input type="button" value="5" onclick="liveScreen(5)" id="five"/>
<input type="button" value="6" onclick="liveScreen(6)" id="six"/>
<input type="button" value="-" onclick="liveScreen('-')"/>
</div>
<div class="fourth-row">
<input type="button" value="7" onclick="liveScreen(7)" id="seven"/>
<input type="button" value="8" onclick="liveScreen(8)" id="eight"/>
<input type="button" value="9" onclick="liveScreen(9)" id="nine"/>
<input type="button" value="*" onclick="liveScreen('*')"/>
</div>
<div class="fifth-row">
<input type="button" value="/" onclick="liveScreen('/')"/>
<input type="button" value="0" onclick="liveScreen(0)" id="zero"/>
<input type="button" value="." class="dot" onclick="liveScreen('.')"/>
<input type="button" value="=" onclick="result.value = eval(result.value)"/>
</div>
<div class="bottom-buttons">
<a href="https://github.com/zxcodes/JavaScript-Calculator"><i class="fab fa-github"></i>Source </a>
<button onclick="changeTheme()" id="dark-mode">Dark Mode</button>
</div>
</div>
</div>
<script src="https://kit.fontawesome.com/f28b055962.js" crossorigin="anonymous"></script>
<script src="calculatorScript.js"></script>
</body>
</html>