-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
403 lines (374 loc) · 17.4 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Analytics</title>
<link rel="icon" type="image/x-icon" href="imgs/data-logo.png">
<!-- Bootstrap 5 Connection -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<!-- CSS Styling Connection -->
<link rel="stylesheet" href="style.css">
<!-- Datatables Connection -->
<link rel="stylesheet" href="https://cdn.datatables.net/1.11.5/css/jquery.dataTables.min.css">
<!-- Include Chart.js library -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.7.0"></script>
</head>
<body>
<!-- Header Section -->
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand" href="#">📊 Data Analytics</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.html">Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" href="analytics.html">Analytics</a>
</li>
<li class="nav-item">
<a class="nav-link" href="settings.html">Settings</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
User Profile
</a>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">
<li><a class="dropdown-item" href="profile.html">Profile</a></li>
<li><a class="dropdown-item" href="settings.html">Settings</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="index.html" onclick="logout()">Log Out</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
</header>
<!-- Main Content Section -->
<main class="container mt-4">
<h2>Dashboard</h2>
<!-- Statistics Section -->
<div class="row mb-4">
<div class="col-md-3">
<div class="card">
<img src="imgs/users.png" class="card-img-top" alt="User Icon">
<div class="card-body">
<h5 class="card-title">Total Users</h5>
<p class="card-text">2500</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card">
<img src="imgs/revenue.png" class="card-img-top" alt="User Icon">
<div class="card-body">
<h5 class="card-title">Revenue</h5>
<p class="card-text">$50,000</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card">
<img src="imgs/orders.png" class="card-img-top" alt="User Icon">
<div class="card-body">
<h5 class="card-title">Orders</h5>
<p class="card-text">1000</p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card">
<img src="imgs/products.png" class="card-img-top" alt="User Icon">
<div class="card-body">
<h5 class="card-title">Products</h5>
<p class="card-text">500</p>
</div>
</div>
</div>
</div>
<!-- Companies Section -->
<div class="card">
<div class="card-body">
<h5 class="card-title">Hacker News</h5>
<div class="filter-buttons">
<button onclick="filterStory('top')" class="btn btn-primary">Top Stories</button>
<button onclick="filterStory('new')" class="btn btn-success">New Stories</button>
<button onclick="filterStory('best')" class="btn btn-warning">Best Stories</button>
</div>
<br>
<div id="newsList"></div>
<p id="loadingText" style="display: none;">Loading...</p>
</div>
</div>
<!-- Companies Section -->
<div class="card">
<div class="card-body">
<h5 class="card-title">Company Logos</h5>
<div id="companyCarousel" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<div class="row">
<div class="col">
<img src="imgs/kaspi.png" alt="Kaspi Bank">
</div>
<div class="col">
<img src="imgs/tinkoff.png" alt="Tinkoff Bank">
</div>
<div class="col">
<img src="imgs/jusan.png" alt="Jusan Bank">
</div>
<div class="col">
<img src="imgs/visa.png" alt="Visa">
</div>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col">
<img src="imgs/sber.png" alt="Sber Bank">
</div>
<div class="col">
<img src="imgs/halyk.png" alt="Halyk Bank">
</div>
<div class="col">
<img src="imgs/rocketbank.png" alt="Rocket Bank">
</div>
<div class="col">
<img src="imgs/stripe.png" alt="Stripe">
</div>
</div>
</div>
</div>
<!-- Controls (optional) -->
<a class="carousel-control-prev" href="#companyCarousel" role="button" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</a>
<a class="carousel-control-next" href="#companyCarousel" role="button" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</a>
</div>
</div>
</div>
<!-- DataTables Section -->
<div class="card">
<div class="card-body">
<h5 class="card-title">Dataset Statistics</h5>
<table id="dataTable" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th>Dataset Name</th>
<th>Field</th>
<th>Date</th>
<th>Size</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>Binance Dataset</td>
<td>Trading</td>
<td>25.09.2023</td>
<td>10 MB</td>
<td><a href="#" class="btn btn-primary randomImgDownload">🖼️ Download</a></td>
</tr>
<tr>
<td>Kaspi Dataset</td>
<td>Finance</td>
<td>19.08.2023</td>
<td>15 MB</td>
<td><a href="#" class="btn btn-primary randomImgDownload">🖼️ Download</a></td>
</tr>
<tr>
<td>Stores Dataset</td>
<td>Retail</td>
<td>25.05.2023</td>
<td>15 MB</td>
<td><a href="#" class="btn btn-primary randomImgDownload">🖼️ Download</a></td>
</tr>
</tbody>
</table>
<div class="d-flex justify-content-end mb-3">
<button class="btn btn-success custom-btn" onclick="loopJokes()" id="addDataBtn">Add</button>
<button class="btn btn-danger custom-btn" id="deleteDataBtn" onclick="confirm('Are you sure? The data will not be recoverable.')">Delete</button>
</div>
</div>
</div>
<!-- Charts Section -->
<div class="row">
<div class="col-md-6">
<h2>Line Chart</h2>
<div class="card">
<div class="card-body">
<canvas id="lineChart" width="400" height="200"></canvas>
</div>
</div>
</div>
<div class="col-md-6">
<h2>Bar Chart</h2>
<div class="card">
<div class="card-body">
<canvas id="barChart" width="400" height="200"></canvas>
</div>
</div>
</div>
<div class="col-md-6">
<h2>Radar Chart</h2>
<div class="card">
<div class="card-body">
<canvas id="radarChart" width="400" height="200"></canvas>
</div>
</div>
</div>
<div class="col-md-6">
<h2>Pie Chart</h2>
<div class="card">
<div class="card-body">
<canvas id="pieChart" width="400" height="200"></canvas>
</div>
</div>
</div>
</div>
<!-- Get a Service Form Section -->
<div class="card">
<div class="card-body">
<h5 class="card-title">Get a Service</h5>
<form id="orderForm">
<div class="mb-3">
<label for="dashboardType" class="form-label">Select a Service</label>
<select class="form-select" id="dashboardType" name="dashboardType" required>
<option value="" disabled selected>Select an option</option>
<option value="Sales Analytics">Sales Analytics</option>
<option value="Customer Engagement">Customer Engagement</option>
<option value="Inventory Management">Inventory Management</option>
<option value="Marketing Insights">Marketing Insights</option>
<!-- Add more options as needed -->
</select>
</div>
<div class="mb-3">
<label for="contactEmail" class="form-label">Contact Email</label>
<input type="email" class="form-control" id="contactEmail" name="contactEmail" required>
</div>
<div class="mb-3">
<label for="contactPhone" class="form-label">Contact Phone</label>
<input type="tel" class="form-control" id="contactPhone" name="contactPhone" required>
</div>
<div class="mb-3">
<label for="IIN" class="form-label">IIN</label>
<input type="text" class="form-control" id="IIN" name="IIN" required>
<p id="iinValidationMessage" style="color: red;"></p>
</div>
<div class="mb-3">
<label for="message" class="form-label">Message</label>
<textarea class="form-control" rows="3" id="message" name="message" requied></textarea>
</div>
<button type="submit" class="btn btn-primary">Order</button>
</form>
</div>
</div>
</main>
<!-- Footer Section -->
<footer class="bg-dark text-light py-4">
<div class="container">
<div class="row">
<div class="col-md-6">
<p>© 2023 Data Analytics. All Rights Reserved.</p>
</div>
<div class="col-md-6 text-md-right">
<a class="text-light" href="#">Privacy Policy</a> |
<a class="text-light" href="#">Terms of Service</a>
</div>
</div>
</div>
</footer>
<!-- JavaScript and Additional Scripts -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.7.0/dist/chart.min.js"></script>
<!-- Include DataTables JavaScript -->
<script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
<!-- Include jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Include Bootstrap JavaScript (which includes Popper.js) -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="js/app.js"></script>
<script src="js/random-img-downloader.js"></script>
<script>
// Hacker News API
async function fetchStories(type) {
const response = await fetch(`https://hacker-news.firebaseio.com/v0/${type}stories.json`);
const storyIDs = await response.json();
const stories = storyIDs.slice(0, 10);
return Promise.all(stories.map(async (storyID) => {
const storyResponse = await fetch(`https://hacker-news.firebaseio.com/v0/item/${storyID}.json`);
return storyResponse.json();
}));
}
async function filterStory(type) {
const newsList = document.getElementById('newsList');
newsList.innerHTML = '';
showLoadingText();
const stories = await fetchStories(type);
var id = 1;
hideLoadingText();
stories.forEach(story => {
const storyElement = document.createElement('div');
storyElement.classList.add('story');
storyElement.innerHTML = `
<h6>${id++}. ${story.title}</h6>
<p>Link: <a href="${story.url}" target="_blank">Click Here</a></p>
<p>By: <code>${story.by}</code></p>
<p>Score: <code>${story.score}</code></p>
<p>Comments: <code>${story.descendants}</code></p>
<hr>
`;
newsList.appendChild(storyElement);
});
}
filterStory('top');
function showLoadingText() {
document.getElementById('loadingText').style.display = 'block';
}
function hideLoadingText() {
document.getElementById('loadingText').style.display = 'none';
}
// Jokes API
async function loopJokes() {
const n = parseInt(prompt("Enter a number of jokes: "));
if (isNaN(n) || n <= 0) {
alert("Please enter a valid positive number.");
return;
}
for(let i=0; i<n; i++) {
try {
const response = await fetch("https://api.chucknorris.io/jokes/random");
if(response.ok) {
const data = await response.json();
alert(data.value);
} else {
alert("Failed to fetch a joke :(");
break;
}
} catch(error) {
alert("An error occured while fetching jokes :(")
console.error("Error: ", error);
break;
}
}
}
$(document).ready(function () {
$('#dataTable').DataTable();
$('#addDataBtn').click(function () {
alert('Add new data logic goes here.');
});
});
</script>
</body>
</html>