diff --git a/index.html b/index.html index 8131bc5..476491f 100644 --- a/index.html +++ b/index.html @@ -1,31 +1,32 @@ - - + - 2KAbhishek's Projects - + Tylerguy's Projects + - + - + - +
-

All Of My Projects

- Some useful, some stupid, all fun! -
- -
- -
- - -
-

Made with ❤ by 2KAbhishek X OSS

+

All Of My Projects

+ A variety of projects showcasing all of my skills +
+ +
+ + +

+ Made with ❤ by + 2KAbhishek X OSS +

- - + diff --git a/script.js b/script.js index 785110a..0efeb75 100644 --- a/script.js +++ b/script.js @@ -1,39 +1,36 @@ -const username = '2KAbhishek'; +const username = "tylerguy"; const maxPages = 2; const hideForks = true; -const repoList = document.querySelector('.repo-list'); -const reposSection = document.querySelector('.repos'); -const filterInput = document.querySelector('.filter-repos'); +const repoList = document.querySelector(".repo-list"); +const reposSection = document.querySelector(".repos"); +const filterInput = document.querySelector(".filter-repos"); // get information from github profile const getProfile = async () => { - const res = await fetch( - `https://api.github.com/users/${username}` - // { - // headers: { - // Accept: 'application/vnd.github+json', - // Authorization: 'token your-personal-access-token-here' - // } - // } - ); - const profile = await res.json(); - displayProfile(profile); + const res = await fetch( + `https://api.github.com/users/${username}` + // { + // headers: { + // Accept: 'application/vnd.github+json', + // Authorization: 'token your-personal-access-token-here' + // } + // } + ); + const profile = await res.json(); + displayProfile(profile); }; getProfile(); // display infomation from github profile const displayProfile = (profile) => { - const userInfo = document.querySelector('.user-info'); - userInfo.innerHTML = ` + const userInfo = document.querySelector(".user-info"); + userInfo.innerHTML = `
user avatar

${profile.name}

${profile.bio}

-

- Location: ${profile.location} -

