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 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

              
                <section>
  <div></div>
</section>


              
            
!

CSS

              
                $speed: 0.2s;

@mixin triangle($direction, $width, $height, $color, $color2: $color) {
  height: 0; 
  width: 0;
  border: (($width) * 0.5) solid transparent;
  
  @if $direction == up {
    border-top: 0 solid $color2;
    border-bottom: $height solid $color;
  }
  @else if $direction == down {
    border-top: $height solid $color;
    border-bottom: 0 solid $color2;
  }
}


body {
  background: #eee;
}
section { /* Container */
  z-index: -4;
  width: 100px;
  height: 65px;
  position: absolute;
  top: 0; bottom: 0; right: 0;left: 0;
  margin: auto;
  border-width: 63px 43px;
  border-style: solid;
  border-color: #9e9abd;
  border-radius: 50%;
}
div { /* foreground */
  z-index: 1;
  width: 34px;
  height: 0;
  border-width: 34px 35px;
  border-style: solid;
  border-color: transparent #ecc460 #f7d98f;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 5px 0 rgba(0,0,0,0.2);
  
  &:before { /* flap */
    z-index: 1;
    position: absolute;
    top: 0px;
    left: 0;
    content: '';
    @include triangle(down, 104px, 52px, lighten(#f7d98f, 5), #d77e35);
    transition: border-bottom-width ease-in $speed $speed,
                border-top-width ease-out $speed ($speed * 2),
                top ease-in $speed $speed,
                z-index linear $speed $speed;
  }
  &:after { /* page */
    content: 'Aloha';
    z-index: -1;
    position: absolute;
    left: 7px;
    bottom: 4px;
    
    color: #444246;
    font: 13px 'Open Sans', sans-serif; text-transform: uppercase;
    text-align: center;
    line-height: 55px;
    
    background: white;
    width: 90px;
    height: 54px;
    margin-top: 0;
    padding-bottom: 0;
    box-shadow: 0 0 0 7px #d77e35;
    transition: all ease-in-out $speed 0s;
    border-radius: 0 0 10px 10px;
  }
}
div:hover:before { /* flap */
  top: -52px;
  z-index: -1;
  border-top-width: 0;
  border-bottom-width: 52px;
  transition: top ease-out $speed $speed,
              border-top-width ease-in $speed 0s,
              border-bottom-width ease-out $speed $speed,
              z-index linear $speed $speed;
}
div:hover:after { /* page */
  bottom: 40px;
  box-shadow: 0 36px 0 7px #d77e35;
  transition: all ease-in-out $speed ($speed * 2);
}

p {
  font-family: sans-serif;
  font-size: 0.6em;
  text-align: center;
  bottom: 0;
  top: auto;
}
              
            
!

JS

              
                // based on 'Single Element Envelope, Animated' by Chris Ota:
// https://codepen.io/chrisota/pen/oALdp
// and 
// my own 'Css mail - hover transition':
// https://codepen.io/jstew/pen/kLjHl

// Works by manipulating z-index's and transition delays.
              
            
!
999px

Console