cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <html>
  <head>
    <script defer src="https://use.fontawesome.com/releases/v5.0.9/js/all.js" integrity="sha384-8iPTk2s/jMVj81dnzb/iFR2sdA7u06vHJyyLlAd4snFpCl/SnyUjRrbdJsw1pGIl" crossorigin="anonymous"></script>
    <link href="https://fonts.googleapis.com/css?family=Dosis" rel="stylesheet">
    <title>Shayna's Twitch App</title>
  </head>
  <body>
    <div class='container text-center'>
      <h1><i class="fab fa-twitch fa-2x"></i> Twitch Streamers</h1>
      <div class="row">
        <div class="col-md-8 col-centered">
          <div class= 'content'>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
      
            
          
!
            
              body {
  background-color: #6441a5;
  color: #FFFFFF;
  text-align: center;
  margin: 20px;
}

h1 {
  padding: 10px;
  font-family: 'Dosis', sans-
    serif;
  font-size: 3.5em;
}

a {
  font-weight: bold;
}

.results {
  color: #6441a5;
  background-color: #FFFFFF;
  font-size: 1.5em;
  line-height: 75px;
  vertical-align: middle;
  border: solid #6441a5 4px;
  border-radius: 10px;  
  padding: 8px;
}

.content {
  color: #6441a5;
  text-align: left;
}

.col-centered {
    float: none;
    margin: 0 auto;
}

.user {
  height: 80px;
  height: 80px;
  border-radius: 5px;
  /*border: solid #6441a5 2px;*/
  padding: 0px;
  margin: 0px;
}

.no-padding {
   padding: 0 !important;
   margin: 0 !important;
}
            
          
!
            
              $( document ).ready(function() {
  
  var users = ["ESL_SC2","OgamingSC2","cretetion","freecodecamp","storbeck","habathcx","RobotCaleb","noobs2ninjas","sleepcycles","GoOffKings","contrapoints"];
  
  for (let i = 0; i < users.length; i++) {
    
    var clientUrl = 'https://wind-bow.glitch.me/twitch-api/users/' + users[i];
    
    $.getJSON(clientUrl, function(clientData) {
      
      var user = clientData.name;
      var channel = clientData._id;
      var logo = clientData.logo;
      var displayName = clientData.display_name;
      
      var listUrl = 'https://wind-bow.glitch.me/twitch-api/streams/' + user + '?callback=?';
      
      var userLink = 'https://www.twitch.tv/' + user;
      
      $.getJSON(listUrl, function(listData) {        
        
        function streamStatus() {
          if (listData.stream !== null ) {
            return "Now streaming: <strong>" + listData.stream.game + "</strong>";
          } else {
            return "<em>Offline</em>";
          }
        };
        
        var playerImage = '<div class = "col-sm-2 no-padding"><a href="' + userLink + '" target="_blank"><img class="user" src=' + logo +'></a></div>';
        
        var playerName = '<div class = "col-sm-2 text-right"><a href="' + userLink + '" target="_blank">' + displayName + '</a></div>';
        
        var streamerInfo = '<div class ="row results">' + playerImage + playerName + '<div class = "col-sm-8 text-center">' + streamStatus() + '</div>';   
        
      if (listData.stream !== null ) {
        $( "div.content" ).prepend(streamerInfo);
      }
      
      if (listData.stream === null ) {
        $( "div.content" ).append(streamerInfo);
      }
        
      });
    });
  }
});

            
          
!
999px
Loading ..................

Console