@${profile.login} Repos: ${profile.public_repos} @@ -45,145 +42,132 @@ const displayProfile = (profile) => { // get list of user's public repos const getRepos = async () => { - let repos = []; - let res; - for (let i = 1; i <= maxPages; i++) { - res = await fetch( - `https://api.github.com/users/${username}/repos?&sort=pushed&per_page=100&page=${i}` - // { - // headers: { - // Accept: 'application/vnd.github+json', - // Authorization: - // 'token your-personal-access-token-here' - // } - // } - ); - let data = await res.json(); - repos = repos.concat(data); - } - repos.sort((a, b) => b.forks_count - a.forks_count); - repos.sort((a, b) => b.stargazers_count - a.stargazers_count); - displayRepos(repos); + let repos = []; + let res; + for (let i = 1; i <= maxPages; i++) { + res = await fetch( + `https://api.github.com/users/${username}/repos?&sort=pushed&per_page=100&page=${i}` + // { + // headers: { + // Accept: 'application/vnd.github+json', + // Authorization: + // 'token your-personal-access-token-here' + // } + // } + ); + let data = await res.json(); + repos = repos.concat(data); + } + repos.sort((a, b) => b.forks_count - a.forks_count); + repos.sort((a, b) => b.stargazers_count - a.stargazers_count); + displayRepos(repos); }; getRepos(); // display list of all user's public repos const displayRepos = (repos) => { - const userHome = `https://github.com/${username}` - filterInput.classList.remove('hide'); - for (const repo of repos) { - if (repo.fork && hideForks) { - continue; - } + const userHome = `https://github.com/${username}`; + for (const repo of repos) { + if (repo.fork && hideForks) { + continue; + } - const langUrl = `${userHome}?tab=repositories&q=&language=${repo.language}` - const starsUrl = `${userHome}/${repo.name}/stargazers` - const forksUrl = `${userHome}/${repo.name}/network/members` + const langUrl = `${userHome}?tab=repositories&q=&language=${repo.language}`; + const starsUrl = `${userHome}/${repo.name}/stargazers`; + const forksUrl = `${userHome}/${repo.name}/network/members`; - let listItem = document.createElement('li'); - listItem.classList.add('repo'); - listItem.innerHTML = ` + let listItem = document.createElement("li"); + listItem.classList.add("repo"); + listItem.innerHTML = `

${repo.name}

- ${repo.description}

` + ${repo.description}

`; - if (repo.stargazers_count > 0) { - listItem.innerHTML += ` - ⭐ ${repo.stargazers_count}` - } + if (repo.stargazers_count > 0) { + listItem.innerHTML += ` + ⭐ ${repo.stargazers_count}`; + } - if (repo.language) { - listItem.innerHTML += ` - ${devicons[repo.language]}` - } + if (repo.language) { + listItem.innerHTML += ` + ${devicons[repo.language]}`; + } - if (repo.forks_count > 0) { - listItem.innerHTML += ` - ${devicons["Git"]} ${repo.forks_count}` - } + if (repo.forks_count > 0) { + listItem.innerHTML += ` + ${devicons["Git"]} ${repo.forks_count}`; + } - if (repo.homepage && repo.homepage !== "") { - listItem.innerHTML += `

+ if (repo.homepage && repo.homepage !== "") { + listItem.innerHTML += `

Code ${devicons["Github"]} Live ${devicons["Chrome"]}
`; - } else { - listItem.innerHTML += `

+ } else { + listItem.innerHTML += `

View Project ${devicons["Github"]}
`; - } - - repoList.append(listItem); } -}; -// 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'); - } - } -}); + repoList.append(listItem); + } +}; // for programming language icons const devicons = { - Git: '', - Github: '', - Chrome: '', - Assembly: ' Assembly', - 'C#': ' C#', - 'C++': ' C++', - C: ' C', - Clojure: ' C', - CoffeeScript: - ' CoffeeScript', - Crystal: ' Crystal', - CSS: ' CSS', - Dart: ' Dart', - Dockerfile: ' Docker', - Elixir: ' Elixir', - Elm: ' Elm', - Erlang: ' Erlang', - 'F#': ' F#', - Go: ' Go', - Groovy: ' Groovy', - HTML: ' HTML', - Haskell: ' Haskell', - Java: ' Java', - JavaScript: ' JavaScript', - Julia: ' Julia', - 'Jupyter Notebook': ' Jupyter', - Kotlin: ' Kotlin', - Latex: ' Latex', - Lua: ' Lua', - Matlab: ' Matlab', - Nim: ' Nim', - Nix: ' Nix', - ObjectiveC: ' ObjectiveC', - OCaml: ' OCaml', - Perl: ' Perl', - PHP: ' PHP', - PLSQL: ' PLSQL', - Processing: - ' Processing', - Python: ' Python', - R: ' R', - Ruby: ' Ruby', - Rust: ' Rust', - Sass: ' Sass', - Scala: ' Scala', - Shell: ' Shell', - Solidity: ' Solidity', - Stylus: ' Stylus', - Svelte: ' Svelte', - Swift: ' Swift', - Terraform: ' Terraform', - TypeScript: ' TypeScript', - 'Vim Script': ' Vim Script', - Vue: ' Vue', + Git: '', + Github: '', + Chrome: '', + Assembly: ' Assembly', + "C#": ' C#', + "C++": ' C++', + C: ' C', + Clojure: ' C', + CoffeeScript: + ' CoffeeScript', + Crystal: ' Crystal', + CSS: ' CSS', + Dart: ' Dart', + Dockerfile: ' Docker', + Elixir: ' Elixir', + Elm: ' Elm', + Erlang: ' Erlang', + "F#": ' F#', + Go: ' Go', + Groovy: ' Groovy', + HTML: ' HTML', + Haskell: ' Haskell', + Java: ' Java', + JavaScript: ' JavaScript', + Julia: ' Julia', + "Jupyter Notebook": ' Jupyter', + Kotlin: + ' Kotlin', + Latex: ' Latex', + Lua: ' Lua', + Matlab: ' Matlab', + Nim: ' Nim', + Nix: ' Nix', + ObjectiveC: ' ObjectiveC', + OCaml: ' OCaml', + Perl: ' Perl', + PHP: ' PHP', + PLSQL: ' PLSQL', + Processing: + ' Processing', + Python: + ' Python', + R: ' R', + Ruby: ' Ruby', + Rust: ' Rust', + Sass: ' Sass', + Scala: ' Scala', + ShaderLab: ' Unity/ShaderLab', + Shell: + ' Shell', + Solidity: ' Solidity', + Stylus: ' Stylus', + Svelte: ' Svelte', + Swift: ' Swift', + Terraform: ' Terraform', + TypeScript: ' TypeScript', + "Vim Script": ' Vim Script', + Vue: ' Vue', }; diff --git a/style.css b/style.css index fdd7ec0..aecda64 100644 --- a/style.css +++ b/style.css @@ -101,8 +101,7 @@ ul { color: var(--text); font-size: 18px; padding: 2em; - border-top-left-radius: 20px; - border-top-right-radius: 20px; + border-radius: 20px; } .user-info figure {