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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm 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. We'll also process your JavaScript with Babel.

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

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 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.

            
              <body>
  <div class="container">
    <div class="jumbotron">
      <div class="row doc">
        <div class="col-xs-12 doc">
          <p id="title">Twitch Stream Selection </p></div>
        <div class="col-xs-12 smp">
        <p id="stitle">created by Eldar Tinjic </p>
      </div>
    </div>
    <div class="row tiles-container">
      <a href="#" id="linking1" target="_blank">
        <div class="col-xs-12 col-sm-6 col-md-4 col-lg-3 tbox" id="box1">
          <img id="img1" src="" class="nosel" /><img id="rl1" class="nosel" src="https://s16.postimg.org/p26rcvpip/image.png" />
        </div>
      </a>
      <a href="#" id="linking2" target="_blank">
        <div class="col-xs-12 col-sm-6 col-md-4 col-lg-3 tbox" id="box2">
          <img id="img2" class="nosel" src="" /><img id="rl2" class="nosel" src="https://s16.postimg.org/p26rcvpip/image.png" />
        </div>
      </a>
      <a href="#" id="linking3" target="_blank">
        <div class="col-xs-3 tbox" id="box3"> <img id="img3" src="" class="nosel" /><img id="rl3" class="nosel" src="https://s16.postimg.org/p26rcvpip/image.png" />
        </div>
      </a>
      <a href="#" id="linking4" target="_blank">
        <div class="col-xs-3 tbox" id="box4"> <img id="img4" class="nosel" src="" /><img id="rl4" class="nosel" src="https://s16.postimg.org/p26rcvpip/image.png" />
        </div>
      </a>
      <a href="#" id="linking5" target="_blank">
        <div class="col-xs-3 tbox" id="box5"> <img id="img5" class="nosel" src="" /><img id="rl5" class="nosel" src="https://s16.postimg.org/p26rcvpip/image.png" />
        </div>
      </a>
      <a href="#" id="linking6" target="_blank">
        <div class="col-xs-3 tbox" id="box6"> <img id="img6" class="nosel" src="" /><img id="rl6" class="nosel" src="https://s16.postimg.org/p26rcvpip/image.png" />
        </div>
      </a>
      <a href="#" id="linking7" target="_blank">
        <div class="col-xs-3 tbox" id="box7"> <img id="img7" class="nosel" src="" /><img id="rl7" class="nosel" src="https://s16.postimg.org/p26rcvpip/image.png" />
        </div>
      </a>
      <a href="#" id="linking8" target="_blank">
        <div class="col-xs-3 tbox" id="box8"> <img id="img8" class="nosel" src="" /><img id="rl8" class="nosel" src="https://s16.postimg.org/p26rcvpip/image.png" />
        </div>
      </a>
      <a href="#" id="linking9" target="_blank">
        <div class="col-xs-3 tbox" id="box9">
          <img id="img9" class="nosel" src="" /><img id="rl9" class="nosel" src="https://s16.postimg.org/p26rcvpip/image.png" />
        </div>
      </a>
      <a href="#" id="linking10" target="_blank">
        <div class="col-xs-3 tbox" id="box10">
          <img id="img10" class="nosel" src="" /><img id="rl10" class="nosel" src="https://s16.postimg.org/p26rcvpip/image.png" />
        </div>
      </a>
      <a href="#" id="linking11" target="_blank">
        <div class="col-xs-3 tbox" id="box11">
          <img id="img11" class="nosel" src="" /><img id="rl11" class="nosel" src="https://s16.postimg.org/p26rcvpip/image.png" />
        </div>
      </a>
      <a href="#" id="linking12" target="_blank">
        <div class="col-xs-3 tbox" id="box12">
          <img id="img12" class="nosel" src="" /><img id="rl12" class="nosel" src="https://s16.postimg.org/p26rcvpip/image.png" />
        </div>
      </a>
    </div>
  </div>
  </div>
</body>
            
          
!
            
              html {
  min-height: 100%;
}

