-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dashboard.html
executable file
·427 lines (344 loc) · 16.4 KB
/
dashboard.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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="shortcut icon" type="image/png" href="/images/favicon.png">
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@300&family=Roboto+Mono:wght@500&display=swap"
rel="stylesheet">
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<link rel="stylesheet" href="/css/dashboard.css">
<title>Wizdwarfs</title>
</head>
<body>
<div class='main-dashboard-div'>
<nav class="navbar navbar-expand-md navbar-light custom-navbar">
<a class="navbar-brand" href="/">
<img src="/images/logo.png" alt="Logo" class="logo">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown" style="position: absolute;left: 37pc;">
<ul class="navbar-nav">
<li class="nav-item active pl-3">
<a class="nav-link" href="/dashboard">
<i class="fa fa-home icon-light" aria-hidden="true"></i>
</a>
</li>
<li class="nav-item dropdown pl-3">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="fa fa-envelope" aria-hidden="true"></i>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item active" href="/messages" title="Private. These message will dispear after few seconds."><i class="fa fa-envelope-o" aria-hidden="true"></i> Private </a>
<a class="dropdown-item" href="/messages" title="Gossips"> <i class="fa fa-comments-o" aria-hidden="true"></i> Public </a>
</div>
</li>
<li class="nav-item dropdown pl-3">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user-circle-o" aria-hidden="true"></i>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item active" href="/dashboard/profile" title="User will edit any information in the profile"><i class="fa fa-sliders" aria-hidden="true"></i>
Edit Your Profile
</a>
<a class="dropdown-item" href="/dashbaord/setting" title="User Preferences "><i class="fa fa-cogs" aria-hidden="true"></i>
Preferences
</a>
<a class="dropdown-item" href="/dashboard/dvault" title="All your content store hereby"><i class="fa fa-lock" aria-hidden="true"></i>
Keygen Manger
</a>
<a class="dropdown-item" href="/logout" title="Lock the account"><i class="fa fa-sign-out icon icon-light"
aria-hidden="true"></i>Logout</a>
</div>
</li>
</ul>
</div>
</nav>
<form enctype="multipart/form-data" action="/dashboard" method="post" class="dashboard-form">
<div class="container main-container">
<div class="infection-field">
<h4>Choose the type of infection</h4>
<select class="custom-select" id="inputGroupSelect01" name="choose" required>
<option selected> Genome Tracer </option>
<option value="1"> COVID-19 </option>
<option value="2"> Flvi Dengue </option>
<option value="3"> Bambli Ebola </option>
<option value="4"> Zika Virus </option>
<option value="5"> MERSS </option>
</select>
</div>
<div class="file-upload-field">
<input type="file" id="file" id="exampleFormControlFile1" name="fileSeq" />
<label for="file" class="btn-3">
<span class="selected-file">
<i class="fa fa-file-text-o icon" aria-hidden="true"></i>
Upload Your Gnome
</span>
</label>
</div>
<div class="sign">
<label>
<input type="checkbox" id="signed" data-toggle="toggle" data-on="<i class='fa fa-user' aria-hidden='true'></i>" data-off="<i class='fa fa-user-secret' aria-hidden='true'></i>"data-onstyle="success" data-offstyle="danger" data-style="mode" name="signed"/>
Signed Message?
</label>
<input class="signed_message" name="status" />
<button class="btn btn-light verified" type="button"></button>
<input class="public_address" name="address"/>
</div>
<div class="location-div">
<button class="btn btn-light" type="button" title="press marker if you want to activate your current location">
<i class="fa fa-map-marker" aria-hidden="true"></i>
</button>
<input type="text" class="small-div" name="geo-marker" id="geo-marker" readonly/>
</div>
<button type="submit" class="btn btn-success mb-2 submit-button" data-toggle="popover"
title="submit your genetic file " disabled>
<i class="fa fa-check-circle" aria-hidden="true"></i>
</button>
</form>
</div>
<!-- <div class="search-container" style="display: flex;position: absolute;top: 6pc;left: 68pc;">
<form class="search-form" id="search-form" action="" method="post">
<button type="submit" class="searched" style="position: absolute;left: 9pc;border: none;background: transparent;color: slategray;z-index: 2;visibility: hidden;">
<i class="fa fa-check"></i>
</button>
<input type="text" placeholder="Search..." id="searched" autocomplete="on" class="peers" style="position: inherit;border: none;border-radius: 10pc;color: slategray;">
</form>
</div> -->
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/fortmatic@latest/dist/fortmatic.js"></script>
<script src="https://cdn.jsdelivr.net/gh/ethereum/[email protected]/dist/web3.js"></script>
<script src="https://cdn.jsdelivr.net/gh/ethereum/[email protected]/dist/web3.min.js"></script>
<script src="/js/dashboard.js"></script>
<script src="/js/additional.js"></script>
<script type="text/javascript">
const parent_div = document.getElementsByClassName('sign')[0];
const para_div = document.getElementsByClassName('signed_message')[0];
const verifiedBtn = document.getElementsByClassName('verified')[0];
const submitBtn = document.getElementsByClassName('submit-button')[0];
let price = 0;
$('#signed').on('change', () =>{
console.log("props:" , ($('#signed').prop('checked')));
if ($('#signed').prop('checked', true)){
// create div, icon and button
const div = document.createElement('div');
const icon = document.createElement('i');
const _bs0 = document.createElement('button');
const bicon = document.createElement('i');
const star1 = document.createElement('i');
const star2 = document.createElement('i');
const star3 = document.createElement('i');
// adjust button props
verifiedBtn.id = 'fortmatic';
verifiedBtn.style.visibility = 'visible';
verifiedBtn.style.position ='relative';
verifiedBtn.style.top = '-3px';
verifiedBtn.style.left = '-222px';
verifiedBtn.style.color = 'lawngreen';
verifiedBtn.style.boxShadow = '1px 1px whitesmoke';
verifiedBtn.style.transformStyle = 'preserve-3d';
verifiedBtn.style.zIndex = '2';
//adjust icon properties
icon.className = 'fa fa-check-circle';
icon.ariaHidden = true;
// icon render
verifiedBtn.appendChild(icon);
// submit button props
submitBtn.style.marginTop = '17px';
// user action message
para_div.style.visibility = 'visible';
para_div.value = 'The message have been signed. Please verify your message.';
para_div.style.position = 'relative';
para_div.style.width = '433px';
para_div.style.left = '41px';
para_div.style.border = '2px whitesmoke none';
para_div.style.borderRadius = '13px';
para_div.style.top = '-31px';
_bs0.className = 'low';
_bs0.style.position = 'absolute';
_bs0.style.top = '79px';
_bs0.style.left = '3pc';
_bs0.style.border = 'none';
_bs0.style.cursor = 'pointer';
_bs0.type = 'button';
bicon.className = 'fa fa-star';
bicon.ariaHidden = true;
bicon.style.color = 'slategray';
star1.className = 'fa fa-star';
star1.ariaHidden = true;
star1.style.color = 'slategray';
star1.style.position = 'absolute';
star1.style.top = '84px';
star1.style.left = '10pc';
star2.className = 'fa fa-star';
star2.ariaHidden = true;
star2.style.color = 'slategray';
star2.style.position = 'absolute';
star2.style.top = '84px';
star2.style.left = '18pc';
star3.className = 'fa fa-star';
star3.ariaHidden = true;
star3.style.color = 'slategray';
star3.style.position = 'absolute';
star3.style.top = '84px';
star3.style.left = '26pc';
// newly created div render
div.className = 'actions';
div.appendChild(para_div);
div.appendChild(verifiedBtn);
_bs0.appendChild(bicon);
div.appendChild(_bs0);
div.appendChild(star1);
div.appendChild(star2);
div.appendChild(star3);
// message props
parent_div.style.position = 'relative';
parent_div.style.left = '15px';
parent_div.style.width = '500px';
parent_div.style.boxShadow = '5px 5px whitesmoke';
parent_div.style.zIndex = '2';
parent_div.style.borderRadius = '48px';
parent_div.style.top = '-24px';
parent_div.style.display = 'grid';
// message box render
parent_div.appendChild(div);
document.getElementsByClassName('low')[0].addEventListener('click', (event) =>{
document.getElementsByClassName('fa fa-star')[0].style.color = 'yellow';
price = 20;
alert('Congratulations ! cupons active');
});
let stars = document.getElementsByClassName('fa fa-star')[0];
let blink = null;
clearTimeout(blink);
blink = setInterval(twlight, 1000);
function twlight() {
if(star1.style.color === 'slategray'){
star1.style.color = 'yellow';
}else if (star1.style.color === 'yellow'){
star1.style.color = 'slategray';
}
if (star2.style.color === 'slategray' && star1.style.color === 'slategray') {
star2.style.color = 'yellow';
}else if (star1.style.color === 'yellow'){
star2.style.color = 'slategray';
}
if (star3.style.color === 'slategray' && star2.style.color === 'slategray') {
star3.style.color = 'yellow';
}else if (star2.style.color === 'yellow'){
star3.style.color = 'slategray';
}
}
}
if ($('#signed').prop('checked', false)) {
parent_div.children[0].style.visibility = 'hidden';
console.log("checked false");
}
});
</script>
<script type="text/javascript">
// verified button
const vbtn = document.getElementsByClassName('verified')[0];
const address = document.getElementsByClassName('public_address')[0];
// Keys
const FORTMATIC_API_KEY = 'pk_test_7B12425D6845E31A';
const FORTMATIC_API_Prod = 'pk_live_FB9BC8CDD0A5884D';
const ToAddress = '0x13428695c639da47bfef6dd7238dc8d8a675aba6';
// verified button event
vbtn.addEventListener('click', ()=>{
// additional params and objects such as fortmatic and web3js
let fsdk = new Fortmatic(FORTMATIC_API_Prod);
let web3eth = new Web3(fsdk.getProvider());
if(price === 0){ console.log("new price:", price); price = 70;}
// ether balance pay for signed message
let Tovalue = web3eth.utils.toWei(price.toString(), 'ether');
let accountLogin;
// if user have fortmatic access
if(fsdk.getProvider().isFortmatic){
// then active fortmatic api
// web3eth.currentProvider.enable = true;
fsdk.user.login().then(()=>{
// user login credentials
accountLogin = fsdk.user.isLoggedIn();
// user fortmatic account created from user 'email address'
fsdk.configure({
primaryLoginOption: 'email'
}).then(()=>{
// if user have email account created and also login then verified button props
if (accountLogin){
vbtn.style.visibility = 'hidden';
// input props
address.style.visibility = 'visible';
address.style.position = 'absolute';
address.style.zIndex = '2';
address.style.top = '44px';
address.style.left = '74px';
address.style.borderRadius = '12px';
address.style.border = '2px whitesmoke none';
address.style.boxShadow = '5px 5px whitesmoke';
address.style.transformStyle = 'preserve-3d';
address.style.top = '79px';
address.style.width = '416px';
address.readOnly = true;
// get user account and open wallet for transaction
web3eth.eth.getAccounts().then((account)=>{
// transact request object
let tnxParam = {
from: account[0],
to : ToAddress,
value : Tovalue,
};
web3eth.eth.getBalance(account[0]).then((balance)=>{
let tnx = balance < Tovalue ? true : false;
if (!tnx){ alert('Transaction is not possible , because you have low balance'); return}
})
// get coinbase addresss for market and other transact activities
web3eth.eth.getCoinbase().then((coinbase)=>{
address.value = tnxParam.from;
fsdk.user.deposit().then(()=>{
web3eth.eth.sendTransaction(tnxParam).once('transactionHash', (hash) => {}).once('receipt', (receipt) => {
alert(' Congratulations , Transaction is almost completed. ');
submitBtn.removeAttribute('disabled');
});
}).catch(()=>{
alert("Transaction is not completed because of low balance");
});
}).catch((error)=>{
alert('Make sure your address linked with coinbase', coinbase);
});
}).catch(()=>{
alert(" Wrong Credentials submitted ");
});
}
});
}).catch(()=>{
alert("No Credentials submitted !");
});
}
});
</script>
<!-- <script>
const _p01 = document.getElementsByClassName('search-container')[0];
const _b01 = document.getElementsByClassName('searched')[0];
_p01.addEventListener('change', (event)=>{
_b01.style.visibility = 'visible';
});
</script> -->
</body>
</html>