-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
115 lines (106 loc) · 4.49 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
<!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">
<link rel="stylesheet" href="./assets/style.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<title>Crypto Top 1000</title>
</head>
<body>
<div class="wrapper">
<div class="header">
<h1>Crypto King</h1>
<!-- navbar -->
<nav class="navbar navbar-expand-lg bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#"></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" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="./index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./indexChart.html">Chart</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul>
<form class="d-flex" role="search">
<input class="form-control me-2" id="myInput" onkeyup="tableSearch()" type="search" placeholder="Search Name" aria-label="Search">
</form>
</div>
</div>
</nav>
<nav class="navbar navbar-light mb-5">
<a class="navbar-brand" href="#">
Cryptocurrency Top 1000 Rankings
</a>
</nav>
</div>
<!-- table search bar -->
<div class="container">
<table class="table table-bordered" id="myTable" data-filter-control="true" data-show-search-clear-button="true">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Ticker</th>
<th scope="col">CryptoCurrency</th>
<th scope="col">Icon</th>
<th scope="col">Market$Cap$USD$</th>
<th scope="col">$USD$</th>
<th scope="col">$BTC</th>
<th scope="col">%24h</th>
<th scope="col">##</th>
</tr>
</thead>
<tbody id="data" id="myTable">
</tbody>
</table>
</div>
</form>
</div>
<script src="./assets/script.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
<script type="application/javascript">
//search bar
function tableSearch() {
let input, filter, table, tr, td, txtValue;
//Intialising Variables
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
table = document.getElementById("myTable");
tr = table.getElementsByTagName("tr");
for (let i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[1,2];
if (td) {
txtValue = td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
//search bar above add to local storage
//add to local storage
function addToLocalStorage() {
let data = document.getElementById("data").innerHTML;
localStorage.setItem("data", data);
}
//add to local storage above
//get from local storage
function getFromLocalStorage() {
let data = localStorage.getItem("data");
document.getElementById("data").innerHTML = data;
}
</script>
</script>
</body>
</html>