-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalculator2.0.html
90 lines (81 loc) · 4.97 KB
/
calculator2.0.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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="calculator.css">
<script>
// function keybord(){
// var displayscreen=document.getElementById("screenn");
// var length=displayscreen.value.length;
// displayscreen.value=displayscreen.value.substr(1,length -2);
// }
function fun(refno)
{
var displayscreen=document.getElementById("screenn");
// displayscreen.innerHTML="";
if(refno=='C')
{
displayscreen.value="";
}
else if(refno=='=')
{
displayscreen.value=eval(displayscreen.value);
}
else if(refno=='A')
{
// alert("i m a");
var length=displayscreen.value.length;
displayscreen.value=displayscreen.value.substr(0,length -1);
// displayscreen.value=part.value;
}
else{
displayscreen.value=(displayscreen.value) + (refno);
}
}
</script>
<title>Calculator</title>
</head>
<body>
<h1> <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="white" class="bi bi-apple" viewBox="0 0 16 16">
<path d="M11.182.008C11.148-.03 9.923.023 8.857 1.18c-1.066 1.156-.902 2.482-.878 2.516.024.034 1.52.087 2.475-1.258.955-1.345.762-2.391.728-2.43zm3.314 11.733c-.048-.096-2.325-1.234-2.113-3.422.212-2.189 1.675-2.789 1.698-2.854.023-.065-.597-.79-1.254-1.157a3.692 3.692 0 0 0-1.563-.434c-.108-.003-.483-.095-1.254.116-.508.139-1.653.589-1.968.607-.316.018-1.256-.522-2.267-.665-.647-.125-1.333.131-1.824.328-.49.196-1.422.754-2.074 2.237-.652 1.482-.311 3.83-.067 4.56.244.729.625 1.924 1.273 2.796.576.984 1.34 1.667 1.659 1.899.319.232 1.219.386 1.843.067.502-.308 1.408-.485 1.766-.472.357.013 1.061.154 1.782.539.571.197 1.111.115 1.652-.105.541-.221 1.324-1.059 2.238-2.758.347-.79.505-1.217.473-1.282z"/>
<path d="M11.182.008C11.148-.03 9.923.023 8.857 1.18c-1.066 1.156-.902 2.482-.878 2.516.024.034 1.52.087 2.475-1.258.955-1.345.762-2.391.728-2.43zm3.314 11.733c-.048-.096-2.325-1.234-2.113-3.422.212-2.189 1.675-2.789 1.698-2.854.023-.065-.597-.79-1.254-1.157a3.692 3.692 0 0 0-1.563-.434c-.108-.003-.483-.095-1.254.116-.508.139-1.653.589-1.968.607-.316.018-1.256-.522-2.267-.665-.647-.125-1.333.131-1.824.328-.49.196-1.422.754-2.074 2.237-.652 1.482-.311 3.83-.067 4.56.244.729.625 1.924 1.273 2.796.576.984 1.34 1.667 1.659 1.899.319.232 1.219.386 1.843.067.502-.308 1.408-.485 1.766-.472.357.013 1.061.154 1.782.539.571.197 1.111.115 1.652-.105.541-.221 1.324-1.059 2.238-2.758.347-.79.505-1.217.473-1.282z"/>
</svg>CALCULATOR</h1>
<div class="container">
<center style="transform: scale(1);">
<input type="text" class="screen" id="screenn" style="transform: scale(0.85);" readonly>
<table style="transform: scale(2); margin-top: 75px; width:100px;">
<tr>
<th onclick="fun('A')" class="faltu"><svg class="faltu1" xmlns="http://www.w3.org/2000/svg" width="11" height="11" fill="currentColor" class="bi bi-backspace-fill" viewBox="0 0 16 16">
<path d="M15.683 3a2 2 0 0 0-2-2h-7.08a2 2 0 0 0-1.519.698L.241 7.35a1 1 0 0 0 0 1.302l4.843 5.65A2 2 0 0 0 6.603 15h7.08a2 2 0 0 0 2-2V3zM5.829 5.854a.5.5 0 1 1 .707-.708l2.147 2.147 2.146-2.147a.5.5 0 1 1 .707.708L9.39 8l2.146 2.146a.5.5 0 0 1-.707.708L8.683 8.707l-2.147 2.147a.5.5 0 0 1-.707-.708L7.976 8 5.829 5.854z"/>
</svg> </th>
<th onclick="fun('C')" class="faltu";>C </th>
<th onclick="fun('%')" style="font-size: 75%;" class="faltu">%</th>
<th onclick="fun('/')" class="sign">/ </th>
</tr>
<tr>
<th onclick="fun(7)" class="number">7</th>
<th onclick="fun(8)" class="number">8</th>
<th onclick="fun(9)" class="number">9</th>
<th onclick="fun('*')" class="sign">x</th>
</tr>
<tr>
<th onclick="fun(4)" class="number">4</th>
<th onclick="fun(5)" class="number">5</th>
<th onclick="fun(6)" class="number">6</th>
<th onclick="fun('-')" class="sign">-</th>
</tr>
<tr>
<th onclick="fun(1)" class="number">1</th>
<th onclick="fun(2)" class="number">2</th>
<th onclick="fun(3)" class="number">3</th>
<th onclick="fun('+')" class="sign">+</th>
</tr>
<tr>
<th colspan="2" onclick="fun(0)" class="number0">0</th>
<th onclick="fun('.')" class="number">.</th>
<th onclick="fun('=' )" class="sign">=</th>
</tr>
</table>
</center>
</div>
</body>
</html>