diff --git a/index.html b/index.html index 74401a4..95bf3e6 100644 --- a/index.html +++ b/index.html @@ -4,14 +4,15 @@ - 2KAbhishek's Projects - + Shaheer's Projects + - + + @@ -30,10 +31,7 @@

All Of My Projects

/> -

- Made with ❤ by - 2KAbhishek X OSS -

+ diff --git a/script.js b/script.js index 7218763..0530cde 100644 --- a/script.js +++ b/script.js @@ -1,5 +1,5 @@ -const username = '2KAbhishek'; -const maxPages = 3; +const username = 'Shaheer2812'; +const maxPages = 1; const hideForks = true; const repoList = document.querySelector('.repo-list'); const reposSection = document.querySelector('.repos'); @@ -24,26 +24,26 @@ getProfile(); // display information from github profile const displayProfile = (profile) => { const userInfo = document.querySelector('.user-info'); + + // Handle null values and remove empty fields + const name = profile.name ? profile.name : profile.login; + const bio = profile.bio && profile.bio !== "null" ? `

${profile.bio}

` : ""; + userInfo.innerHTML = `
- user avatar + user avatar
-

${profile.name} - ${profile.login}

-

${profile.bio}

-

- Followers: ${profile.followers} - Repos: ${profile.public_repos} - Gists: ${profile.public_gists} -

+

${name} - ${profile.login}

+ ${bio}

- Work: ${profile.company} - Location: ${profile.location} + Followers: ${profile.followers}   + Repos: ${profile.public_repos}   + Gists: ${profile.public_gists}

`; }; - // get list of user's public repos const getRepos = async () => { let repos = []; @@ -69,14 +69,34 @@ const getRepos = async () => { getRepos(); // display list of all user's public repos +// Define the repositories you want to show +const allowedRepos = [ + "GAN-Image-Synthesis", + "word-embeddings", + "electricity-billing-system", + "Password-Strength-Checker-App", + "Stock-Price-Visualization-App", + "CS-100-VTA", + "House-Pricing-Prediction", + "MERN-ProductManager", + "PakStay-Advisor", + +]; const displayRepos = (repos) => { + console.log("All repos fetched:", repos.map(r => r.name)); // Debugging + console.log("Allowed repos:", allowedRepos); // Debugging + const userHome = `https://github.com/${username}`; filterInput.classList.remove('hide'); + for (const repo of repos) { - if (repo.fork && hideForks) { - continue; + if (!allowedRepos.includes(repo.name.trim())) { + console.log(`Skipping: ${repo.name}`); // Debugging: See which repos are skipped + continue; // Skip this repo if it's not in the allowed list } + console.log(`Showing: ${repo.name}`); // Debugging: See which repos are displayed + const langUrl = `${userHome}?tab=repositories&q=&language=${repo.language}`; const starsUrl = `${userHome}/${repo.name}/stargazers`; const forksUrl = `${userHome}/${repo.name}/network/members`; @@ -118,22 +138,6 @@ const displayRepos = (repos) => { } }; -// dynamic search -filterInput.addEventListener('input', (e) => { - const search = e.target.value; - const repos = document.querySelectorAll('.repo'); - const searchLowerText = search.toLowerCase(); - - for (const repo of repos) { - const lowerText = repo.innerText.toLowerCase(); - if (lowerText.includes(searchLowerText)) { - repo.classList.remove('hide'); - } else { - repo.classList.add('hide'); - } - } -}); - // for programming language icons const devicons = { Git: '',