Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

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

Packages

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.

Behavior

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.

HTML

              
                <body>
    <div class="container">
      <header :class="currentClass">
        <div class="navigation-filter">
          <a href="#" v-on:click.prevent="getClass(0)" class="liview"><i class="fa fa-th-list"></i></a>
          <a href="#" v-on:click.prevent="getClass(1)" class="libox"><i class="fa fa-th"></i></a>
        </div>

        <div class="switch">
          <input class="all" name="radio" id="all" type="radio" value="all" v-model="status" checked>
          <label for="all">All</label>
          <input class="online" name="radio" id="online" type="radio" value="online" v-model="status">
          <label for="online">online</label>
          <input class="offline" name="radio" id="offline" type="radio" value="offline" v-model="status">
          <label for="offline">offline</label>
        </div>
      </header>

      <div class="list-content" :class="currentStyle">
        <list v-for="list in channelRes | status" :list="list" track-by="$index" transition="expand"></list>
      </div>
      <!-- end of top-content -->

      <!-- template -->
      <template id="list-header">

      </template>

      <template id="list-template">
        <div class="list">
          <div class="img-con">
            <img v-if="list.img" v-bind:src="list.img" class="img-responsive thumbnail">
            <img v-else src="http://dummyimage.com/300x300/ecf0e7/5c5457.jpg&text=0x3F" class="img-responsive thumbnail">

            <div class="text-con">
              <a v-bind:href="list.url" target="_blank">
                <h2 v-if="list.name">
                  <span>{{ list.name }}</span>
                </h2>
              </a>
              <p v-if="list.desc">
                {{ list.desc }}
              </p>
              <p v-else>
                Not much info from this Author
              </p>
            </div>
          </div>
        </div>
      </template>
      <!-- end of template -->
    </div>
  </body>
              
            
!

CSS

              
                @import "compass";
@import "susy";


@import 'https://fonts.googleapis.com/css?family=Roboto:300,400,500';
@import 'https://fonts.googleapis.com/css?family=Lato';

$yellow: #F3EA53;
$black: #040707;
$grey: #cdcccc;
$white: #ffffff;

$susy: (
  columns: 12,
  gutters: 1/2,
  gutter-position: split
);


.container {
  @include container(40em);

  header {
    @include container;
    .navigation-filter {

    }

    .switch {
      @include container;
      label {
        @include span(4);
      }
    }
  }

  .list {
    // @include container;
    background: $grey;
    // margin-bottom: 1em;
  }

  // list-view
  .list-view {
  margin-bottom: 1em;
  transition:all 1.0s ease;

      .list {
        @include container;
        background: $grey;
        margin-bottom: 1em;
          .img-con {
            @include span(12);
            margin-left: 0;
            img {
              @include span(4);
              margin-left: 0;
            }
          .text-con {
            @include gutters();
            a {
              text-decoration: none;
              color: white;
              background: black;
              font-weight: lighter;
            }
            h2 {
              font-weight: 100;
            }
            span {
                background: black;
                padding-left: 1em;
                padding-right: 1em;
            }
            p {
              font-weight: lighter;
            }
          }
        }
      }
  }
  // enf of list-view


  .list-box {
    box-sizing: border-box;
    transition:all 1.0s ease;
    .img-con {
      @include span(4);
      position: relative;
      display: block;
      img {
        max-width: 100%;
      }

      &:before {
        display: block;
        position: relative;
        content: '';
      }

      .text-con {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        opacity: 0;
        // transition: opacity .3s;
        text-align: center;

        a {
            text-decoration: none;
            color: $grey;
        }

        span {
          background: $black;
          font-weight: 100;
        }

        p {
          font-weight: lighter;
        }


        &:hover {
          position: absolute;
          opacity: 1;
          background: rgba(113,123,161, 0.9);
          width: 100%;
          left: 0;
          bottom: 0;
          transition: all 0.3s ease-in-out;
        }
      }
    }
  }
  // list-box

}

body {
    font-family: "Lato", "Roboto", sans-serif;
    background: $white;
    color: $black;
}


