-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
75 lines (67 loc) · 2.55 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API Website</title>
<link href="https://fonts.googleAPIs.com/css?family=Inter:400,700&display=swap" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head>
<script src="https://kit.fontawesome.com/376f9c1dcc.js" crossorigin="anonymous"></script>
<body>
<header>
<img src="images/API_logo.svg" class="logo" alt="Website Logo">
<h1>API Website</h1>
<p>Find your favorite APIs and start making Apps today!</p>
<input type="text" id="search-box" class="search-box" placeholder="Search APIs...">
</header>
<div class="grid">
<div class="grid-item" onclick="location.href='apis/random-letter/index.html';">
<i class="fa-brands fa-github"></i>
<p style="display: inline;"><b>Random Letter API</b></p>
<p>Returns a Random English Letter.</p>
</div>
<div class="grid-item" onclick="location.href='';">
<i class="fa-brands fa-github"></i>
<p style="display: inline;"><b>Random Word API</b></p>
<p>Returns a Random Word from a list of 3000+ words.</p>
</div>
<div class="grid-item" onclick="location.href='';">
<i class="fa-brands fa-github"></i>
<p style="display: inline;"><b>Random Emoji API</b></p>
<p>Returns a Random Emoji.</p>
</div>
<div class="grid-item" onclick="location.href='';">
<i class="fa-brands fa-github"></i>
<p style="display: inline;"><b>Dictionary API</b></p>
<p>Returns word origin, definition, pronunciation, part of speech, synonym, antonym and from a list of 450K+ words.</p>
</div>
<div class="grid-item" onclick="location.href='';">
<i class="fa-brands fa-github"></i>
<p style="display: inline;"><b>Wallpaper API</b></p>
<p>Returns beautiful wallpaper images.</p>
</div>
</div>
<script>
const searchBox = document.getElementById('search-box');
const gridItems = document.querySelectorAll('.grid-item');
searchBox.addEventListener('input', () => {
const searchTerm = searchBox.value.toLowerCase();
gridItems.forEach((item) => {
const pTags = item.querySelectorAll('p');
const heading = pTags[0].textContent.toLowerCase()
const text = pTags[1].textContent.toLowerCase()
const matchesSearch = heading.includes(searchTerm) || text.includes(searchTerm);
if (matchesSearch) {
item.style.display = '';
} else {
item.style.display = 'none';
}
});
});
</script>
<footer>
<p>© 2023 Paritosh Kumar Tripathi. All rights reserved.</p>
</footer>
</body>
</html>