diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..19f425e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +src/_site +src/Gemfile.lock diff --git a/src/css/stylesheet.css b/src/css/stylesheet.css new file mode 100644 index 0000000..9657234 --- /dev/null +++ b/src/css/stylesheet.css @@ -0,0 +1,53 @@ +body { + border-collapse: collapse; + font-family: 'Roboto', sans-serif; + text-align: center; + width: 100%; +} + +table { + table-layout: fixed; + width: 100px; +} + +#entries td, #entries th { + border: 1px solid #ddd; + padding: 8px; +} + +#entries tr:nth-child(even) { + background-color: #f2f2f2; +} + +#entries tr:hover { + background-color: #ddd; +} + +#entries { + border-collapse: collapse; + border: 1px solid #ddd; + font-size: 18px; + width: 100%; +} + +#entries th { + background-color: #4783e5; + color: white; + padding-top: 12px; + padding-bottom: 12px; + text-align: center; +} + +.isHidden { + display: none; +} + +#searchbox { + border: 1px solid #ddd; + border-radius: 50px; + margin-bottom: 12px; + font-size: 16px; + padding: 12px 20px 12px 40px; + text-align: center; + width: 50%; +} \ No newline at end of file diff --git a/src/favicon.ico b/src/favicon.ico new file mode 100644 index 0000000..8f45dd7 Binary files /dev/null and b/src/favicon.ico differ diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..e17468d --- /dev/null +++ b/src/index.html @@ -0,0 +1,56 @@ + + + + + + + + + + + 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 +

+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
APIDescriptionAuthHTTPSCategory
{{ item.API }}{{ item.Description }}{{ (item.Auth) ? item.Auth : '-' }}{{ (item.HTTPS) ? '✔' : '✖' }}{{ item.Category }}
+
+
+ + + + diff --git a/src/manifest.appcache b/src/manifest.appcache new file mode 100644 index 0000000..cfc5ac9 --- /dev/null +++ b/src/manifest.appcache @@ -0,0 +1,6 @@ +CACHE MANIFEST +index.html +css/stylesheet.css +scripts/main.js +https://unpkg.com/vue@2.4.2/dist/vue.min.js +https://raw.githubusercontent.com/toddmotto/public-apis/master/json/entries.min.json \ No newline at end of file diff --git a/src/scripts/main.js b/src/scripts/main.js new file mode 100644 index 0000000..fd5847e --- /dev/null +++ b/src/scripts/main.js @@ -0,0 +1,36 @@ +new Vue({ + data: { + filter: '', + items: '' + }, + created() { + fetch('https://raw.githubusercontent.com/toddmotto/public-apis/master/json/entries.min.json') + .then(data => data.json()) + .then(data => { + this.items = data.entries; + }) + }, + methods: { + filtered(item) { + let show = true; + + if(this.filter.length) { + + show = false; + + let filterKeyword = this.filter.toLowerCase(); + + Object.keys(item).map(function(key) { + if(typeof item[key] === 'string') { + let value = item[key].toString().toLowerCase(); + + if(value.includes(filterKeyword)) { + show = true; + } + } + }); + } + return show; + } + } +}).$mount('#app');