Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="header">
  <div class="header-img-area">
    <img src="https://avatars.githubusercontent.com/u/9919?s=200&v=4" alt="GitHub Logo"> GitHub
  </div>
  <span class="user-search">
    <input type="search" placeholder="Username" value="ahmetxaltun"><button><i class="bi bi-search"></i></button>
  </span>
</div>

<div id="repo">
  <img src="https://raw.githubusercontent.com/kvssankar/kvssankar/main/octo.gif" alt="GitHub Profile" class="user-img">
  <div class="loading">Please top right <br> enter the GitHub username...</div>
  <div class="user-name"></div>
  <div class="user-username"></div>
  <span class="user-followers"></span>
  <span class="user-following"></span>
  <div class="user-location"></div>
  <div class="user-bio"></div>
</div>
<div class="repos-header"></div>
<div class="user-repos"></div>
              
            
!

CSS

              
                *{
  margin: 0;
  padding: 0;
  font-family: arial;
  outline: none;
}

 /* SCROLL */
 *::-webkit-scrollbar{
    width: 5px;
    background-color: black;
}

*::-webkit-scrollbar-thumb{
    background: #58a6ff;
}

body{
  background: #000;
}

.header{
  position: sticky;
  border-bottom: 1px solid white;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #000;
  color: white;
  padding: 10px;
  margin-bottom: 10px;
}

.header-img-area{
  display: flex;
  align-items: center;
  font-weight: 700;
  gap: 10px;
  font-size: 20px;
}

.header img{
  width: 40px;
  height: 40px;
}

.user-search{
  position: relative;
  padding: 5px;
  padding-left: 10px;
  background: white;
  border-radius: 50px;
}

.user-search input{
  border: none;
  padding: 5px;
  background: transparent;
}

.user-search button{
  padding: 5px 8px;
  border-radius: 50px;
  background: black;
  color: white;
  cursor: pointer;
  border: 1px solid black;
  transition: all .5s;
}

.user-search button:hover{
  background: white;
  color: black;
}

#repo{
  margin-bottom: 10px;
  padding: 20px;
  border-radius: 0 0 10px 10px;
  text-align: center;
  background: #000;
  color: white;
}

.repos-count{
  padding: 5px 15px;
  border-radius: 50px;
  background: rgba(56,139,253,0.15);
  color: #58a6ff;
}

#repo a{
  color: white;
  font-weight: 700;
  font-style: italic;
  text-decoration: none;
}

#repo a:hover{
  text-decoration: underline;
}

.user-img{
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50px;
  margin-bottom: 10px;
  text-align: center;
}

.user-name{
  font-size: 20px;
  margin-bottom: 10px;
}

.user-username,
.user-followers,
.user-following,
.user-bio{
  margin-bottom: 10px;
  text-align: center;
}

.user-location{
  margin: 10px 0;
}

.repos-header{
  color: white;
  padding: 15px 25px;
  font-size: 20px;
  position: sticky;
  top: 61px;
  background: #000;
}

.user-repos{
  margin: 0 20px;
  display: flex;
  flex-direction: column-reverse;
}

.repo{
  margin: 10px 0;
  background: rgb(255, 255, 255, .1);
  padding: 20px;
  border-radius: 10px;
  color: white;
  transition: all .5s;
}

.repo:hover{
  background: rgb(255, 255, 255, .2);
}

.repo-name{
  font-size: 20px;
  color: #58a6ff;
  text-decoration: none;
}

.repo-name:hover{
  text-decoration: underline;
}

.repo-p{
  margin: 10px 0;
  margin-bottom: 15px;
}

.repo-label{
  padding: 5px 10px;
  border-radius: 50px;
  background: rgba(56,139,253,0.15);
  color: #58a6ff;
}

@media screen and (max-width: 360px) {
  .header{
    flex-direction: column;
    gap: 20px;
  }
}
              
            
!

JS

              
                var gitHubURL = "https://github.com/";
var inputValue = document.querySelector("input");
var seeBtn = document.querySelector("button");
var userImg = document.querySelector(".user-img");
var userName = document.querySelector(".user-name");
var userUsername = document.querySelector(".user-username");
var userFollowers = document.querySelector(".user-followers");
var userFollowing = document.querySelector(".user-following");
var userLocation = document.querySelector(".user-location");
var userBio = document.querySelector(".user-bio");
var userRepos = document.querySelector(".user-repos");
var reposHeader = document.querySelector(".repos-header");
var loading = document.querySelector(".loading");

function gitHub(){
  loading.style.display = "none";
  fetch('https://api.github.com/users/'+inputValue.value)
    .then(response => response.json())
    .then(data => {
    reposHeader.innerHTML = "<i class='bi bi-bookmark-star-fill'></i> Repositories <span class='repos-count'>"+ data.public_repos + "</span>";
    userImg.src = data.avatar_url;
    userName.innerText = data.name;
    userUsername.innerHTML = "<a target='_blank' href='"+gitHubURL+data.login+"'>@"+data.login;
    userFollowers.innerText = data.followers + " Followers - ";
    userFollowing.innerText = data.following + " Following";
    userLocation.innerHTML = "<i class='bi bi-geo-alt-fill'></i> " + data.location;
    userBio.innerText = data.bio;
  });
  fetch('https://api.github.com/users/'+inputValue.value+'/repos')
  .then(response => response.json())
  .then(data => {
    const repos = data.map(repo => `
      <div class="repo">
      <a href="${repo.html_url}" target="_blank" class="repo-name"><i class="bi bi-hash"></i>${repo.name}</a>
        <p class="repo-p">${repo.description ? repo.description : "There is no project description."}</p>
        <span class="repo-label"><i class="bi bi-code-slash"></i> ${repo.language ? repo.language : "Unknown"}</span>
      </div>
    `).join('');
    userRepos.innerHTML = repos;
  });
}

seeBtn.addEventListener("click", ()=> {
  gitHub();
});

window.addEventListener("keyup", function (e) {
    if (e.keyCode == 13) {
        e.preventDefault();
        gitHub();
    }
});
              
            
!
999px

Console