mobile contributors list fixes (diddy bro !)

This commit is contained in:
Samidy 2026-04-05 17:54:59 +03:00
parent fe8bfed0dc
commit 6015904a38
2 changed files with 30 additions and 3 deletions

View file

@ -131,8 +131,9 @@ async function fetchcontributors() {
const response = await fetch('https://api.samidy.com/api/contributors'); const response = await fetch('https://api.samidy.com/api/contributors');
if (!response.ok) return; if (!response.ok) return;
const data1 = await response.json(); 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' (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; edideaur.contributions += data1.find((u) => u.login === 'satanyahoo')?.contributions || 0;
} }
data.sort((a, b) => b.contributions - a.contributions);
const con = document.querySelector('.about-contributors'); const con = document.querySelector('.about-contributors');
if (!con) return; if (!con) return;
@ -158,6 +161,7 @@ async function fetchcontributors() {
}); });
} catch (e) { } catch (e) {
const con = document.querySelector('.about-contributors-failed'); const con = document.querySelector('.about-contributors-failed');
if (!con) return;
const userDIV = document.createElement('div'); const userDIV = document.createElement('div');
userDIV.innerHTML = ` userDIV.innerHTML = `
<h4 style="text-align: center; color: var(--muted-foreground);">Failed to Fetch Contributor List</h4> <h4 style="text-align: center; color: var(--muted-foreground);">Failed to Fetch Contributor List</h4>

View file

@ -9915,12 +9915,35 @@ body:has(#side-panel.active) #close-fullscreen-cover-btn {
} }
.about-contributors div { .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: 1px solid var(--border);
border-radius: 14px; border-radius: 14px;
padding: 30px; padding: 20px;
text-align: center; text-align: center;
overflow: hidden; 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 { .about-contributors img {