-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcalculator.html
149 lines (147 loc) · 5.5 KB
/
calculator.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculator</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Quicksand&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Quicksand';
}
body{
display: flex;
align-items: center;
justify-content: center;
min-width: 100%;
min-height: 100vh;
background: #091921;
}
body::before{
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(#e91e63,#ffc107);
clip-path: circle(22% at 30% 20%);
}
body::after{
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(#ffffff,#da00ff);
clip-path: circle(20% at 70% 90%);
}
.container{
position: relative;
background: rgba(255, 255, 255, 0.05);
border-radius: 6px;
overflow: hidden;
z-index: 10;
backdrop-filter: blur(15px);
border-top: 1px solid rgba(255, 255, 255, 0.2);
border-left: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 5px 5px 30px rgba( 0, 0, 0, 0.2);
}
.container .calculator{
position: relative;
display: grid;
}
.container .calculator .value{
grid-column: span 4;
height: 140px;
width: 300px;
text-align: right;
border: none;
outline: none;
padding: 10px;
background:transparent;
color: #fff;
border-left: 1px solid rgba(255, 255, 255, 0.05);
box-shadow: 5px 5px 30px rgba( 0, 0, 0, 0.05);
font-size: 2.5em;
}
.container .calculator span{
display: grid;
width: 75px;
height: 75px;
color: #fff;
font-weight: 400;
place-items: center;
cursor: pointer;
user-select: none;
font-size: 1.5em;
border-left: 1px solid rgba(255, 255, 255, 0.05);
box-shadow: 5px 5px 30px rgba( 0, 0, 0, 0.05);
transition: 0.5s;
}
.container .calculator span:hover{
transition: 0s;
background:rgba(255, 255, 255, 0.05);
}
.container .calculator span:active{
background:#14ff47;
color: #192f00;
font-size: 24px;
font-weight: 500;
}
.container .calculator .clear{
grid-column: span 2;
width: 150px;
background: rgba(255, 255, 255, 0.05);
}
.container .calculator .plus{
grid-row: span 2;
height: 150px;
}
.container .calculator .equal{
background: rgba(255, 255, 255, 0.05);
}
</style>
</head>
<body>
<div class="container">
<form name="calc" class="calculator">
<input type="text" readonly name="txt" class="value">
<span class="num clear" onclick="calc.txt.value = ''">C</span>
<span class="num" onclick="document.calc.txt.value += '/'">/</span>
<span class="num" onclick="document.calc.txt.value += '*'">x</span>
<span class="num" onclick="document.calc.txt.value += '7'">7</span>
<span class="num" onclick="document.calc.txt.value += '8'">8</span>
<span class="num" onclick="document.calc.txt.value += '9'">9</span>
<span class="num" onclick="document.calc.txt.value += '-'">-</span>
<span class="num" onclick="document.calc.txt.value += '4'">4</span>
<span class="num" onclick="document.calc.txt.value += '5'">5</span>
<span class="num" onclick="document.calc.txt.value += '6'">6</span>
<span class="num plus" onclick="document.calc.txt.value += '+'">+</span>
<span class="num" onclick="document.calc.txt.value += '1'">1</span>
<span class="num" onclick="document.calc.txt.value += '2'">2</span>
<span class="num" onclick="document.calc.txt.value += '3'">3</span>
<span class="num" onclick="document.calc.txt.value += '0'">0</span>
<span class="num" onclick="document.calc.txt.value += '00'">00</span>
<span class="num" onclick="document.calc.txt.value += '.'">.</span>
<span class="num" onclick="document.calc.txt.value = eval(calc.txt.value)">=</span>
</form>
<script type="text/javascript" src="assets/tilt.js"></script>
<script type="text/javascript">
VanillaTilt.init(document.querySelector(".container"), {
max: 15,
speed: 400,
glare:true,
"max-glare":0.2,
});
//It also supports NodeList
// VanillaTilt.init(document.querySelectorAll(".your-element"));
</script>
</div>
</body>
</html>