body {
   background-color: #EAD3F5;
  background: linear-gradient(#EAD3F5, #EAD3F5);
}

.smp {
  padding-bottom: 20px;
}

.jumbotron {
  background-color: transparent;
  padding-top: 50px;
}

.container-fluid {
  background-color: transparent;
}

.tiles-container {
  text-align: center;
}

.tiles-container a {
  display: inline-block;
}

#title {
  font-size: 40px;
  text-align: center;
  font-weight: 800;
  color: rgba(105, 60, 120, 0.8);
  text-shadow: 1px 4px 6px #EADDF0, 0 0 0 #000, 1px 4px 6px #EADDF0;
  margin-bottom: 0px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default;
}

#stitle {
  font-size: 20px;
  margin-top: 0px;
  text-align: center;
  text-shadow: 2px 2px 2px black;
  font-weight: bold;
  font-weight: 800;
  color: rgba(105, 60, 120, 0.8);
  text-shadow: 1px 4px 6px #EADDF0, 0 0 0 #000, 1px 4px 6px #EADDF0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default;
}

.tbox {
  color: white;
  background-color: #712378;
  background: linear-gradient(#913294, #612663);
  margin: 10px;
  height: 120px;
  min-width: 285px;
  max-width: 285px;
  box-shadow: 0 10px 6px -6px black;
  border-radius: 5%;
}

.tbox:hover {
  box-shadow: 0px 0px 5px 5px #351440;
  cursor: pointer;
  background: linear-gradient(#612663, #913294);
}

.nosel {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}


}
#rl {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
#box1 h1 {
  padding-top: 15px;
  margin: 0px;
  font-size: 20px;
  text-align: center;
  text-shadow: 1px 1px 1px black;
  user-select: none;
}
.tbox h1 {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.tbox h2 {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.tbox h3 {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
#box1 h2 {
  margin: 0px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#box1 h3 {
  margin: 0px;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#img1 {
  margin-top: 20px;
  margin-bottom: 15px;
  height: 80px;
  float: right;
  margin-left: 10px;
  border-radius: 10%;
}
#box2 h1 {
  padding-top: 15px;
  margin: 0px;
  font-size: 20px;
  text-align: center;
  text-shadow: 1px 1px 1px black;
}
#box2 h2 {
  margin: 0px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#box2 h3 {
  margin: 0px;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#img2 {
  margin-top: 20px;
  margin-bottom: 15px;
  height: 80px;
  float: right;
  margin-left: 10px;
  border-radius: 10%;
}
#box3 h1 {
  padding-top: 15px;
  margin: 0px;
  font-size: 20px;
  text-align: center;
  text-shadow: 1px 1px 1px black;
}
#box3 h2 {
  margin: 0px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#box3 h3 {
  margin: 0px;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#img3 {
  margin-top: 20px;
  margin-bottom: 15px;
  height: 80px;
  float: right;
  margin-left: 10px;
  border-radius: 10%;
}
#box4 h1 {
  padding-top: 15px;
  margin: 0px;
  font-size: 20px;
  text-align: center;
  text-shadow: 1px 1px 1px black;
}
#box4 h2 {
  margin: 0px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#box4 h3 {
  margin: 0px;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#img4 {
  margin-top: 20px;
  margin-bottom: 15px;
  height: 80px;
  float: right;
  margin-left: 10px;
  border-radius: 10%;
}
#box5 h1 {
  padding-top: 15px;
  margin: 0px;
  font-size: 20px;
  text-align: center;
  text-shadow: 1px 1px 1px black;
}
#box5 h2 {
  margin: 0px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#box5 h3 {
  margin: 0px;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#img5 {
  margin-top: 20px;
  margin-bottom: 15px;
  height: 80px;
  float: right;
  margin-left: 10px;
  border-radius: 10%;
}
#box6 h1 {
  padding-top: 15px;
  margin: 0px;
  font-size: 20px;
  text-align: center;
  text-shadow: 1px 1px 1px black;
}
#box6 h2 {
  margin: 0px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#box6 h3 {
  margin: 0px;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#img6 {
  margin-top: 20px;
  margin-bottom: 15px;
  height: 80px;
  float: right;
  margin-left: 10px;
  border-radius: 10%;
}
#box7 h1 {
  padding-top: 15px;
  margin: 0px;
  font-size: 20px;
  text-align: center;
  text-shadow: 1px 1px 1px black;
}
#box7 h2 {
  margin: 0px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#box7 h3 {
  margin: 0px;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#img7 {
  margin-top: 20px;
  margin-bottom: 15px;
  height: 80px;
  float: right;
  margin-left: 10px;
  border-radius: 10%;
}
#box8 h1 {
  padding-top: 15px;
  margin: 0px;
  font-size: 20px;
  text-align: center;
  text-shadow: 1px 1px 1px black;
}
#box8 h2 {
  margin: 0px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#box8 h3 {
  margin: 0px;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#img8 {
  margin-top: 20px;
  margin-bottom: 15px;
  height: 80px;
  float: right;
  margin-left: 10px;
  border-radius: 10%;
}
#box9 h1 {
  padding-top: 15px;
  margin: 0px;
  font-size: 20px;
  text-align: center;
  text-shadow: 1px 1px 1px black;
}
#box9 h2 {
  margin: 0px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#box9 h3 {
  margin: 0px;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#img9 {
  margin-top: 20px;
  margin-bottom: 15px;
  height: 80px;
  float: right;
  margin-left: 10px;
  border-radius: 10%;
}
#box10 h1 {
  padding-top: 15px;
  margin: 0px;
  font-size: 20px;
  text-align: center;
  text-shadow: 1px 1px 1px black;
}
#box10 h2 {
  margin: 0px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#box10 h3 {
  margin: 0px;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#img10 {
  margin-top: 20px;
  margin-bottom: 15px;
  height: 80px;
  float: right;
  margin-left: 10px;
  border-radius: 10%;
}
#box11 h1 {
  padding-top: 15px;
  margin: 0px;
  font-size: 20px;
  text-align: center;
  text-shadow: 1px 1px 1px black;
}
#box11 h2 {
  margin: 0px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#box11 h3 {
  margin: 0px;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#img11 {
  margin-top: 20px;
  margin-bottom: 15px;
  height: 80px;
  float: right;
  margin-left: 10px;
  border-radius: 10%;
}
#box12 h1 {
  padding-top: 15px;
  margin: 0px;
  font-size: 20px;
  text-align: center;
  text-shadow: 1px 1px 1px black;
}
#box12 h2 {
  margin: 0px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#box12 h3 {
  margin: 0px;
  font-size: 12px;
  text-align: center;
  font-weight: bold;
  padding-top: 5px;
  text-shadow: 1px 1px 1px black;
}
#img12 {
  margin-top: 20px;
  margin-bottom: 15px;
  height: 80px;
  float: right;
  margin-left: 10px;
  border-radius: 10%;
}
#rl1 {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
#rl2 {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
#rl3 {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
#rl4 {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
#rl5 {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
#rl6 {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
#rl7 {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
#rl8 {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
#rl9 {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
#rl10 {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
#rl11 {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
#rl12 {
  position: relative;
  height: 30px;
  float: left;
  padding-top: 5px;
  left: 10px;
  top: 10px;
}
            
          
!
            
              function shortening(status, num) {
  var stringy = '';
  if (status.length > num) {
    stringy = status.slice(0, num - 3) + '...';
    return stringy;
  }
  return status;
}

