diff --git a/src/index.html b/src/index.html index a7834a2..e0cd952 100644 --- a/src/index.html +++ b/src/index.html @@ -6,10 +6,23 @@ Public APIs + +

+ Public APIs +

+

+ A collective list of free APIs for use in web development +

+

+ For information on contributing to this project, please see the contributing guide +

+
+ +
- +
diff --git a/src/scripts.js b/src/scripts.js index c3df629..33594ea 100644 --- a/src/scripts.js +++ b/src/scripts.js @@ -41,4 +41,25 @@ new Vue({ return show; } } -}).$mount('#app'); \ No newline at end of file +}).$mount('#app'); + +function filterRows() { + // Declare variables + var input, filter, table, tr, td, i; + input = document.getElementById("searchbox"); + filter = input.value.toUpperCase(); + table = document.getElementById("myTable"); + tr = table.getElementsByTagName("tr"); + + // Loop through all table rows, and hide those who don't match the search query + for (i = 0; i < tr.length; i++) { + td = tr[i].getElementsByTagName("td")[0]; + if (td) { + if (td.innerHTML.toUpperCase().indexOf(filter) > -1) { + tr[i].style.display = ""; + } else { + tr[i].style.display = "none"; + } + } + } +} \ No newline at end of file diff --git a/src/searchicon.png b/src/searchicon.png new file mode 100644 index 0000000..cfd0e74 Binary files /dev/null and b/src/searchicon.png differ diff --git a/src/styles.css b/src/styles.css index fa53b3d..809bb08 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1,7 +1,8 @@ -#entries { +body { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; border-collapse: collapse; width: 100%; + table-layout: fixed; } #entries td, #entries th { @@ -21,11 +22,20 @@ color: white; } -th, td { - padding: 15px; - text-align: left; +.center-text { + text-align: center; } .isHidden { display: none; +} + +#searchbox { + text-align: center; + border-radius: 50px; + width: 50%; /* Full-width */ + font-size: 16px; /* Increase font-size */ + padding: 12px 20px 12px 40px; /* Add some padding */ + border: 1px solid #ddd; /* Add a grey border */ + margin-bottom: 12px; /* Add some space below the input */ } \ No newline at end of file
API