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.

            
              %meta(name="viewport" content="width=device-width, minimum-scale=0.81, maximum-scale=0.81, minimal-ui")

%div.content
  %div.tabs-v
    %input(type="radio" id="rad1" name="rad" checked)
    %label(for="rad1" data-text="Home")
    %input(type="radio" id="rad2" name="rad")
    %label(for="rad2" data-text="About")
    %input(type="radio" id="rad3" name="rad")
    %label(for="rad3" data-text="Work")
    %input(type="radio" id="rad4" name="rad")
    %label(for="rad4" data-text="Contact")

    %div.tab-c
      %div.card
        %h1 Home
        %p The lysine contingency - it's intended to prevent the spread of the animals is case they ever got off the island. Dr. Wu inserted a gene that makes a single faulty enzyme in protein metabolism. The animals can't manufacture the amino acid lysine. Unless they're continually supplied with lysine by us, they'll slip into a coma and die.
    %div.tab-c
      %div.card
        %h1 About
        %p Yeah, I like animals better than people sometimes... Especially dogs. Dogs are the best. Every time you come home, they act like they haven't seen you in a year. And the good thing about dogs... is they got different dogs for different people. Like pit bulls. The dog of dogs. Pit bull can be the right man's best friend... or the wrong man's worst enemy. You going to give me a dog for a pet, give me a pit bull. Give me... Raoul. Right, Omar? Give me Raoul. 
    %div.tab-c
      %div.card
        %h1 Work
        %p Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends.
    %div.tab-c
      %div.card
        %h1 Contact
        %p The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee.
            
          
!
            
              @import "compass/css3";

$num-tabs: 4;

$tab-width: 4rem;
$tab-bg-color: #333;//#00ACFF;//#FFF;//#F2F4FF;//#BDDD99;
$tab-bg-scolor: #FFF;//#00ACFF;
$tab-border-radius: 0;

$tab-pwidth: 1.5rem;
$tab-pheight: 1rem;

$body-bg-color:#333;// #00ACFF;

@mixin triangle($width, $height){
  border-top: solid $height transparent;
  border-bottom: solid $height transparent;
  border-right: solid $width transparent;
  border-left: solid $width;
}

