diff --git a/index.html b/index.html index 6ed26f60..2f8fce2d 100644 --- a/index.html +++ b/index.html @@ -465,7 +465,7 @@

A growing community of student developers working together to improve the platform.

diff --git a/pages/pr-contribution/pr-contributors.html b/pages/pr-contribution/pr-contributors.html index 5c2ae455..41eafa70 100644 --- a/pages/pr-contribution/pr-contributors.html +++ b/pages/pr-contribution/pr-contributors.html @@ -1,9 +1,11 @@ + + - + @@ -19,9 +21,12 @@ - + + + +
@@ -39,7 +44,8 @@ - Change mode + Change mode +
@@ -118,11 +124,9 @@

Contact Us

- - - + + - @@ -149,7 +153,8 @@

Contact Us

modeToggle.addEventListener('click', () => { body.classList.toggle('dark-mode'); const isDarkMode = body.classList.contains('dark-mode'); - modeToggle.src = isDarkMode ? 'images/sun.png' : 'images/moon.png'; + modeToggle.src = isDarkMode ? '../../images/sun.png' : '../../images/moon.png'; + }); } @@ -343,7 +348,7 @@

Contact Us

} // If no cache, fetch from API - contentDiv.innerHTML = `
🔄 Fetching fresh data from ${repo}... br>Getting all contributor details - this may take a moment
`; + contentDiv.innerHTML = `
🔄 Fetching fresh data from ${repo}...
Getting all contributor details - this may take a moment
`; try { const headers = { @@ -545,19 +550,20 @@

Contact Us

contentDiv.innerHTML = statsHTML + contributorsHTML + prsHTML; } - function displayContributors() { - const excludedUsers = ['VAIBHAVBABELE', 'dependabot[bot]']; - const sortedContributors = Array.from(contributors.values()) - .filter(c => !excludedUsers.includes(c.name)) - .sort((a, b) => { - if (a.score !== b.score) return b.score - a.score; - return b.totalPRs - a.totalPRs; - }); +function displayContributors() { + // Exclude repo owner + bots + const excludedUsers = ['VAIBHAVBABELE', 'dependabot[bot]']; + const sortedContributors = Array.from(contributors.values()) + .filter(c => !excludedUsers.includes(c.name)) + .sort((a, b) => { + if (a.score !== b.score) return b.score - a.score; + return b.totalPRs - a.totalPRs; // tie-breaker + }); - const topThree = sortedContributors.slice(0, 3); - const restContributors = sortedContributors.slice(3); + const topThree = sortedContributors.slice(0, 3); + const restContributors = sortedContributors.slice(3); - const podiumHTML = ` + const podiumHTML = `
${topThree.length > 1 ? `
@@ -576,11 +582,10 @@

Contact Us

${topThree[1].linkedinUrl ? `` : ''}
- + +

Download Certificate

-
@@ -603,11 +608,9 @@

Contact Us

${topThree[0].linkedinUrl ? `` : ''}
- +

Download Certificate

-
@@ -630,11 +633,9 @@

Contact Us

${topThree[2].linkedinUrl ? `` : ''}
- +

Download Certificate

-
@@ -642,59 +643,56 @@

Contact Us

`; - const listHTML = restContributors.map((contributor, index) => { - const rank = index + 4; - const levelClass = `level-${contributor.level}`; - const levelBadgeClass = `level-${contributor.level}-badge`; - const levelText = ['Beginner', 'Intermediate', 'Advanced'][contributor.level - 1]; + const listHTML = restContributors.map((contributor, index) => { + const rank = index + 4; + const levelClass = `level-${contributor.level}`; + const levelBadgeClass = `level-${contributor.level}-badge`; + const levelText = ['Beginner', 'Intermediate', 'Advanced'][contributor.level - 1]; - return ` -
-
${rank}
-
- ${contributor.name} -
-
-
${contributor.name}
-
- Level ${contributor.level} - ${levelText} -
- ${contributor.bio ? `
${contributor.bio.substring(0, 100)}${contributor.bio.length > 100 ? '...' : ''}
` : ''} + return ` +
+
${rank}
+
+ ${contributor.name} +
+
+
${contributor.name}
+
+ Level ${contributor.level} - ${levelText}
⭐ ${contributor.score}
📊 ${contributor.totalPRs} PRs
-
- - -
+ ${contributor.bio ? `
${contributor.bio.substring(0, 100)}${contributor.bio.length > 100 ? '...' : ''}
` : ''}
- `; - }).join(''); - - return ` -
-

🏆 Top Contributors Ranking

- ${podiumHTML} -
- ${listHTML} +
+ +
+
`; + }).join(''); + + return ` +
+

🏆 Top Contributors Ranking

+ ${podiumHTML} +
+ ${listHTML}
- `; - } +
`; +} + function displayPRs(prs) { const prsHTML = prs.slice(0, 10).map(pr => { @@ -748,11 +746,13 @@

📋 Recent Merged Pull Requests

// Initialize the app window.addEventListener('load', () => { fetchPRs(); - addRefreshButton(); + // addRefreshButton(); }); - \ No newline at end of file + + +