Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

Save Automatically?

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

              
                <head>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
 <link href="https://fonts.googleapis.com/css?family=Raleway:500" rel="stylesheet">
</head>
<body>
  <nav class="navbar navbar-default navbar-fixed-top">
  <div class="container-fluid">

    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand twitchLogo" href="https://go.twitch.tv/" target='_blank'><i class="fa fa-twitch fa-1x" aria-hidden="true"></i> </a>
       <p class="navbar-brand" id="twitch" href="twitchStreams">Twitch Streams</p>
    </div>

    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav navbar-right">
        
        <li><a onclick="toggle3(this)" href="#">All</a></li>
        
        <li><a onclick="toggle(this)" href="#">Online</a></li>
        <li><a onclick="toggle2(this)" href="#">Offline</a></li>
      </ul>
    </div><!-- /.navbar-collapse -->

  </div><!-- /.container-fluid -->
</nav>
  
   <div id= "results">
    
  </div>
  </body>




              
            
!

CSS

              
                body {
  margin:0;
  background-color: #201d2b;
  font-family: 'Raleway', sans-serif;
  padding-top: 70px;
}

.navbar {
  background-color: #333;
  text-align: center;  
  
}

#twitch {
  color: #d7cdea;
  font-size: 32px;
}

li a {
    text-decoration: none;
    font-size: 18px;
}

li a:hover {background-color:#d7cdea!important;}

i {
  color: #d7cdea;
}

i:hover {
  color: white;
}

.navbar-brand {
  font-size: 32px;
  color: #d7cdea;
}

.row {
  display: flex;
  justify-content: center;
}

.box {
  display: flex;
  justify-content: flex-start;
  width:500px;
  height:100px;
  background-color: #EEEEEE;
  margin:10px;
  box-shadow: 2px 2px 5px 3px rgba(150, 150, 150, .2);
  border-radius: 5px;
}

.imagesml {
  display: flex;
  justify-content: flex-center;
  width: 80px;
  height: 80px;
  margin: 10px;
}

.stat {
  display: flex;
  justify-content: flex-end;
  padding-left: 100px;
  padding-right: 10px;
  padding-top: 10px;
  padding-bottom: 10px;
  
}

a {
  padding: 10px;
  color: #333333;
  font-size: 16px;
  text-decoration: none;
}

a:hover{
  color: #201d2b;
  text-decoration: none;  
}

.stat a {
  color: green;
}
#offline a {
  display: flex;
  justify-content: flex-end;
  color: #201d2b;
  
}
.logo {
  font-size: 20px;
  color: #4b387a;
}

.title {
  font-size: 10px;
  color: #333333;
}
  
              
            
!

JS

              
                 
var streamers = ["cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas", "ESL_SC2", "OgamingSC2"]


 var twitchapi = "https://api.twitch.tv/helix/users?login=" ;
  var tip = twitchapi + streamers;
    tip = tip.replace(/,/g, "&login=");

    var logo;
    var channel;
    var status;
    var title
    var image;
    var link;
    var newstreamers ="https://api.twitch.tv/helix/streams?user_id=30220059";

$.ajax({
    type: "GET",
    dataType: "json",
    url: tip,
 headers: {
   'Client-ID': 'pb7e52cbltfh7e7luw78z2m3row1rc'
 },
    success: function(response) {
 for (i = 0; i <= streamers.length; i++){
   logo = response.data[i].display_name;
   image = response.data[i].profile_image_url;
   channel = response.data[i].id;
   link = "https://www.twitch.tv/" + logo;
   
   newstreamers = newstreamers + "&user_id" + channel;
   var newstreamers2 = newstreamers;
   
   $.ajax({
    type: "GET",
     dataType: "json",
     async: false,
    url: newstreamers2,
 headers: {
   'Client-ID': 'pb7e52cbltfh7e7luw78z2m3row1rc'
 },
     
 success: function(response2) {
   console.log(response2)
  for (var j = 0; j < streamers.length; j++) {
   if (response.data[i].id === response2.data[j].user_id)
   {status = "online"
   title = response2.data[j].title;
    $("#results").prepend("<div class='row toggleonline' id ='toggleonline'><div class ='box onlinebox' id = 'online'><img class = 'imagesml' src ='" + image + "'><a = href = '" + link + "' target = 'blank'>" + logo + title + "<div class = 'stat'>" + status + "</a></div></div></div>");
   }
 else {title = "";
   status = "offline";
  
    $("#results").append("<div class='row toggleoffline' id = 'toggleoffline'><div class ='box offlinebox' id = 'offline'><img class = 'imagesml' src ='" + image + "'><a = href = '" + link + "' target = 'blank'>" + logo + title + "<div class = 'stat'>" + status + "</a></div></div></div>");
      }
      }
  }
     
 });
 }
    }
});

 function toggle(e) {
    var all = document.getElementsByClassName('toggleoffline');

    for(var i = 0; i < all.length; i++) {
        // First make all of the elements with the same class hidden.
        if (all[i].style.display === 'none') {
            all[i].style.display = 'flex';
        }

        // Then make the clicked element visible.
        else {all[i].style.display = 'none';}
    }
}

function toggle2(f) {
    var all = document.getElementsByClassName('toggleonline');

      var all2 = document.getElementsByClassName('toggleoffline');

    for(var k = 0; k < all.length; k++) {
        // First make all of the elements with the same class hidden.
        if (all[k].style.display === 'none') {
            all[k].style.display = 'flex';
        }

        else {
        all[k].style.display = 'none'
     }
    }
}

function toggle3(g) {
    var all = document.getElementsByClassName('row');

    for(var l = 0; l < all.length; l++) {
        // First make all of the elements with the same class hidden.
        if (all[l] !== this) {
            all[l].style.display = 'flex';
        }

        // Then make the clicked element visible.
        g.style.visibility = 'visible';
    }
}



              
            
!
999px

Console