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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <div class="container">
   <div id "header" class="text-center">
     <img id="twitchhead" src="https://res.cloudinary.com/dtjqdtdyi/image/upload/v1489941851/Twitch_BlackLogo_pc9uhs.svg">
     <h2 id = "fccStatus"></h3>   
  </div>
<div id="deletetarget">  
   <div class="row head">
      <div class="title col-md-4">
     </div>
      <div class = "title"  class="col-md-4">
     </div>
      <div  align="right" class=" col-md-4">
     </div>
   </div>
 
   <div class="row" id="parent">
     
      <div id="logo" class="status col-md-4">
     </div>
      <div class = "disp" id="disp" class="col-md-4">
     </div>
      <div id="linkstatus">
     </div>
   </div>
  
   <div class="streaminfo" id="streaminfo">
  </div>
  
  <div class="row" id="parent0">
      <div id="logo0" class="status col-md-4">
     </div>
      <div class = "disp" id="disp0" class="col-md-4">
     </div>
      <div id="linkstatus0">
    </div>
  </div>
  
  <div class="streaminfo" id= "streaminfo0">
  </div>
  
   <div class="row" id="parent1">
      <div id="logo1" class="status col-md-4">
     </div>
      <div class = "disp" id="disp1" class="col-md-4">
     </div>
      <div id="linkstatus1">
     </div>
   </div>
  
   <div class="streaminfo" id= "streaminfo1">
  </div>
  
  <div class="row" id="parent2">
      <div id="logo2" class="status col-md-4">
     </div>
      <div class = "disp" id="disp2" class="col-md-4">
     </div>
     <div id="linkstatus2">
    </div>
  </div>
  
  <div class="streaminfo" id= "streaminfo2">
  </div>
  
  <div class="row" id="parent3">
      <div id="logo3" class="status col-md-4">
     </div>
      <div id="disp3" class = "disp"  class="col-md-4">
     </div>
     <div id="linkstatus3">
    </div>
  </div>
  
  <div class="streaminfo" id= "streaminfo3">
  </div>
  
  <div class="row" id="parent4">
      <div id="logo4" class="status col-md-4">
     </div>
      <div id="disp4" class = "disp"  class="col-md-4">
     </div>
      <div id="linkstatus4">
     </div>
  </div>
  
  <div class="streaminfo" id= "streaminfo4">
  </div>
  
  <div class="row" id="parent5">
      <div id="logo5" class="status col-md-4">
     </div>
      <div id="disp5" class = "disp"  class="col-md-4">
     </div>
      <div id="linkstatus5">
     </div>
  </div>
  
  <div class="streaminfo" id= "streaminfo5">
  </div>
  
  <div class="row" id="parent6">
      <div id="logo6" class="status col-md-4">
     </div>
      <div id="disp6" class = "disp"  class="col-md-4">
     </div>
      <div id="linkstatus6">
     </div>
  </div>
  
  <div class="streaminfo" id= "streaminfo6">
  </div>
  
  <div class="row" id="parent7">
      <div id="logo7" class="status col-md-4">
     </div>
      <div id="disp7" class = "disp"  class="col-md-4">
     </div>
     <div id="linkstatus7">
    </div>
  </div>
  
  <div class="streaminfo" id= "streaminfo7">
  </div>
  
  <div class="row" id="parent8">
      <div id="logo8" class="status col-md-4">
     </div>
      <div id="disp8" class = "disp"  class="col-md-4">
     </div>
      <div id="linkstatus8">
     </div>
  </div>
  
  <div class="streaminfo" id= "streaminfo8">
  </div>
  
  <div class="row" id="parent9">
      <div id="logo9" class="status col-md-4">
     </div>
      <div id="disp9" class = "disp"  class="col-md-4">
     </div>
      <div id="linkstatus9">
    </div>
  </div>
  
  <div class="streaminfo" id= "streaminfo9">
  </div>
  
</div>

<div class="bottom">&nbsp </div>
              
            
!

CSS

              
                body{
  color:white;
  background:url("https://res.cloudinary.com/dtjqdtdyi/image/upload/v1489941450/purple-gradient-background_xbehha.jpg");
  background-size:cover;
   background-repeat:no-repeat;
   background-attachment: fixed;
   height:100vh;
}

#twitchhead{
  padding:11px;
  height:155px;
  width:452px;
  background:transparent;  
}

img{
  padding:11px;
  height:89px;
  width:89px;
  background:transparent;
}
.disp{
 font-size:300%;
 width: 33%;
}
.online{
  color:white;
  float:right;
  margin-top:25px;
}

.status{
  text-align:center;
  min-width:315px; 
}

.head{
  text-align:center;
  min-width:100%;
  font-size:200%;
  margin-bottom:25px;
}

.streaminfo{
  text-align:center;
  margin-bottom:11px;
}

.bottom{
  margin-top: 55px;
}
              
            
!

