-
Notifications
You must be signed in to change notification settings - Fork 2
/
wallet.html
258 lines (207 loc) · 5.79 KB
/
wallet.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<!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>Food App</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="style.css">
<!-- <link rel="stylesheet" href="login.css"> -->
</head>
<style>
@import url('https://fonts.googleapis.com/css?family=Abel|Abril+Fatface|Alegreya|Arima+Madurai|Dancing+Script|Dosis|Merriweather|Oleo+Script|Overlock|PT+Serif|Pacifico|Playball|Playfair+Display|Share|Unica+One|Vibur');
body {
background-image: linear-gradient(-225deg, #E3FDF5 0%, #FFE6FA 100%);
background-image: linear-gradient(to top, #a8edea 0%, #fed6e3 100%);
background-attachment: fixed;
background-repeat: no-repeat;
font-family: 'Vibur', cursive;
/* the main font */
font-family: 'Abel', sans-serif;
opacity: .95;
/* background-image: linear-gradient(to top, #d9afd9 0%, #97d9e1 100%); */
}
a {
color: black;
}
a:hover {
color: orangered;
}
hr {
color: black;
width: 80%;
margin: auto;
margin-top: -20px;
}
/* .notification{
/* display: none; */
/* } */
.notifDiv {
position: fixed;
top: 1%;
right: 1%;
background-color: rgb(216, 248, 215);
color: black;
font-size: 15px;
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
border-radius: 3px;
padding: 10px;
z-index: 9;
display: none;
border-left: 5px solid green;
}
.notifDiv>div {
display: flex;
justify-content: space-between;
align-items: center;
gap: 10px;
}
#contain {
display: grid;
grid-template-columns: repeat(200px, 1fr);
gap: 5%;
width: 95%;
margin: auto;
}
.wallet {
width: 300px;
height: auto;
padding: 25px 0;
margin: auto;
margin-top: 20px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
background: #fff;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 40px;
margin-top: 8%;
}
.wallet>.showMoney {
font-size: 30px;
font-weight: bold;
text-align: center;
}
.wallet input {
width: 80%;
height: 50px;
margin: auto;
border: 1px solid #ccc;
border-radius: 5px;
padding-left: 10px;
font-size: 18px;
font-weight: 600;
margin-bottom: 20px;
padding-right: 10px;
padding-left: 15px;
font-family: playfair display;
color: #000;
}
.wallet button {
background: orangered;
color: #fff;
border: none;
padding: 5px 10px;
border-radius: 5px;
cursor: pointer;
font-size: 20px;
}
#totalDiv {
width: 40%;
margin: auto;
display: flex;
flex-direction: column;
justify-content: center;
gap: 15px;
align-items: center;
padding: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
border-radius: 10px;
margin-bottom: 20px;
background-color: rgba(0, 255, 255, 0.808);
}
#totalDiv>p {
font-size: 20px;
font-weight: bold;
color: orangered;
}
#totalDiv>p>span {
font-size: 20px;
font-weight: bold;
color: rgb(20, 20, 20);
}
#totalDiv>a {
background: orangered;
color: #fff;
border: none;
padding: 5px 10px;
border-radius: 5px;
cursor: pointer;
font-size: 20px;
}
#add {
margin-top: -20px;
}
#totalDiv>a>i {
font-size: 20px;
color: rgb(62, 11, 145);
}
#st {
position: absolute;
right: 10%;
font-size: 20px;
font-weight: 500
}
#stWallet {
color: orangered;
}
</style>
<body>
<div class="notification">
</div>
<div id="header"></div>
<div class="wallet">
<h1>Your <span style="color: orangered;">Wallet</span></h1>
<hr>
<div class="showMoney">0</div>
<input type="text" id="amount" placeholder="Add Money">
<a href="./cart.html"><button id="Add" >Add Money</button></a>
</div>
</body>
</html>
<!-- <script type="module"> -->
<script>
// alert("hello")
//IMPORT LINE IS HERE
// let header = document.getElementById('header');
// header.innerHTML = navbar();
var count = localStorage.getItem(Number("wallet")) || [];
let add = document.getElementById('Add')
console.log(add)
add.addEventListener('click', ()=> {
//alert("working")
let amount = document.getElementById("amount").value;
count = Number(amount);
let x = localStorage.getItem("wallet");
if (x == null) {
Number(x = 0)
}
let sum = Number(x) + Number(amount);
count = sum;
localStorage.setItem("wallet", count);
document.getElementById('amount').value = "";
window.location.reload();
})
let showMoney = () => {
let money = localStorage.getItem('wallet');
document.getElementsByClassName('showMoney')[0].innerHTML = money;
}
showMoney();
// import navbar from './components/navbar.js';
</script>
<!-- <script src="./food.js"></script> -->