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


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.


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.


  <nav class="navbar navbar-default" id="twitch_nav">
    <span class="navbar-brand glyphicon glyphicon-th" id="nav_text">
      <span id="brand_name">Twitch TV</span>
  <div class="container">
    <div class="row search">
      <form class="navbar-form navbar-left" role="search">
        <div class="form-group">
          <input id="search_bar" type="text" class="form-control" placeholder="Ex: Search for 'a'" required="required">
        <a id="search_button" type="" class="btn btn-default">Search</a>

    <div class="row main">
      <h1 class="text-center" id="default_message">Search your favorite channels....</h1>


                .body {
  font-family: roboto;

.channel {
  height: 300px;
  margin: 0px;
  border: 1px solid grey;
  margin: 30px;
  padding: 0px;

.channel-viewers {
  color: white;
  padding-top: 5px;
  font-weight: 300;
  padding-left: 10px;
  background-color: rgba(1, 1, 1, 0.6)

.channel-button {
  border-radius: 100px;
  width: 100px;
  margin-left: 10px;
  background-color: #16a085;

.channel-button:hover {
  color: white;
  background-color: #f1c40f;
  border: 2px solid black;

.channel-button-div {
  margin-top: 50%;

#twitch_nav {
  background-color: #16a085;

#nav_text {
  color: white;

.channel-title {
  font-size: 24px;
  font-weight: 300;
  width: 100%;
  height: 70px;
  background-color: rgba(1, 1, 1, 0.6);
  padding-left: 15px;
  color: white;

#search_button {
  border-radius: 100px;
  border: none;
  background-color: #16a085;
  color: white;





                $(document).ready(function() {
  $.getJSON('', function(data) {
    $("#search_button").click(function() {
      var text = $("#search_bar").val();
      if (text !== "") {
        display(data, text);

  // display function
  function display(data, text) {

    var id, id2;
    var heading;
    var viewers;
    var timestamp;
    var video_height;
    var video_banner;
    var video_url;
    var ct = 1;
    for (channel in data.streams) {
      id = "box_" + ct
      id2 = "button_" + ct;
      heading = data.streams[channel].game;
      viewers = data.streams[channel].viewers;
      timestamp = data.streams[channel].created_at;
      video_height = data.streams[channel].video_height;
      video_banner = data.streams[channel].channel.logo;
      video_url = data.streams[channel].channel.url;
      var str1 = heading.toLowerCase();
      var str2 = text.toLowerCase();
      if (str1.indexOf(str2) !== -1) {
        writeHeadingInfo(id, heading);
        writeViewers(id, viewers);
        boxBG(id, video_banner);
        createButtonBox(id, id2, video_url);
    if (ct===1){
      $("#default_message").text("Sorry no results found...");

    // write geek stuff


  // function creating a box
  function createBox(id) {
    html = "<div class='col-lg-3 channel'";
    html += ' id=' + '"' + id + '"';
    html += "></div>"

  //Writing basic info
  function writeHeadingInfo(id, heading) {
    html = "<div class='channel-title'>";
    html += heading;
    html += '</div>';
    var id = "#" + id;

  //Writing viewers
  function writeViewers(id, viewers) {
    var id = "#" + id;
    html = "<div class='channel-viewers'>";
    html += "<span class='glyphicon glyphicon-user'></span>";
    html += viewers;
    html += "</div>";

  //Box BG
  function boxBG(id, banner) {
    var id = "#" + id;
    var imagePath = "url(";
    imagePath += banner;
    imagePath += ")";
    $(id).css("background-image", imagePath);


  //function buttonbox
  function createButtonBox(id0, id, link) {
    var id0 = "#" + id0;
    var id = "#" + id;
    var html;
    html = '<div class="channel-button-div">'
    html += "<a class='btn btn-primary channel-button' href=";
    html += '"' + link + '"';
    html += ' target="_blank">';
    html += 'Visit</a>';
    html += '</div>'