JS

              
                $(document).ready(function(){
  var following =[];
  
  
    //FreeCodeCamp Steam info and status  
$.ajax({
  dataType: "json",
  type: 'GET',
  url: 'https://api.twitch.tv/kraken/streams/ninja',
  headers: {
   'Client-ID': '5349wp2oyhk93zmm61qab0xfgl99r0'
      },
  success: function(data1) {
   
    //set status div as a link to watch
    document.getElementById('linkstatus').innerHTML = '<a href="https://www.twitch.tv/'+'freecodecamp'+'"><div id="status" class="status col-md-4">Status:</div></a>';
   //set Status image to X if offline
    if(data1.stream===null){
        document.getElementById("status").innerHTML = "<img src= 'https://res.cloudinary.com/dtjqdtdyi/image/upload/c_scale,h_72/v1486943434/4dd652e557867f30b77b3e6678a1dee6_styled-x-icon-114664-x-mark-clipart-black-and-white_512-512_bfbnef.png'>";  
        document.getElementById("streaminfo").innerHTML = "Currently Offline";
   }
    
   //set Status image to check if online
    else{
        $("#status").html("<img src= 'https://res.cloudinary.com/dtjqdtdyi/image/upload/c_scale,h_72,w_72/v1486944077/fa7bcce74062b922d48c582907f428fa_green-check-clipart-clipart-green-check_582-596_ioneew.webp'><p class='online'>Click to watch live!</p>");   
        
        $("#streaminfo").html(data1.status);
  }
 }
});
 
  
  $.ajax({
    dataType: "json",
    type: 'GET',
    url: 'https://api.twitch.tv/kraken/channels/ninja',
    headers: {
   'Client-ID': '5349wp2oyhk93zmm61qab0xfgl99r0'
        },
    success: function(data2) {
       
      $("#disp").text(data2.display_name);
      //retrieve logo
      var image = ("<img src='"+data2.logo+"'>");
      //Set logo to logo      
      document.getElementById("logo").innerHTML = image;    
      }    
 });
  
  
   $.ajax({
    dataType: "json",
    type: 'GET',
    url: "https://api.twitch.tv/kraken/users/freecodecamp/follows/channels",
    headers: {
   'Client-ID': '5349wp2oyhk93zmm61qab0xfgl99r0'
        },
    success: function(data3) {
      //create array of followers' urls of freecodecamp
             
             for (var i=0;i<data3.follows.length;i++) {
                var displayName= data3.follows[i].channel.display_name;
         //add the followers to array from JSON data
            following.push('https://api.twitch.tv/kraken/streams/'+displayName);
               var tes = "ninja";
               
       }
     
      
      

      for (var i=0; i<following.length;i++){
        
         $.ajax({
    dataType: "json",
    type: 'GET',
    url: following[i],
    headers: {
   'Client-ID': '5349wp2oyhk93zmm61qab0xfgl99r0'
        },
    success: function(data4) {
      $("#streaminfo" + i).html(data4.status)
         if(data4.stream===null){ 
            $("#streaminfo" + i).html("Currently Offline");
           
            $("#status" + i).html("<img src= 'https://res.cloudinary.com/dtjqdtdyi/image/upload/c_scale,h_72/v1486943434/4dd652e557867f30b77b3e6678a1dee6_styled-x-icon-114664-x-mark-clipart-black-and-white_512-512_bfbnef.png'>");     
                  }
   //set Status image to check if online
                    else{
                      $("#status" + i).html("<img src= 'https://res.cloudinary.com/dtjqdtdyi/image/upload/c_scale,h_72,w_72/v1486944077/fa7bcce74062b922d48c582907f428fa_green-check-clipart-clipart-green-check_582-596_ioneew.webp'><p class='online'>Click to watch live!</p> ");}
      
      
           
                   //changes innerhtml of status block to include link to watch steam.  Used this ajax call because of list of names for links
                    document.getElementById('linkstatus'+i).innerHTML = '<a href="https://www.twitch.tv/'+data4.display_name+'"><div id="status'+i+'" class="status col-md-4">Status:</div></a>';
                    
                    
                    document.getElementById("disp"+i).innerHTML = data4.display_name;
                    //retrieve logo
                    var image = ("<img src='"+data4.logo+"'>");

                     //Set logo to logo      
                    document.getElementById("logo"+i).innerHTML = image;
                    //}
        
      }, //success,
                             error: function(){ 
                    
                    var parent = document.getElementById("deletetarget");
                    var child = document.getElementById("streaminfo"+i);
                        parent.removeChild(child);
                    
                    
                    var parent1 = document.getElementById("deletetarget");
                       var child1 = document.getElementById("parent"+i);
                        parent1.removeChild(child1);}
          
         });//ajax inside for loop
      
      }//for loop
      
    }// end of function(data3)
   });//and of ajax
             
 })
   
         


              
            
!
999px

Console