.tabs-v {
  &, & * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }
  
  float: left;
  display: inline-block;
  width: $tab-width;
  height: 100%;
  & > input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    -ms-appearance: none;
    -o-appearance: none;
    appearance: none;
    display: none;
    
    &:checked + label {
      background: $tab-bg-scolor;
      @include background-image(linear-gradient(left,  $tab-bg-scolor 0%,$tab-bg-scolor 50%,$tab-bg-color 50%,$tab-bg-color 100%,$tab-bg-color 100%));
      background-size: 200% 200%;
      background-position: 0;
    }

    &:checked + label:before {
      @include transform(translate(0, -50%));
      @include transform(translate3d(0, -50%, 0));
      @include transition(transform 0.35s);
    }
    
    &:checked + label:after {
      color: $tab-bg-color;
    }
    
  }
  & > label {
    border: none;
    padding: 0;
    background: none;
    outline: none;
    border-radius: 0;
    
    @include transition(background-position 0.25s, box-shadow 0.25s);
    
    position: relative;
    float: left;
    display: inline-block;
    width: 100%;
    height: 100%/$num-tabs;
    text-align: center;
    line-height: 100vh/$num-tabs;
    margin: 0;
    
    background: $tab-bg-color;
    @include background-image(linear-gradient(left,  $tab-bg-scolor 0%,$tab-bg-scolor 50%,$tab-bg-color 50%,$tab-bg-color 100%,$tab-bg-color 100%));
    background-size: 200% 200%;
    background-position: 100%;
    
    box-shadow:
      inset 0px 1px 0 $tab-bg-scolor,
      inset -1px 0 0px 0px $tab-bg-scolor;
    &:first-of-type {
      box-shadow:
        inset -1px 0 0px 0px $tab-bg-scolor;
    }
    &:after {
      content: attr(data-text);
      position: absolute;
      top: 50%;
      left: 50%;
      display: inline-block;
      width: 100%;
      color: $tab-bg-scolor;
      text-align: center;
      @include transform(translate(-50%, -50%));
      @include transform(translate3d(-50%, -50%, 0));
      @include transition(color 0.25s);
    }
    &:before {
      content: '';
      position: absolute;
      left: 100%;
      top: 50%;
      display: inline-block;
      width: 0;
      height: 0;
      @include triangle($tab-pwidth, $tab-pheight);
      border-left-color: $tab-bg-scolor;
      @include transform(translate(-($tab-width+$tab-pwidth), -50%));
      @include transform(translate3d(-($tab-width+$tab-pwidth), -50%, 0));
      @include transition(transform 0.2s);
    }
  }
  
  & > .tab-c {
    position: fixed;
    display: inline-block;
    width: 100%;
    height: 100%;
    
    left: $tab-width;
    text-align: center;
    
    @include transition(transform 0.5s);
    
    & > .card {
      position: absolute;
      left: 50%;
      top: 50%;
      display: inline-block;
      width: 70%;
      max-height: 80%;
      overflow-x: hidden;
      overflow-y: auto;
      padding: 2rem;
      box-shadow: 0 0 0 1px $tab-bg-scolor;
      color: $tab-bg-scolor;
      -webkit-overflow-scrolling: touch;
      @include transform(translate(-50%, -50%) translate(-$tab-pwidth, 0));
      @include transform(translate3d(-50%, -50%, 0) translate3d(-$tab-pwidth, 0, 0));
      & > h1 {
        margin-top: 0;
      }
    }
  }
  
   @for $t from 1 through $num-tabs {
     @for $c from 1 through $num-tabs {
       
       & > input[type="radio"]:nth-of-type(#{$t}):checked ~ .tab-c:nth-of-type(#{$c}){
         $dif: ($c - $t) * 100%;
         @include transform(translate(0,$dif));
         @include transform(translate3d(0,$dif,0));
       }
       
     }
	}
  
}

::-webkit-scrollbar {
  width: 14px;
}

::-webkit-scrollbar-thumb {
  background: rgba($tab-bg-scolor, 0.5);
  box-shadow: inset 0 0 0 4px $tab-bg-color;
}

.content {
  position: relative;
  float: left;
  display: inline-block;
  width: 100%;
  height: 100%;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
  background: $body-bg-color;
  overflow: hidden;
  scrollbar-face-color: $tab-bg-scolor;
  scrollbar-base-color: #FFF;
  scrollbar-track-color: $tab-bg-color;
  scrollbar-arrow-color: $tab-bg-color;
  scrollbar-shadow-color: $tab-bg-color;
}
            
          
!
            
              /*
 * None of the JS has any affect on the actual tabs/content/animation. It's all just fixing some funky iOS stuff that I can't stand.
 */

/*
 * Fun little extra JS for iOS. Prevents Rubberband on body, but allows it on scrollable divs!
 */
$('.card').on('touchstart', function(){
  var $this = $(this);
  if($this.scrollTop() === 0){
    $this.scrollTop(1);
  }else if($this.scrollTop() === $this[0].scrollHeight-$this.outerHeight()){
    $this.scrollTop( $this.scrollTop()-1 );
  }
});
$('body').on('touchmove', function(e){
  var target = e.originalEvent.srcElement || e.originalEvent.originalTarget,
      card = $(target).closest('.card');
  if(!card.length || card[0].scrollHeight <= $(card).outerHeight()){
    e.preventDefault();
  }
});

/*
 * FIxes iOS orientation change bug where content is scrolled up waaaaay too far.
 */
$(window).on('orientationchange', function(){
  $('body').scrollTop(0);
});

/*
 * Adds responsiveness
 */
FastClick.attach(document.body);
            
          
!
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