Skip to content

Commit 183d721

Browse files
authored
Merge pull request #1160 from Tejashri-Taral/Contributors
2 parents acdab80 + a3b93fe commit 183d721

File tree

3 files changed

+135
-1
lines changed

3 files changed

+135
-1
lines changed

Website/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ <h2>Repositories</h2>
8383
</ul>
8484
</section>
8585

86+
<section id="contributors">
87+
<h1 class="contri-heading">Our Contributors</h1>
88+
<div id="contributors-grid" class="contributors-grid">
89+
<!-- Contributors will be loaded here by JavaScript -->
90+
</div>
91+
</section>
92+
93+
8694
</main>
8795

8896
<footer class="footer">

Website/js/script.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,37 @@ document.addEventListener('DOMContentLoaded', function() {
112112
fetchRepoStats();
113113
toggleStatsSection();
114114
});
115+
116+
document.addEventListener("DOMContentLoaded", function() {
117+
fetchContributors();
118+
119+
function fetchContributors() {
120+
const repoOwner = 'recodehive'; // Replace with your repository owner
121+
const repoName = 'machine-learning-repos'; // Replace with your repository name
122+
const apiUrl = `https://api.github.com/repos/${repoOwner}/${repoName}/contributors`;
123+
124+
fetch(apiUrl)
125+
.then(response => response.json())
126+
.then(contributors => {
127+
const contributorsGrid = document.getElementById('contributors-grid');
128+
129+
contributors.forEach(contributor => {
130+
const contributorDiv = document.createElement('div');
131+
contributorDiv.className = 'contributor';
132+
133+
contributorDiv.innerHTML = `
134+
<img src="${contributor.avatar_url}" alt="${contributor.login}" class="contributor-image">
135+
<div class="contributor-info">
136+
<a href="${contributor.html_url}" target="_blank" class="contributor-github">GitHub Profile</a>
137+
</div>
138+
`;
139+
140+
contributorsGrid.appendChild(contributorDiv);
141+
});
142+
})
143+
.catch(error => {
144+
console.error('Error fetching contributors:', error);
145+
});
146+
}
147+
});
148+

Website/styles.css

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,96 @@ button#toggle-languages:hover {
226226
flex: 1 1 100%;
227227
max-width: 100%;
228228
}
229-
}
229+
}
230+
#contributors {
231+
padding: 40px;
232+
background-color: #f9f9f9;
233+
text-align: center;
234+
}
235+
236+
#contributors h2 {
237+
font-size: 28px;
238+
margin-bottom: 20px;
239+
color: #333;
240+
}
241+
242+
/* Container for contributors grid */
243+
#contributors-grid {
244+
display: flex;
245+
flex-wrap: wrap;
246+
gap: 20px; /* Reduced space between contributors */
247+
justify-content: center;
248+
padding: 20px; /* Padding around the grid */
249+
background: linear-gradient(135deg, #f0f4f8, #cfd9e5); /* Subtle gradient background */
250+
}
251+
252+
/* Styling for individual contributor div */
253+
.contributor {
254+
display: flex;
255+
flex-direction: column;
256+
align-items: center;
257+
text-align: center;
258+
max-width: 180px; /* Adjusted width for better visuals */
259+
border: none; /* Remove default border */
260+
border-radius: 15px; /* More rounded corners */
261+
padding: 15px;
262+
background: #ffffff; /* White background */
263+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Enhanced shadow for depth */
264+
transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transition effects */
265+
}
266+
267+
.contributor:hover {
268+
transform: translateY(-8px); /* Slight lift effect on hover */
269+
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Stronger shadow on hover */
270+
}
271+
272+
/* Styling for contributor's image */
273+
.contributor-image {
274+
width: 110px; /* Adjusted size */
275+
height: 110px; /* Adjusted size */
276+
border-radius: 50%; /* Circular image */
277+
object-fit: cover; /* Ensure image covers area without distortion */
278+
border: 3px solid #0366d6; /* Border around the image */
279+
transition: border-color 0.3s ease; /* Smooth border color change */
280+
}
281+
282+
.contributor-image:hover {
283+
border-color: #024c8c; /* Darker border color on hover */
284+
}
285+
286+
/* Styling for the GitHub profile link */
287+
.contributor-info {
288+
margin-top: 10px; /* Adjusted space between image and link */
289+
}
290+
291+
.contributor-github {
292+
text-decoration: none;
293+
color: #0366d6; /* GitHub blue color */
294+
font-size: 14px; /* Slightly smaller font size */
295+
font-weight: bold; /* Bold font */
296+
background: linear-gradient(135deg, #f0f4f8, #cfd9e5); /* Gradient background */
297+
padding: 8px 12px; /* Adjusted padding around the link */
298+
border-radius: 20px; /* Rounded button shape */
299+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow for button */
300+
transition: background 0.3s ease, color 0.3s ease; /* Smooth transition effects */
301+
}
302+
303+
.contributor-github:hover {
304+
background: #0366d6; /* Darker background on hover */
305+
color: #ffffff; /* White text color on hover */
306+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Stronger shadow on hover */
307+
}
308+
309+
/* Styling for the heading with class 'contri-heading' */
310+
.contri-heading {
311+
font-size: 2.5rem; /* Increase font size */
312+
font-weight: 900; /* Bold font weight */
313+
color: #2c3e50; /* Dark color for better contrast */
314+
315+
}
316+
317+
318+
319+
320+
321+

0 commit comments

Comments
 (0)