-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
89 lines (79 loc) · 3.57 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- displays site properly based on user's device -->
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Spartan:wght@700&display=swap" rel="stylesheet">
<script src="script.js"></script>
<title>Frontend Mentor | Calculator app</title>
</head>
<body onkeydown="keyPress(event)">
<div class="calculator">
<div class="calculator-heading">
<h1>calc</h1>
<div class="theme-setter">
<div class="label-level">
<label>1</label>
<label>2</label>
<label>3</label>
</div>
<div class="slider-level">
<label class="theme-label">THEME</label>
<input type="range" min="0" max="2" value="0" class="slider" onClick="chooseSlide()" />
</div>
</div>
</div>
<div class="calculator-screen">
<p class="result"></p>
</div>
<div class="calculator-body">
<div class="button-row one">
<input type="button" value="7" name="7" onClick="displayKeys(7)">
<input type="button" value="8" name="8" onClick="displayKeys(8)">
<input type="button" value="9" name="9" onClick="displayKeys(9)">
<input type="button" value="DEL" name="del" class="del" onClick="deleteKey()">
</div>
<div class="button-row two">
<input type="button" value="4" name="4" onClick="displayKeys(4)">
<input type="button" value="5" name="5" onClick="displayKeys(5)">
<input type="button" value="6" name="6" onClick="displayKeys(6)">
<input type="button" value="+" name="add" onClick="displayKeys('+')">
</div>
<div class="button-row three">
<input type="button" value="1" name="1" onClick="displayKeys(1)">
<input type="button" value="2" name="2" onClick="displayKeys(2)">
<input type="button" value="3" name="3" onClick="displayKeys(3)">
<input type="button" value="-" name="sub" onClick="displayKeys('-')">
</div>
<div class="button-row four">
<input type="button" value="." name="dot" onClick="displayKeys('.')">
<input type="button" value="0" name="0" onClick="displayKeys(0)">
<input type="button" value="/" name="div" onClick="displayKeys('/')">
<input type="button" value="*" name="mul" onClick="displayKeys('*')">
</div>
<div class="button-row five">
<input type="button" value="RESET" name="reset" class="reset" onClick="resetKeys()">
<input type="button" value="=" name="equal" class="equal" onClick="getResult()">
<input type="button" value="√" name="sqrt" onClick="displayKeys('√')">
</div>
</div>
<div class="calculator-keyboard-rules">
<h3> Note for keyboard users: </h3>
<ul>
<li>, for Square root(√) </li>
<li>Backspace for del operation</li>
<li>Delete for Reset operation</li>
<li>= and Enter to get the result</li>
</ul>
</div>
</div>
<div class="attribution">
Coded by <a href="https://github.com/vaishak10">Vaishak K</a>.
</div>
</body>
</html>