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

              
                <script src="https://use.fontawesome.com/7a621ef410.js"></script>

<link href="https://fonts.googleapis.com/css?family=Quicksand|Lato" rel="stylesheet">

<body>
  
 
    
    <div class="container">
      
       <div class="clearfix" id="title" style="background:url(link) no-repeat center center; bakcground-size: cover; margin-bottom: 20px;"><h1 class="text-center"> Twitch Streams </h1>
    
  </div> <!--Title div-->
      
      <div class="row justify-content-center" id="channels-div"> 
        <div class="col-4 mr-3" id="online-column">
          <div class ="row d-flex flex-column" id="online">    
                      
          </div><!--online row-->
        </div> <!--online column-->
          
          <div class="col-4 ml-4" id="offline-column">
          <div class ="row d-flex flex-column" id="offline">
            
            </div><!--offline row-->
          </div><!--offline column-->
            
      </div> <!--closes out channels-div -->

    
    
    
  

  
  
  
  </div> <!--div container-->
  </body>
              
            
!

CSS

              
                body{
  
  
}
img{
text-align:center;
  
}

h3{
text-align:center;
}


              
            
!

JS

              
                //https://wind-bow.gomix.me/twitch-api/streams/<channel id>

$(document).ready(function(){

 var channels = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];
  
for (var i=0; i<channels.length; i++){  

  $.ajax({
  method: "get",
  url:"https://wind-bow.gomix.me/twitch-api/streams/" + channels[i],
  dataType: "jsonp",
  success: function(data){
    
   
    // if statement for offline channels 
     if (data.stream === null){
      
      //sets offlineName to the channel name
      var offlineName = data._links.channel.replace("https://api.twitch.tv/kraken/channels/", "").toLowerCase();
      
      $("#offline").append("<div class='row'>" + "<div class='col m-2'>" + "<h3>" + offlineName + ": Offline" + "</h3>" + "</div>" + "</div>");
    
    } 

    else if (data.stream.channel !== null){
      
    var channelName = data.stream.channel.display_name;
    var channelStatus = data.stream.channel.status;
    var channelLogo= data.stream.channel.logo;
    var channelUrl = data.stream.channel.url;
    var channelGame = data.stream.channel.game;  
      $("#online").append("<div class='row'>" + "<div class='col'>" + "<img class='mx-auto' src='" + channelLogo + "' alt='Logo'>" + "<h3>" + channelName + "</h3>" + "<a href='" + channelUrl + "'>" + "<p>" + channelGame + ": " + channelStatus + "</p>" + "</a>" + "</div>" + "</div>");
            
    } 
    
    
  }, //closes out success function
 
  
});  //closes out ajax request
  };//closes out for loop 
  
}); //closes out document ready

              
            
!
999px

Console