-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.html
500 lines (473 loc) · 25.2 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
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- Favicons -->
<link href="./assets/img/crypto2.png" rel="icon">
<link href="./assets/img/crypto2.png" rel="apple-touch-icon">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Crypto Dash</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no"
name="viewport" />
<!-- Fonts and icons -->
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" />
<!-- CSS Files -->
<link href="./assets/vendor/bootstrap_dash/bootstrap.min.css" rel="stylesheet" />
<link href="./assets/css/dashboard.css" rel="stylesheet" />
<link href="./assets/css/search.css" rel="stylesheet" />
</head>
<body>
<div class="wrapper">
<div class="sidebar" data-image="./assets/img/sidebar-5.jpg">
<!--
Tip 1: You can change the color of the sidebar using: data-color="purple | blue | green | orange | red"
Tip 2: you can also add an image using data-image tag
-->
<div class="sidebar-wrapper">
<div class="logo">
<a href="#" class="simple-text">
Crypto
</a>
</div>
<ul class="nav">
<li class="nav-item active">
<a class="nav-link" href="dashboard.php">
<i class="nc-icon nc-chart-pie-35"></i>
<p>Dashboard</p>
</a>
</li>
<li>
<a class="nav-link" href="trade.php">
<i class="nc-icon nc-circle-09"></i>
<p>Trade</p>
</a>
</li>
<li>
<a class="nav-link" href="transactions.php">
<i class="nc-icon nc-notes"></i>
<p>Transaction List</p>
</a>
</li>
</ul>
</div>
</div>
<div class="main-panel">
<!-- Navbar -->
<nav class="navbar navbar-expand-lg " color-on-scroll="500">
<div class="container-fluid">
<a class="navbar-brand" href="#pablo"> Dashboard </a>
<button href="" class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-bar burger-lines"></span>
<span class="navbar-toggler-bar burger-lines"></span>
<span class="navbar-toggler-bar burger-lines"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navigation">
<ul class="nav navbar-nav mr-auto">
<li class="dropdown nav-item">
<a href="#" class="dropdown-toggle nav-link" data-toggle="dropdown">
<i class="nc-icon nc-planet"></i>
<!-- <span class="notification">'.$notifications.'</span> -->
<span class="d-lg-none">Notification</span>
</a>
<ul class="dropdown-menu">
<!-- '.$notification.' -->
</ul>
</li>
<li class="nav-item">
<div class="form-group has-search">
<span class="fa fa-search form-control-feedback" onclick="search_func()"></span>
<input type="text" class="form-control" id="search" name="search"
placeholder="Search..." onkeydown="key_down(event);">
</div>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="no-icon">Account</span>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="profile.php">Profile</a>
<a class="dropdown-item" href="change-password.php">Change Password</a>
<a class="dropdown-item" href="kyc.php">View KYC Status</a>
<div class="divider"></div>
<a class="dropdown-item" href="login-history.php">Login History</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="logout.php">
<span class="no-icon">Log out</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- End Navbar -->
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<div class="card ">
<div class="card-header ">
<h4 class="card-title">Portfolio Statistics</h4>
<p class="card-category">Your portfolio diversity</p>
</div>
<div class="card-body ">
<div id="chartPreferences" class="ct-chart ct-perfect-fourth"></div>
<div class="legend">
<!--<i class="fa fa-circle pie1"></i> USD-->
<!-- '.$legends.' -->
</div>
<hr>
<div class="stats">
<i class="fa fa-clock-o"></i> Campaign sent 2 days ago
</div>
</div>
</div>
</div>
<div class="col-md-8 graphy">
<div class="card graphy">
<div class="card-header ">
<div class="row" id="graphs-header">
<h4 class="card-title">Currency Behavior</h4>
<div class="graph-input-wrapper">
<select id="graphs" class="form-control" onchange="updateGraph()">
<option selected value="0">Bitcoin</option>
<option value="1">Ethereum</option>
<option value="2">Doge</option>
<option value="3">Matic</option>
<option value="4">Shiba</option>
</select>
</div>
<!-- <p class="card-category" id="weekly_perf">weekly</p>
<p class="card-category" id="daily_perf">daily</p> -->
<div class="graph-input-wrapper">
<select id="time-dur" class="form-control" onchange="updateGraph()">
<option selected value="6">weekly</option>
<option value="1">daily</option>
<option value="30">monthly</option>
</select>
</div>
</div>
</div>
<svg>
<defs>
<linearGradient id="gradient" x1="0" x2="0" y1="0" y2="1">
<stop offset="0%" stop-color="rgba(128, 105, 242, 1)" stop-opacity="0.3" />
<stop offset="100%" stop-color="rgba(128, 105, 242, 1)" stop-opacity="0" />
</linearGradient>
</defs>
</svg>
<div class="card-body">
<div id="chartHours" class="ct-chart"></div>
</div>
<div class="card-footer ">
<hr>
<div class="stats">
<i class="fa fa-history"></i> Updated 3 minutes ago
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="card" style="height: 420px;">
<div class="card-header ">
<h4 class="card-title">Trending Markets</h4>
<p class="card-category">All products including Taxes</p>
</div>
<div class="scrollable-content">
<div class="row0">
<div class="logo0"></div>
<div class="title0" align="center">Currency</div>
<div class="symbol0" align="center">ID</div>
<div class="amount0" align="center">Current Price</div>
<div class="change0" align="center">24h change</div>
</div>
<ul id="dataList" style="list-style-type:none;"></ul>
<div class="templates">
<div id="listItem">
<div class="row1">
<img class="img-fluid logo" src="./assets/img/transparent.png" width="0"
height="0">
<div class="title"></div>
<div class="symbol"></div>
<div class="amount"></div>
<div class="change"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6" id="tansactionSection">
<div class="card card-tasks">
<div class="card-header h">
<h4 class="card-title show" id="transactionH">Transaction</h4>
<h4 class="card-title hidden" id="transferFH">Transfer To A Friend</h4>
</div>
<div class="card-header">
<p class="card-category">Easy transactions on the go / <a href="#transactionSection"
id="transfer">Transfer</a> to a
friend.</p>
</div>
<div class="t">
<form class="dasht show" action="trade.php" method="POST" id="transaction">
<div class="input-wrapper">
<select id="inputFrom" class="form-control" name="from-wallet">
<option selected>Choose...</option>
'.$from_transfer_options.'
</select>
<label for="inputFrom">From</label>
</div>
<div class="input-wrapper">
<select id="inputTo" class="form-control" name="to-wallet">
<option selected>Choose...</option>
<!-- '.$to_transfer_options.' -->
<!-- <option>BTC</option>
<option>ETH</option>
<option>BNB</option>
<option>USDT</option>
<option>ADA</option>
<option>SOL</option>
<option>XRP</option>
<option>DOT</option>
<option>DOGE</option>
<option>SHIB</option>
<option>LUNA</option>
<option>AVAX</option>
<option>LINK</option>
<option>LTC</option>
<option>UNI</option>
<option>MATIC</option>
<option>XMR</option>
<option>EOS</option>-->
</select>
<label for="inputTo">To</label>
</div>
<div class="input-wrapper">
<input type="text" id="amount" class="transferTo" required name="amount">
<label for="transferTo">Enter amount</label>
</div>
<button class="submit-btn" type="submit" name="submit">Proceed</button>
</form>
<form class="dasht hidden" action="trade.php" method="POST" id="transferF">
<div class="input-wrapper">
<select id="inputFrom" class="form-control" name="">
<option selected>Choose...</option>
<!-- '.$from_transfer_options.' -->
</select>
<label for="inputFrom">From</label>
</div>
<div class="input-wrapper">
<input type="text" id="transferTo" class="transferTo" required>
<label for="transferTo">Enter friend's wallet address</label>
</div>
<a href="#transactionSection" id="backToTransaction">Go back</a>
<button class="submit-btn" type="submit" name="submit">Proceed</button>
</form>
</div>
<div class="card-footer ">
<hr>
<div class="stats">
<i class="now-ui-icons loader_refresh spin"></i> Secure
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container-fluid">
<nav>
<ul class="footer-menu">
<li>
<a href="#">
Home
</a>
</li>
<li>
<a href="#">
Company
</a>
</li>
<li>
<a href="#">
Portfolio
</a>
</li>
</ul>
<p class="copyright text-center">
©
<script>
document.write(new Date().getFullYear());
</script>
</p>
</nav>
</div>
</footer>
</div>
</div>
<!-- -->
</body>
<!-- Core JS Files -->
<script src="./assets/vendor/core/jquery.3.2.1.min.js" type="text/javascript"></script>
<script src="./assets/vendor/core/popper.min.js" type="text/javascript"></script>
<script src="./assets/vendor/bootstrap_dash/bootstrap.min.js" type="text/javascript"></script>
<!-- Chartist Plugin -->
<script src="./assets/vendor/plugins/chartist.min.js"></script>
<!-- Notifications Plugin -->
<script src="./assets/vendor/plugins/bootstrap-notify.js"></script>
<!-- Control Center for Light Bootstrap Dashboard: scripts for the example pages etc -->
<script src="./assets/js/light-bootstrap-dashboard.js" type="text/javascript"></script>
<!-- Charts -->
<script>
var chart1 = new Chartist.Pie(
"#chartPreferences",
{
series: '.$series.',
labels: '.$labels.',
},
{
donut: true,
showLabel: true,
}
);
chart1.on("draw", function (data) {
if (data.type === "slice") {
// Get the total path length in order to use for dash array animation
var pathLength = data.element._node.getTotalLength();
// Set a dasharray that matches the path length as prerequisite to animate dashoffset
data.element.attr({
"stroke-dasharray": pathLength + "px " + pathLength + "px",
});
// Create animation definition while also assigning an ID to the animation for later sync usage
var animationDefinition = {
"stroke-dashoffset": {
id: "anim" + data.index,
dur: 1000,
from: -pathLength + "px",
to: "0px",
easing: Chartist.Svg.Easing.easeOutQuint,
// We need to use `fill: \'freeze\'` otherwise our animation will fall back to initial (not visible)
fill: "freeze",
},
};
// If this was not the first slice, we need to time the animation so that it uses the end sync event of the previous animation
if (data.index !== 0) {
animationDefinition["stroke-dashoffset"].begin =
"anim" + (data.index - 1) + ".end";
}
// We need to set an initial value before the animation starts as we are not in guided mode which would do that for us
data.element.attr({
"stroke-dashoffset": -pathLength + "px",
});
// We can\'t use guided mode as the animations need to rely on setting begin manually
// See http://gionkunz.github.io/chartist-js/api-documentation.html#chartistsvg-function-animate
data.element.animate(animationDefinition, false);
}
});
function updateGraph() {
coin_list = ["bitcoin", "ethereum", "dogecoin", "matic-network", "shiba-inu", "tether", "solana", "cardano"]
time_duration = $('#time-dur :selected').val();
if (time_duration == 1)
time_interval = "hourly"
else
time_interval = "daily"
var coin_index = $('#graphs :selected').val();
var weekly = {
url:
"https://api.coingecko.com/api/v3/coins/" + coin_list[coin_index] + "/market_chart?vs_currency=usd&days=" + time_duration + "&interval=" + time_interval,
method: "GET",
timeout: 0,
};
var price = [];
var time = [];
// portfolio_data[0] = "BTC";
// x[0] = "x";
$.ajax(weekly).done(function (response) {
var dataObject = response.prices;
// console.log(dataObject);
var i = 0;
dataObject.forEach((item) => {
price[i] = parseFloat(item[1]);
var d = new Date(item[0]);
// x[i] = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
if (time_duration == 1)
time[i] = d.getHours();
else if (time_duration == 6)
time[i] = d.toDateString();
else if (time_duration == 30)
time[i] = d.getDate();
// console.log("-----------------//----------");
// console.log(time[i]);
i++;
});
// console.log(x);
// console.log("-----------------//----------");
// console.log(portfolio_data);
chart2 = new Chartist.Line(
"#chartHours",
{
labels: time,
series: [price],
},
{
height: "300px",
low: Math.min(...price) * 0.9,
showArea: true,
fullwidth: true,
/* axisY: {
onlyInteger: true,
scaleMinSpace: 50,
offset: 20,
labelInterpolationFnc: function (value) {
return (value / 1000).toFixed(2) + "k";
},
}, */
axisX: {
showGrid: false,
showLabel: true,
labelInterpolationFnc: function (value, index) {
//if (index === 0)
// return null;
if (time_duration == 1)
return index % 3 == 0 ? value + ":00" : null;
else if (time_duration == 6)
return value;
else if (time_duration == 30)
return index % 3 == 0 ? value + "th" : null;
},
},
axisY: {
showGrid: false,
showLabel: true,
offset: 60,
// The label interpolation function enables you to modify the values
// used for the labels on each axis. Here we are converting the
// values into million pound.
labelInterpolationFnc: function (value, index) {
return index == 0 ? null : "$" + value;
},
},
}
);
chart2.on('draw', function (data) {
if (data.type === 'label' && data.axis === 'X') {
var textHtml = ['<p>', data.text, '</p>'].join('');
var multilineText = Chartist.Svg('svg').foreignObject(textHtml, data.x, data.y - 80, data.space, 80, 'ct-label');
data.element.replace(multilineText);
}
});
});
}
updateGraph();
</script>
<script src="./assets/js/search.js"></script>
</html>