123

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.

            
              <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P" rel="stylesheet">

<body>
  <div class="container">
      
  <h1><i class="fa fa-twitch" aria-hidden="true"></i>Twitch TV</h1>
  
    <!-- start of carousel-->
  <div id="carousel" class="carousel slide" data-ride="carousel" data-interval="3000" data-pause="hover">
  <ol class="carousel-indicators">
    <li data-target="#carousel" data-slide-to="0" class="active"></li>
    <li data-target="#carousel" data-slide-to="1"></li>
    <li data-target="#carousel" data-slide-to="2"></li>
    <li data-target="#carousel" data-slide-to="3"></li>
  </ol>
  <div class="carousel-inner">
    
    <!-- start of images-->
    <div class="carousel-item active">
      <a href="https://go.twitch.tv/directory/game/Destiny%202" target=_blank><img class="d-block w-100" src="https://compass-ssl.xbox.com/assets/96/6b/966baf34-e121-4173-a3d7-b7ff5475f880.jpg?n=D2_GLP-Page-Hero-1084_1920x600.jpg" alt="Destiniy Streamers" title="Destiny 2 Live Streams"></a>
    </div>
    <div class="carousel-item">
      <a href="https://go.twitch.tv/directory/game/PLAYERUNKNOWN'S%20BATTLEGROUNDS" target=_blank><img class="d-block w-100" src="http://compass.xbox.com/assets/73/be/73be34bd-e69c-4f9d-ac03-7831e422e951.jpg?n=PUBG_GLP-Page-Hero-1084_1920x600_02.jpg" alt="Playerunknown's Battlegrounds" title="Playerunknown's Battlegrounds Live Streams"></a>
    </div>
    <div class="carousel-item">
      <a href="https://go.twitch.tv/directory/game/Dead%20Space%203" target=_blank><img class="d-block w-100" src="http://level-design.ru/wp-content/uploads/2016/02/dead_space-3-1200x600.jpg" alt="Dead Space 3" Title="Dead Space 3 Live Streams"></a>
    </div>
    <div class="carousel-item">
      <a href="https://go.twitch.tv/directory/game/The%20Last%20of%20Us" target=_blank><img class="d-block w-100" src="http://www.game-lover.org/wp-content/uploads/2013/09/the-last-of-us1-1200x600.png" alt="The Last of Us" Title="The Last of Us Live Streams"></a>
    </div>
  </div>
  <a class="carousel-control-prev" href="#carousel" role="button" data-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="carousel-control-next" href="#carousel" role="button" data-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>
  
    <div class="form">
  <input type="text" class="search" title="search users" placeholder="Search Channels... [+ enter]" class="input"></input>
  
  <button class="btn btn-outline-success online" title="online" class="online">Online</button>
  
<button class="btn btn-outline-danger offline" title="off">Offline</button>
  
<button class="btn btn-outline-secondary all" title="all">All</button>
    </div>

<div id="error" class="message"></div>
<div class="searchResults"></div>
<div class="users"></div>
  
  </div>
  </div>
<script src='https://unpkg.com/popper.js@1.14.3/dist/umd/popper.min.js'></script>
</body>
            
          
!
            
              body {
background: #38245c;
background: -webkit-linear-gradient(to right, #4b307b, #39255e);
background: linear-gradient(to right, #4b307b, #39255e);
}

h1 {
  color: white;
  text-shadow: 3px 2px 7px rgba(0, 0, 0, 0.7);
  font-size: 50px;
  margin-top: 20px;
  margin-bottom: 30px;
  text-align: center;
  font-family: 'Press Start 2P';
}

/* 
 
*/
img {
  height: 350px;
}

input {
  padding-left: 3%;
  color: #2fc6ce;
  background: none;
  height: 37px;
  outline: none;
  border-radius: 4px;
  border: 1px solid #2fc6ce;
  width: 40%;
  transition: 0.2s;
}

input::placeholder{
  padding-left: 3%;
  color: #2fc6ce;
}

input:hover {
 color: black;
 padding-left: 3%;
 transition: 0.2s;
 background-color: #2fc6ce;
}

input:hover::placeholder{
  padding-left: 3%;
  color: #111;
}

input:focus {
 color: #111; 
 padding-left: 3%;
 transition: 0.2s;
 background-color: #2fc6ce;
}

h5 {
  color: #101926;
  font-weight: bold;
  text-align: center;
}

p {
  color: #111;
  padding-left: 3%;
  text-align: center;
}

.form {
  margin-top: 4%;
  margin-bottom: 2%;
  display: block;
  text-align: center;
}

.images {
  margin-top: 4%;
  margin-left: 31%;
  margin-bottom: 9px;
  border-radius: 30px;
  height: 120px;
}

.true {
  background-color: #2FA345;
  list-style: none;
  float: left;
  position: static;
  width: 290px;
  height: 260px;
  margin-top: 3%;
  margin-left: 2.66%;
  padding-right: 1.5%;
  border-radius: 50px;
  transition: 0.3s;
}

.true:hover {
  background-color: #218234;
  transition: 0.3s;
  transform: scale(1.1);
  box-shadow: 0px 0px 10px #ababad;
}

.false {
  background-color: #DC3545;
  list-style: none;
  float: left;
  position: static;
  width: 290px;
  height: 260px;
  margin-top: 3%;
  margin-left: 2.66%;
  padding-right: 1.5%;
  border-radius: 50px;
  transition: 0.3s;
}

.false:hover {
  transition: 0.3s;
  transform: scale(1.1);
  background-color: #a81f2d;
  box-shadow: 0px 0px 10px #ababad;
}
            
          
!
            
              $(document).ready(function(){
const url = 'https://wind-bow.glitch.me/twitch-api/channels/';
const names = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp","RobotCaleb", "goldglove", "rubyretrogeek", "ladyaderissa", "riotgames", "syndicate", "summit1g", "esltv_cs", "lirikk", "speeddemosarchivesda"];
  
const playersList = api => {
  $.getJSON(api)
  .done(res => {
    if(res.status < 200 || res.status > 299){
      alert('The username you entered is not valid');
      throw error;
    }
  })
  .done(json => {
      $(".users").prepend(`<a href="${json.url}" target=_blank><div class="${json.partner}"><li><img class="images" src="${json.logo}"><br><h5>"${json.display_name}"</h6></img><p>"${json.status}"</p></div></li></a>`);

      $(".offline").click(() => {
      $(".false").show();
      $(".true").hide();
       })

      $(".online").click(() => {
      $(".true").show();
      $(".false").hide();
        })

      $(".all").click(() => {
      $(".true").show();
      $(".false").show();
      })
    })
  .fail(error => alert(error))
   }

for(var i = 0; i < names.length; i++){
  const api = (url + names[i]);
  playersList(api);
}
  
$("input[type='text']").keypress(function(event){
 if(event.which === 13){
  playersList(url + $("input").val())
  $("input").val('');
 }
})
})
            
          
!
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