header {
    border-bottom: 1px solid #ccc;
    margin-bottom: 1em;
    background: $yellow;

    &.view {
      .navigation-filter {
        a {
          &.liview {
            background: $grey;
          }
        }
      }
    }

    &.box {
      .navigation-filter {
        a {
          &.libox {
            background: $grey;
          }
        }
      }
    }

    .navigation-filter {
      padding: 1em;
      text-align: right;

      a {
        color: $black;
        line-height: 40px;
        margin-left: 10px;
        font-size: 1.5em;
        width: 40px;
        height: 40px;
        display: inline-block;
        text-align: center;
        transition: all 0.3s ease;

        &:hover {
          background: $grey;
        }

      }
    }

    .switch {
      background-color: $grey;

      input{
        display: none;
        &:checked + label {
          transition: all 200ms ease;
          background: lighten($grey, 10%);
        }
      }

      label {
        // @include span(4);
        float: left;
        display: inline-block;
        text-align: center;
        transition: all 0.1s ease-in-out;

        &:hover {
          cursor: pointer;
        }

        &:first-of-type {
          border-radius: 4px 0 0 4px;
        }

        &:last-of-type {
          border-radius: 0 4px 4px 0;
        }
      }
    }
}
              
            
!

JS

              
                Vue.component('list', {
    template: '#list-template',
    props: ['list']
  })

  Vue.component('list-header', {
    template: '#list-header',
    props: ['list-header']
  })

  var vm = new Vue({
    el: 'body',
    data: {
      users: ["freecodecamp", "storbeck", "terakilobyte", "habathcx","RobotCaleb","thomasballinger","noobs2ninjas","beohoff","test_channel","cretetion","sheevergaming","TR7K","OgamingSC2","ESL_SC2"],
      // users: ['freecodecamp', 'storbeck', 'terakilobyte'],
      channelRes: [],
      obj: {},
      status: ['all','online', 'offline'],
      reverse: true,
      listStyle: '',
      isA: false,
      isB: true,
      displayMode: 0,
      classStyle: ''
    },
    computed: {
      currentStyle: function () {
        if (this.displayMode === 0) {
           this.listStyle = 'list-view'
        } else {
          this.listStyle = 'list-box'
        }

        return this.listStyle
      },
      currentClass: function () {
        if (this.displayMode === 0) {
           this.classStyle = 'view'
        } else {
          this.classStyle = 'box'
        }

        return this.classStyle
      }
    },
    ready: function () {
      this.getChannel()
      this.showList()

    },
    methods: {
      getChannel: function () {
        var instance = this
        var resnow = this.channelRes

          this.users.forEach(function(channel, index){
            instance.$http.get(instance.makeUrl('streams', channel)).then((response) => {
              instance.$http.get(instance.makeUrl('channels', channel)).then((data) => {
                if (response.json().stream === null || response.json().stream === undefined) {
                  instance.channelRes.$set(index,{status: 'offline', name: data.json().name, desc: data.json().status, img: data.json().logo, url: data.json().url})
                } else {
                  instance.channelRes.$set(index,{status: 'online', name: data.json().name, desc: data.json().status, img: data.json().logo, url: data.json().url})
                }
              }, (data) => {
                console.log(data)
              })
            }, (response) => {
              console.log(response)
            })
          })
      },
      makeUrl: function (type, name) {
        return 'https://api.twitch.tv/kraken/' +type+ '/' +name+ '?client_id=5j0r5b7qb7kro03fvka3o8kbq262wwm';
      },
      showList: function () {
        if (this.isA) {
          this.isA = this.isA
          this.isB = this.isB
        } else {
          this.isA = !this.isA
          this.isB = !this.isB
        }
      },
      changeClass: function () {
        this.reverse = !this.reverse
      },
      getClass: function (option) {
        this.displayMode = option;
      },
    },
    filters: {
      status: function (account) {
        if (this.status == 'all') {
          return account
        }

        return account.filter(function(account) {
          return account.status == this.status
        }.bind(this))
      }
    }
  })
              
            
!
999px

Console