function twitch() {

  var streamers = ["LVPes", "riotgames", "starladder1", "bibixhd", "Nextchance", "tinybuild", "ungespielt", "garenatw", "destructoid", "smitegame", "Nightblue3", "imaqtpie", "AmazHS", "esl_lol", "asiagodtonegg3be0", "destructoid"];

  for (var i = 0; i < streamers.length; i++) {
     $.getJSON("https://api.twitch.tv/kraken/channels/" + streamers[i], function(index) {
      return function(data) {
        $("#box" + index).append("<h1>" + data.display_name + "</h1>");
        $("#box" + index).append("<h2>" + data.game + "</h2>");
        $("#box" + index).append("<h3>" + shortening(data.status, 52) + "</h3>");
        $("#img" + index).attr("src", data.logo);
        $("#linking" + index).attr("href", data.url);

      };
    }(i + 1))
      .fail(function(index) {
        return function() {
          $("#box" + index).append("<h1> Stream username doesn't exist </h1>");
        }
      }(i+1));

  }

  for (var i = 0; i < streamers.length; i++) {
    $.getJSON("https://api.twitch.tv/kraken/streams/" + streamers[i], function(index) {
      return function(data) {
        console.log(data);
        if (data.stream) {
          $("#rl" + index).attr("src", "https://s16.postimg.org/vrjoi3x01/image.png");
        }
      };
    }(i + 1));

    
    
    
    
    
    
    
  }

};
twitch();
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console