Skip to content

Commit 0e51a86

Browse files
authored
Merge pull request public-apis#462 from davemachado/site-plan
Alpha website candidate
2 parents f6ffdc9 + 1150d91 commit 0e51a86

File tree

6 files changed

+153
-0
lines changed

6 files changed

+153
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/_site
2+
src/Gemfile.lock

src/css/stylesheet.css

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
body {
2+
border-collapse: collapse;
3+
font-family: 'Roboto', sans-serif;
4+
text-align: center;
5+
width: 100%;
6+
}
7+
8+
table {
9+
table-layout: fixed;
10+
width: 100px;
11+
}
12+
13+
#entries td, #entries th {
14+
border: 1px solid #ddd;
15+
padding: 8px;
16+
}
17+
18+
#entries tr:nth-child(even) {
19+
background-color: #f2f2f2;
20+
}
21+
22+
#entries tr:hover {
23+
background-color: #ddd;
24+
}
25+
26+
#entries {
27+
border-collapse: collapse;
28+
border: 1px solid #ddd;
29+
font-size: 18px;
30+
width: 100%;
31+
}
32+
33+
#entries th {
34+
background-color: #4783e5;
35+
color: white;
36+
padding-top: 12px;
37+
padding-bottom: 12px;
38+
text-align: center;
39+
}
40+
41+
.isHidden {
42+
display: none;
43+
}
44+
45+
#searchbox {
46+
border: 1px solid #ddd;
47+
border-radius: 50px;
48+
margin-bottom: 12px;
49+
font-size: 16px;
50+
padding: 12px 20px 12px 40px;
51+
text-align: center;
52+
width: 50%;
53+
}

src/favicon.ico

31.3 KB
Binary file not shown.

src/index.html

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!doctype html>
2+
3+
<html lang="en" manifest="manifest.appcache">
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<link rel="stylesheet" type="text/css" href="css/stylesheet.css"/>
8+
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
9+
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
10+
<script src="https://unpkg.com/vue@2.4.2/dist/vue.min.js"></script>
11+
<title>Public APIs</title>
12+
</head>
13+
<header>
14+
<a href="https://github.com/toddmotto/public-apis" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#4783e5; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
15+
<h1 class="center-text">
16+
Public APIs
17+
</h1>
18+
<h3 class="center-text">
19+
A collective list of free APIs for use in web development
20+
</h3>
21+
<h3 class="center-text">
22+
For information on contributing to this project, please see the <a href="https://github.com/toddmotto/public-apis/blob/master/.github/CONTRIBUTING.md">contributing guide</a>
23+
</h3>
24+
</header>
25+
<body>
26+
<div id="app">
27+
<div class="center-text">
28+
<input type="search" id="searchbox" placeholder="Search APIs" autocomplete="off" spellcheck="false" tabindex="0" v-model="filter">
29+
</div>
30+
<div style="overflow-x:auto;">
31+
<table id="entries">
32+
<thead>
33+
<tr class="tbl-head">
34+
<th>API</th>
35+
<th>Description</th>
36+
<th>Auth</th>
37+
<th>HTTPS</th>
38+
<th>Category</th>
39+
</tr>
40+
</thead>
41+
<tbody>
42+
<tr v-for="item in items" v-show="filtered(item)">
43+
<td><a :href="item.Link">{{ item.API }}</a></td>
44+
<td>{{ item.Description }}</td>
45+
<td>{{ (item.Auth) ? item.Auth : '-' }}</td>
46+
<td>{{ (item.HTTPS) ? '✔' : '✖' }}</td>
47+
<td>{{ item.Category }}</td>
48+
</tr>
49+
</tbody>
50+
</table>
51+
</div>
52+
</div>
53+
</body>
54+
<script src="scripts/main.js"></script>
55+
</html>
56+

src/manifest.appcache

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CACHE MANIFEST
2+
index.html
3+
css/stylesheet.css
4+
scripts/main.js
5+
https://unpkg.com/vue@2.4.2/dist/vue.min.js
6+
https://raw.githubusercontent.com/toddmotto/public-apis/master/json/entries.min.json

src/scripts/main.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
new Vue({
2+
data: {
3+
filter: '',
4+
items: ''
5+
},
6+
created() {
7+
fetch('https://raw.githubusercontent.com/toddmotto/public-apis/master/json/entries.min.json')
8+
.then(data => data.json())
9+
.then(data => {
10+
this.items = data.entries;
11+
})
12+
},
13+
methods: {
14+
filtered(item) {
15+
let show = true;
16+
17+
if(this.filter.length) {
18+
19+
show = false;
20+
21+
let filterKeyword = this.filter.toLowerCase();
22+
23+
Object.keys(item).map(function(key) {
24+
if(typeof item[key] === 'string') {
25+
let value = item[key].toString().toLowerCase();
26+
27+
if(value.includes(filterKeyword)) {
28+
show = true;
29+
}
30+
}
31+
});
32+
}
33+
return show;
34+
}
35+
}
36+
}).$mount('#app');

0 commit comments

Comments
 (0)