diff --git a/js/app.js b/js/app.js index 39928ae..60ef923 100644 --- a/js/app.js +++ b/js/app.js @@ -131,8 +131,9 @@ async function fetchcontributors() { const response = await fetch('https://api.samidy.com/api/contributors'); if (!response.ok) return; const data1 = await response.json(); + if (!Array.isArray(data1)) return; - const data = data1.filter( + let data = data1.filter( (user) => user.type !== 'Bot' && user.login !== 'edidealt' && user.login !== 'satanyahoo' ); @@ -142,6 +143,8 @@ async function fetchcontributors() { edideaur.contributions += data1.find((u) => u.login === 'satanyahoo')?.contributions || 0; } + data.sort((a, b) => b.contributions - a.contributions); + const con = document.querySelector('.about-contributors'); if (!con) return; @@ -158,6 +161,7 @@ async function fetchcontributors() { }); } catch (e) { const con = document.querySelector('.about-contributors-failed'); + if (!con) return; const userDIV = document.createElement('div'); userDIV.innerHTML = `

Failed to Fetch Contributor List

diff --git a/styles.css b/styles.css index 2d3d2e4..b18280a 100644 --- a/styles.css +++ b/styles.css @@ -9915,12 +9915,35 @@ body:has(#side-panel.active) #close-fullscreen-cover-btn { } .about-contributors div { - width: calc(20% - 8px); + flex: 1 1 calc(25% - 10px); + min-width: 150px; + max-width: calc(50% - 10px); border: 1px solid var(--border); border-radius: 14px; - padding: 30px; + padding: 20px; text-align: center; overflow: hidden; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +@media (max-width: 768px) { + .about-contributors div { + flex: 1 1 calc(50% - 10px); + max-width: 100%; + padding: 15px; + } +} + +.about-contributors a { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + text-decoration: none; + color: inherit; } .about-contributors img {