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

              
                .container
  .labelBlock
    .sale Sale
    .rent Rent
  .tab
              
            
!

CSS

              
                $blue = #00A8FF

*
  box-sizing border-box

body
  display flex
  align-items center
  justify-content center
  background $blue
  height 100vh
  perspective 1000px
  .container
    width 320px
    height 50px
    background transparent
    border 1px solid white
    border-radius 25px
    &:hover
      cursor pointer
    .labelBlock
     position absolute
     display flex
     justify-content space-around
     align-items center
     width 318px
     height 48px
     .sale, .rent
       font-size 16px
       letter-spacing 2px
       text-transform uppercase
       font-weight 100
       z-index 1
       transition color .7s ease-out
     .sale
       color $blue
     .rent
       color white
    .tab
      width 159px
      height 48px
      background white
      border 1px solid white
      border-radius 25px
      position absolute
      transition all .3s ease-in
      
.offsetTab
  margin-left 159px
  
.fontColorIsWhite
  color white !important
  
.fontColorIsBlue
  color $blue !important
  
.rotateOne
  animation AnimeRotateOne .5s ease-out
  
.rotateTwo
  animation AnimeRotateTwo .5s ease-out
  
@keyframes AnimeRotateOne
  0%
    transform rotateY(0deg)
  50%
    transform rotateY(45deg)
  100%
    transform rotateY(0)
    
@keyframes AnimeRotateTwo
  0%
    transform rotateY(0deg)
  50%
    transform rotateY(-45deg)
  100%
    transform rotateY(0)
              
            
!

JS

              
                $(document).ready ->
  
  count = 0
  
  $(".container").click ->
    $(".tab").toggleClass("offsetTab")
    $(".sale").toggleClass("fontColorIsWhite")
    $(".rent").toggleClass("fontColorIsBlue")
    $(@).toggleClass("rotateOne")
    if count == 1
      $(@).toggleClass("rotateTwo")
      count = 0
    
    count++
      
              
            
!
999px

Console