forked from ghostmkg/web-development
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Contributors.html
48 lines (43 loc) · 2.33 KB
/
Contributors.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GitHub Contributors</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
</style>
</head>
<body class="bg-gradient-to-br from-gray-900 to-gray-800 text-white min-h-screen">
<div class="container mx-auto p-8">
<h1 class="text-5xl font-extrabold text-center mb-12 text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-pink-600">
GitHub Contributors
</h1>
<div id="contributors" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-8"></div>
</div>
<script>
async function fetchContributors() {
const response = await fetch('https://api.github.com/repos/ghostmkg/web-development/contributors');
const contributors = await response.json();
const contributorsContainer = document.getElementById('contributors');
contributors.forEach((contributor, index) => {
const contributorCard = document.createElement('div');
contributorCard.className = 'bg-gray-800 rounded-lg p-6 flex flex-col items-center text-center transform transition duration-300 hover:scale-105 hover:shadow-xl';
contributorCard.style.animation = `fadeIn 0.5s ease-out ${index * 0.1}s both`;
contributorCard.innerHTML = `
<img class="w-32 h-32 rounded-full border-4 border-purple-500 shadow-lg" src="${contributor.avatar_url}" alt="${contributor.login}">
<h2 class="text-2xl font-bold mt-4 text-purple-400">${contributor.login}</h2>
<a href="${contributor.html_url}" class="mt-2 px-4 py-2 bg-purple-600 text-white rounded-full hover:bg-purple-700 transition duration-300" target="_blank">View Profile</a>
<p class="text-lg text-gray-400 mt-4">Contributions: <span class="font-bold text-pink-500">${contributor.contributions}</span></p>
`;
contributorsContainer.appendChild(contributorCard);
});
}
fetchContributors();
</script>
</body>
</html>