-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdates.html
63 lines (60 loc) · 2.66 KB
/
updates.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
<link href="https://use.fontawesome.com/releases/v5.14.0/css/all.css" rel="stylesheet">
<link href="udthemes.css" rel="stylesheet">
<title>GitHub Commits</title>
</head>
<body class="bg-gray-900 h-screen">
<div class="container mx-auto mt-20">
<div class="bg-gray-800 rounded-lg p-4">
<h1 class="text-white text-lg font-medium mb-4">Commits</h1>
<table class="table-black border-slate-800">
<thead>
<tr>
<th class="px-4 py-2">SHA</th>
<th class="px-4 py-2">Author</th>
<th class="px-4 py-2">Message</th>
</tr>
</thead>
<tbody id="commits"></tbody>
</table>
</div>
</div>
<script>
fetch('https://api.github.com/repos/BraXon-Devs/Intl-Currency-Calc/commits').then(response => response.json())
.then(
commits => {
const commitsList = document.querySelector('#commits');
commits.forEach(commit => {
const tr = document.createElement('tr');
tr.innerHTML = `
<td class="border px-4 py-2">
<a href="${commit.html_url
}" target="_blank" class="text-indigo-600 hover:text-indigo-300">${commit.sha.substring(0, 7)
}</a>
</td>
<td class="border px-4 py-2">
<img src="${commit.author.avatar_url}" alt="Avatar" width="32" height="30" class="rounded-full inline-block mr-2">
<span class="shadow-lg shadow-cyan-500 text-white">${commit.commit.author.name}</span>
</td>
<td class="border px-4 py-2">
<a href="${commit.html_url}" target="_blank" class="text-indigo-600 hover:text-indigo-300">${commit.commit.message}</a>
${commit.commit.comment_count ? `<span class="shadow-lg shadow-cyan-500 text-white text-sm inline-block mt-2">
<i class="fas fa-comments mr-2"></i>
${commit.commit.comment_count}
</span>` : ''}
<span class="shadow-sm shadow-cyan-500 text-gray-400 text-xs inline-block mt-2">
@${new Date(commit.commit.author.date).toLocaleString()}
</span>
</td>
`;
commitsList.appendChild(tr);
});
});
</script>
</body>
</html>