-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
90 lines (75 loc) · 3.54 KB
/
index.html
File metadata and controls
90 lines (75 loc) · 3.54 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" type="image/png" href="./S-LOGO.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<link rel="stylesheet" href="./style.css">
<title>HTML5 essence</title>
</head>
<body>
<h1>HTML5 essence</h1>
<a href="https://github.com/WebD-Essentials" target="_blank">@WebD-Essentials</a> <br> <br>
<div style="overflow-x:auto;">
<table>
<thead>
<tr>
<th>Date</th>
<th class="title">Title</th>
<th>Preview</th>
<th>@hashnode</th>
<th>@gh-page</th>
<th>Source Code</th>
<th>Download Code</th>
<th style="width:300px;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
</tbody>
</table>
</div>
<script>
const firebaseBaseURL = `https://quotesman11-default-rtdb.firebaseio.com/blogs.json?orderBy=\"series\"&equalTo=\"HTML5\"`;
const table = document.querySelector("table tbody");
const repoURL = "https://github.com/WebD-Essentials/HTML5";
const githubPage = "https://razaahmad333.github.io/hashnode-blogs/";
fetch(firebaseBaseURL)
.then(response => response.json())
.then(data => {
table.innerHTML = "";
insertDataIntoTable(Object.values(data));
});
function insertDataIntoTable(blogs) {
blogs.forEach(blog => {
const row = document.createElement("tr");
row.innerHTML = `
<td data-label="Date">${blog.date}</td>
<td data-label="Title">${blog.title}</td>
<td data-label="Preview"><a href="./${blog.folder}" target="_blank">Live</a></td>
<td data-label="@hashnode"><a href="${blog.link}" target="_blank">Read </a></td>
<td data-label="@gh-page"><a href="${blog.ghPageLink}" target="_blank">Read</a></td>
<td data-label="Source Code"><a href="${repoURL}/tree/${blog.folder}" target="_blank">Open</a></td>
<td data-label="Download Code"><a href="${repoURL}/archive/refs/heads/${blog.folder}.zip" target="_blank">Download Code</a></td>
<td data-label="Description" class="hideAtSmall desc " title=${blog.description}> ${blog.description} </td>
<td class="hideAtLarge" >${blog.description}</td>
`;
table.appendChild(row);
});
}
</script>
</body>
</html>