Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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>
  <h1>Google I/O Tabbed Nav</h1>
  <nav>
    <ul class="papertabs">
      <li>
        <a href="#" class="active">
          Item 1
          <span class="paperripple">
            <span class="circle"</span>
          </span>
        </a>
      </li>
      <li>
        <a href="#">
          Item 2
          <span class="paperripple">
            <span class="circle"</span>
          </span>
        </a>
      </li>
      <li>
        <a href="#">
          Item 3
          <span class="paperripple">
            <span class="circle"</span>
          </span>
        </a>
      </li>
        <li>
        <a href="#">
          Longer Item
          <span class="paperripple">
            <span class="circle"</span>
          </span>
        </a>
      </li>
    </ul>
  </nav>
</body>
              
            
!

CSS

              
                // Imports
@import "compass"
@import url(https://fonts.googleapis.com/css?family=Roboto:300,500)

// Variables
$brand: #00BCD4
$text: rgb(0, 68, 70)

// Global Styles

*
  box-sizing: border-box

body
  background: $brand
  font: 14px/1 'Roboto', sans-serif
  color: $text
  padding-top: 90px
  
h1
  font-size: 42px
  font-weight: 300
  text-align: center

// Paper Tabs

nav
  margin: 0 auto
  display: table
.papertabs
  margin: 0
  padding: 0
  list-style: none
  position: relative
  +clearfix
  li
    float: left
  a
    color: inherit
    text-decoration: none
    text-transform: uppercase
    font-weight: 500
    letter-spacing: 0.02em
    padding: 16px 12px
    line-height: 1
    float: left
    position: relative
    &.pressed
      .paperripple .circle
        +animation(ripple 0.25s ease-in) 
    &.focused
      .paperripple
        background: rgba(255,255,255,0.25)
        transition: none   
#papertabs-line
  background: #fff
  position: absolute
  height: 2px
  bottom: 0

// Ripple Animation
.paperripple
  position: absolute
  width: 100%
  height: 100%
  top: 0
  left: 0
  overflow: hidden
  background: rgba(255,255,255,0)
  +transition(0.4s ease-in)
  .circle
    position: absolute
    width: 0
    height: 0
    top: 50%
    left: 50%
    background: rgba(255,255,255,0)
    +border-radius(50%)
    +translate(-50%, -50%)

+keyframes(ripple)
  0%
    background: rgba(255,255,255,0)
  25%
    background: rgba(255,255,255,0.55)
    width: 15%
    padding-bottom: 15%
  50%
    background: rgba(255,255,255,0.45)
    width: 85%
    padding-bottom: 85%
  100%
    width: 200%
    padding-bottom: 200%
    background: rgba(255,255,255,0.25)  
              
            
!

JS

              
                $(function() {
  
  // Setup Line
  $('.papertabs').append("<li id='papertabs-line'></li>");
  var $line = $('#papertabs-line');
  var $activeItem =  $('.papertabs .active').parent();
  var $activeX = $('.papertabs .active').parent().position().left;
	$line.width($activeItem.width()).css("left", $activeX);

  // Click Event
  $('.papertabs a').click( function(e){

    var $el = $(this);
    var $offset = $el.offset();
   	var $clickX = e.pageX - $offset.left;
   	var $clickY = e.pageY - $offset.top;
    var $parentX = $el.parent().position().left;
    var $elWidth = $el.parent().width();

    e.preventDefault();
    
    $('.papertabs .active').removeClass('active');
    $el.addClass('pressed active');

    $el.find('.circle').css({
    	left: $clickX + 'px', top: $clickY + 'px'
    });

    $line.animate({
      left: $parentX, width: $elWidth
    });
    
    $el.on("animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd", function(){
      $el.removeClass('pressed').addClass('focused');
      setTimeout( function(){
      	$el.removeClass('focused');
      }, 800);
    });

  });
  
}); // End Of Document Ready Function
              
            
!
999px

Console