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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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.

            
              //-https://dribbble.com/shots/1768850-Slide-animation
.emoji
.container
  ul
    li.is_active(color='#bc2828' emoji='	🍎') Apple
    li(color='#d68a8a' emoji='🍑') Peach
    li(color='#dd7e28' emoji='🍊') Orange
    li(color='#e0c44f' emoji='🍌') Banana
    li(color='#92bf7b' emoji='🍐') Pear
            
          
!
            
              .centerme(){
  top: 45%;
  left: 50%;
  transform: translate(-50%,-50%);
}
body{
  background-color: #ececec;
  transition: background-color .3s ease;
}
.emoji{
  position: absolute;
  margin-left: 20px;
  .centerme();
  font-size: 250px;
  opacity: .2;
}
.container{
  position: absolute;
  .centerme();
}
ul{
  list-style-type:none;
  .is_active{
    padding: 10px 15px;
    cursor: default;
    &:hover{
      opacity:1;
    }
  }
  li{
    color: #222;
    position: relative;
    display: inline-block;
    background-color: #fff;
    border-radius: 100px;
    vertical-align: middle;
    min-width: 12px;
    min-height: 12px;
    padding: 0px;
    transition: all .3s ease;
    margin-right: 5px;
    box-shadow: 0 1px 2px 0px rgba(0,0,0,.2);
    cursor: hand;
    cursor: pointer;
    &:hover{
      opacity:0.6;
    }
  }
}
            
          
!
            
              var tabNames = [];
//loop thru all li element and grab all data, push them into an array of objects
$('li').each(function(index){
  var _this = $(this);
  var elem = {};
  elem.name = _this.text();
  elem.color = _this.attr('color');
  elem.emoji = _this.attr('emoji');
  tabNames.push(elem);
  console.log(tabNames);
  //if this li is active, take those data and apply to body
  if (_this.hasClass('is_active')){
    $('body').css('background-color',elem.color);
    $('.emoji').text(elem.emoji);
  } else {_this.text('')};
});

//on click change text value, bg data, emoji
$('li').on('click', function(e) {
  var _this = $(this);
  var _idx = _this.index();
  _this.addClass('is_active');
  _this.text(tabNames[_idx].name);
  $('body').css('background-color',tabNames[_idx].color)
  $('.emoji').text(tabNames[_idx].emoji);
  _this.siblings().text('');
  _this.siblings().removeClass('is_active');
});
            
          
!
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