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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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>
      <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">
      <!-- Latest compiled and minified CSS -->
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    
     <!-- jQuery library -->
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
      <!-- Latest compiled JavaScript -->
      <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha.6/css/bootstrap.min.css">

      
        <title>Twitch api</title>
    </head>
<body id="body">
  Body
  <div class="buttons container-fluid">
 <ul class="nav nav-pills row">
 <li role="presentation" class="active home"><a data-toggle="pill" class="homelink" href="#A">A</a></li>
  <li role="presentation" class="home"><a data-toggle="pill" class="homelink" href="#B">B</a></li>
  <li role="presentation" class="home"><a data-toggle="pill" class="homelink" href="#C">C</a></li>
</ul>
  </div>
  <div class="display tab-content">
  <div id="A" class="tab-pane fade in active">
    A <div id="bob">  </div>
  </div>
  <div id="B" class="tab-pane fade">
B
  </div>
  <div id="C" class="tab-pane fade">
C
  </div>
</div>
  </body>
  
  </html>
              
            
!

CSS

              
                * {
    text-decoration: none !important;
    text-align:center;
    color:black;
    font: {
    family: Georgia, sans-serif;
    margin:0;
    padding:0;
    text-decoration: none;

    }
  }
#body{
  height:100vh;
  width:100vw;
  border:solid red;
 
  .buttons{
   display: flex;
   flex-direction: row;
   align-items: center;
    position:fixed;
    overflow: auto;
    font-size: calc(1vmin + 1vmax);
    top:25vh;
    left:0vw;
    width:100vw;
    height:20vh;
    color:black;
    border:solid;
    .nav{
       display: flex;
       justify-content:space-evenly;;
      width:100vw;

    .home{
      display:flex;
      border-radius:0%;
      border: solid red;
      .selected{
  background-color:black !important;
  color:red;
}
      .homelink{
       
        width:15vw;
        border-radius:0;
        color:white;
        background-color:grey;
        transition: background-color .2s linear, color .2s linear;
        
        &:hover{
          background-color:black;
          color:grey;
        }
      }
    }
    }
  }
  .display{
    position:fixed;
    top:45vh;
    width:100vw;
    height:55vh;
  #A{
    height:55vh;
    border:solid red;
    
  }
  #B{
    height:55vh;
    border:solid blue;
    
  }
  #C{
    height:55vh;
    border:solid green;
  }
  }
}

              
            
!

JS

              
                $(document).ready(function(){
$('.homelink').on('click', function(){
    $('.homelink').removeClass('selected');
    $(this).addClass('selected');
});
  var url = "https://wind-bow.glitch.me/twitch-api/streams/freecodecamp?callback=?";
  var st = "streams/";
  var ch = "channels/";
  var us ="users/";
$.getJSON(url,function(data){
          if(data.stream===null){
            $("#bob").html("working");
          }
  else{
    $("#bob").html("not working");
    console.log(data);
  }
          }); 
});
       


   
              
            
!
999px

Console