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.

+ add another resource


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


Add Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import or require. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.


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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

  <title>Use the Twitchtv JSON API</title>

  <div class="container-fluid">
    <div id="navibar">
      <h1>Twitch streamers</h1>
      <div class="buttons">
        <button type="button" id="fahrenheitButton" onclick="showOnline()" class="btn btn-primary">Show just online </button>
        <button type="button" id="fahrenheitButton" onclick="showOffline()" class="btn btn-primary">Show just offline </button>
        <button type="button" id="fahrenheitButton" onclick="showAll()" class="btn btn-primary">Show all </button>
    <ul id="output">
  <footer class="text-center">
    Made by <a href="" target="_blank">Radek John,</a> with use of Twitchtv <a href="" target="_blank">API</a>.
              body {
  font-size: 120%;
  padding: 5%;

#navibar {
  margin: 0px;
  padding: 0px;

ul {
  margin: 2%;
  padding: 0;

li {
  border-bottom: 5px solid white;
  list-style-type: none;
  padding: 5px;

a:hover {
  color: black;

#buttons {
  boreder: 1px solid red;
  float: left;

.offline {
  width: 100%;
  background-color: yellow;
  color: black;

.online {
  width: 100%;
  background-color: green;
  color: black;

.userName {
  font-size: 150%;
  width: 300px;
  color: black;

.status {
  width: 400px;

.content {
  float: right;

.invisible {
  display: none;
              $(document).ready(function() {

 // Array with users
var users = ["freecodecamp", "ESL_SC2", "OgamingSC2", "cretetion", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];

 // Prepared urls 
  var urlPrep = "";
  var userLink = "";
 // Prepared variables for api url and user
  var url = "";
  var user = "";

// Function for adding user to the list
  function addUser(item) {
 // Build API url  
    url = urlPrep + item;
// Call API and
      type: "GET",
      url: url,
      success: function(data) {
// Check if user is offline and note it
        if ( === null) {
            "<li class='offline row'>" +
            "<a href=" + userLink + item + ">" + "<div class='userName'>" + item + "</div>" + "</a>" +
            "<div class='status'> offline </div>" +
// Else note him as online 
        } else {
          $("#output").prepend("<li class='online row'>" +
            "<a href=" + userLink + item + ">" + "<div class='userName'>" + item + "</div>" + "</a>" +
            " <div class='status'> online </div>" +
            "<div class='content'>" +
            "Streams " +
            JSON.stringify("/g, '') + " and has " + JSON.stringify( +
            " viewers" +
            "</div>" +


// Call user function for all users  
  for (var i = users.length - 1; i >= 0; i--) {

  // Belongs to  $(document).ready ... 

// Make offline users disappear
function showOnline() {
  $(".offline").css("display", "none");
  $(".online").css("display", "");
// Make online users disappear
function showOffline() {
  $(".online").css("display", "none");
  $(".offline").css("display", "");
// Show all users
function showAll() {
  $(".online").css("display", "");
  $(".offline").css("display", "");