Skip to content

Commit 1e6c711

Browse files
authored
Merge branch 'main' into main
2 parents 27538b1 + 101d995 commit 1e6c711

File tree

3 files changed

+918
-529
lines changed

3 files changed

+918
-529
lines changed

Website/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,4 @@ <h3>Recommendation Models</h3>
219219
</footer>
220220
<script src="js/script.js"></script>
221221
</body>
222-
</html>
222+
</html>

Website/js/script.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,4 +285,46 @@ async function fetchSubdirectoryCounts() {
285285
fetchRepoStats();
286286
toggleStatsSection();
287287
});
288+
document.addEventListener("DOMContentLoaded", function() {
289+
fetchContributors();
290+
291+
function fetchContributors() {
292+
const repoOwner = 'recodehive'; // Replace with your repository owner
293+
const repoName = 'machine-learning-repos'; // Replace with your repository name
294+
const apiUrl = `https://api.github.com/repos/${repoOwner}/${repoName}/contributors`;
295+
296+
fetch(apiUrl)
297+
.then(response => response.json())
298+
.then(contributors => {
299+
const contributorsGrid = document.getElementById('contributors-grid');
300+
301+
contributors.forEach(contributor => {
302+
const contributorDiv = document.createElement('div');
303+
contributorDiv.className = 'contributor';
304+
305+
contributorDiv.innerHTML = `
306+
<img src="${contributor.avatar_url}" alt="${contributor.login}" class="contributor-image">
307+
<div class="contributor-info">
308+
<a href="${contributor.html_url}" target="_blank" class="contributor-github">GitHub Profile</a>
309+
</div>
310+
`;
311+
312+
contributorsGrid.appendChild(contributorDiv);
313+
});
314+
})
315+
.catch(error => {
316+
console.error('Error fetching contributors:', error);
317+
});
318+
}
319+
});
320+
321+
const toggleDarkModeButton = document.getElementById('toggle-dark-mode');
322+
const body = document.body;
288323

324+
toggleDarkModeButton.addEventListener('click', () => {
325+
body.classList.toggle('dark-mode');
326+
// Change icon based on dark mode status
327+
const icon = toggleDarkModeButton.querySelector('i');
328+
icon.classList.toggle('fa-moon');
329+
icon.classList.toggle('fa-sun');
330+
});

0 commit comments

Comments
 (0)