cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

            
              <div class="container" id="app">
  <div v-if="showLoading" class="loader">
    <div class="progress preloader">
      <div class="indeterminate"></div>
    </div>
  </div>
  <div v-if="!showLoading" class="row z-depth-3">
    <div class="col s12">
      <h1>Twitch Streamers</h1>
    </div>
    <div class="col s12 l6">
      <div class="online-div white-text"><h4>Online</h4></div>
      <ul class="collapsible" data-collapsible="accordion">
        <li v-for="streamer in onlineStreams">
          <div class="collapsible-header">
            <img :src="streamer.image" alt="" class="p-img">
            <span>{{streamer.name}}</span>
          </div>
          <div class="collapsible-body">
            <div class="card-panel">
              <table class="responsive bordered">
                <tr>
                  <td class="black-text">Status</td>
                  <td>{{streamer.details}}</td>
                </tr>
                <tr>
                  <td class="black-text">Game</td>
                  <td>{{streamer.game}}</td>
                </tr>
                <tr>
                  <td class="black-text">Viewers</td>
                  <td>{{streamer.viewers}}</td>
                </tr>
              </table>
            </div>
            <div class="btn-group">
              <a :href="streamer.link" target="_blank" class="btn-flat waves-effect"><i class="material-icons">launch</i></a>
            </div>
            </div>
        </li>
      </ul>
    </div>
    <div class="col s12 l6">
      <div class="online-div white-text"><h4>Offline</h4></div>
      <ul class="collection">
        <li v-for="stream in offlineStreams" class="collection-item avatar">
          <img :src="stream.logo" alt="" class="circle">
          <span class="title"><a :href="stream.link">{{stream.name}}</a></span>
          <p>{{stream.bio}}<br>
          </p>
        </li>
      </ul>
    </div>
  </div>
  <div class="row z-depth-3">
    <div class="footer center">
      <a target="_blank" href="http://twitter.com/sh4hidkh4n">Created By @sh4hidkh4n <i class="material-icons">launch</i> </a>
    </div>
  </div>
</div>
            
          
!
            
              $color1 : #D89D6A
$accent : #FFF
$primary-color-dark:   #689F38
$primary-color:        #8BC34A
$primary-color-light:  #FFF
$primary-color-text:   #212121
$accent-color:         #FF4081
$primary-text-color:   #212121
$secondary-text-color: #757575
$divider-color:        #BDBDBD
html
  background-color: $primary-color
.container
  color: $primary-color-text
  
.p-img
  width: 24px
  height: 24px
  vertical-align: middle
  border-radius: 50%
.online-div
  margin-left: 2%
.col.s12 > h1
  text-align: center
.collapsible,
.collection
  margin: 5%

.collapsible,
.collapsible-header,
.collapsible-item
  border-bottom: 1px solid $divider-color
  background: $primary-color-light !important
.collapsible-header
  color: $accent-color
.collapsible,
.collapsible-body
  border-bottom: 0px
  color: $accent-color
  
.material-icons,
.collection-item
  color: $accent-color !important
.loader
  position: fixed
  width: 100vw
  height: 100vh
  top: 0%
  left: 0%
  background-color: rgba(0,0,0,0.3)
  .preloader
    width: 50%
    top: 50%
    left: 25%
    .indeterminate
      background-color: $accent-color
.btn-flat
  border: 1px solid $accent-color

.footer
  padding: 10px
  background-color: #FFF
  a
    color: $accent-color
    font-size: 1.2em
    .material-icons
      vertical-align: top
            
          
!
            
              var app = new Vue({
  el: "#app",
  mounted(){
    setTimeout(()=>{
      $('.collapsible').collapsible();
    }, 2000);
    this.getChannels();
    
  },
  data:{
    channels: ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"],
    onlineStreams: [],
    offlineStreams: [],
    showLoading: false
  },
  methods:{
    getChannels(){
      const _s = this
      const endPoint = "https://wind-bow.gomix.me/twitch-api/";
      let url = endPoint + "streams/{}?callback=?"
      this.showLoading = true;
      this.channels.forEach(channel=>{
        $.getJSON(url.replace('{}', channel), data=>{
          console.log(data);
          if(data.stream != null) _s.parseJson(data)
          else{
            $.getJSON(endPoint + "/users/" + channel + "?callback=?", d=>{
              _s.offlineStreams.push({
                name: d.display_name,
                logo: d.logo,
                link: "https://www.twitch.tv/" + d.name,
                bio: (d.bio == null) ? "User has no bio" : d.bio 
              })
            });
          }
        })
      })
      setTimeout(()=>this.showLoading = false, 1000);
    },
    parseJson(data){
      let o = {}
      //push to online stack
      const channel = data.stream.channel
      o.online = true;
      o.name = channel.display_name
      o.details = channel.status
      o.link = "https://www.twitch.tv/" + channel.name
      o.image = channel.profile_banner
      o.viewers = data.stream.viewers
      o.game = data.stream.game
      this.onlineStreams.push(o);
      }
      
    }
})
            
          
!
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.
Loading ..................

Console