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

              
                <div class="icon">
  <i></i>
  <span class="tap"></span>
</div>
              
            
!

CSS

              
                @import "nib"

$mainbg = #3F51B5
$mainc = white 

html, body
  height 100%
  overflow hidden

body
  background $mainbg

  .icon
    width 40px
    height 40px
    border-radius 100%
    position absolute
    top 50%
    left 50%
    cursor pointer
    margin -20px
    i
      width 2px
      height 14px
      background $mainbg
      display block
      transform rotate(-45deg)
      left 19px
      position absolute
      top 13px
      opacity 0
      transition all .6s ease
      &:after
        content''
        display block
        width 14px
        height 2px
        background $mainbg
        position absolute
        left -6px
        top 6px
    &:after
      content''
      display block
      width 10px
      height 10px
      border-radius 100%
      position absolute
      left 15px
      top 15px
      box-shadow 14px 0px 0px $mainc, -14px 0px 0px $mainc
      transition all .4s ease
      z-index -1
    &:before
      content''
      display block
      width 40px
      height 40px
      border-radius 100%
      transform scale(.25)
      background $mainc
      position absolute
      transition all .6s ease
  .icon.active
    &:before
      transform scale(1)
    &:after
      box-shadow 0px 0px 0px $mainc, 0px 0px 0px $mainc
      opacity 0.4
    i
      opacity 1
      transform rotate(45deg)

  .tap
    width 80px
    height 80px
    display block
    position absolute
    left -20px
    top -20px
    opacity 1
    transform scale(0)
    border-radius 100%
    background-color rgba($mainc, .6)
    &.active
      transition all .3s ease-out
      opacity 0
      transform scale(1)
              
            
!

JS

              
                $(".icon").on 'tap', ->
  $(this).toggleClass 'active'
  $('.tap').addClass 'active'
  
$(".icon").bind 'transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', ->
  $('.tap').removeClass 'active'
              
            
!
999px

Console