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

Auto Save

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="papersheet">
  
  <!-- Action Trigger -->
  <div class="papersheet__trigger">
    
      <!-- Icon -->
      <svg class="papersheet__trigger-icon" viewBox="0 0 24 24" ><g transform="scale(0.023 0.023)"><path d="M1014.662 822.66c-0.004-0.004-0.008-0.008-0.012-0.010l-310.644-310.65 310.644-310.65c0.004-0.004 0.008-0.006 0.012-0.010 3.344-3.346 5.762-7.254 7.312-11.416 4.246-11.376 1.824-24.682-7.324-33.83l-146.746-146.746c-9.148-9.146-22.45-11.566-33.828-7.32-4.16 1.55-8.070 3.968-11.418 7.31 0 0.004-0.004 0.006-0.008 0.010l-310.648 310.652-310.648-310.65c-0.004-0.004-0.006-0.006-0.010-0.010-3.346-3.342-7.254-5.76-11.414-7.31-11.38-4.248-24.682-1.826-33.83 7.32l-146.748 146.748c-9.148 9.148-11.568 22.452-7.322 33.828 1.552 4.16 3.97 8.072 7.312 11.416 0.004 0.002 0.006 0.006 0.010 0.010l310.65 310.648-310.65 310.652c-0.002 0.004-0.006 0.006-0.008 0.010-3.342 3.346-5.76 7.254-7.314 11.414-4.248 11.376-1.826 24.682 7.322 33.83l146.748 146.746c9.15 9.148 22.452 11.568 33.83 7.322 4.16-1.552 8.070-3.97 11.416-7.312 0.002-0.004 0.006-0.006 0.010-0.010l310.648-310.65 310.648 310.65c0.004 0.002 0.008 0.006 0.012 0.008 3.348 3.344 7.254 5.762 11.414 7.314 11.378 4.246 24.684 1.826 33.828-7.322l146.746-146.748c9.148-9.148 11.57-22.454 7.324-33.83-1.552-4.16-3.97-8.068-7.314-11.414z"></path></g></svg>
  </div>
  
  
  <!-- Face 1 -->
  <div class="papersheet__face-item animated fadeInUp">
    <img draggable="false" src="https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg" alt="" />
  </div>
  
 
  <!-- Face 2 -->  
  <div class="papersheet__face-item animated fadeInUp">
    <img
         draggable="false" src="https://s3.amazonaws.com/uifaces/faces/twitter/_everaldo/128.jpg" alt="" />
  </div>

  
  <!-- Face 2 -->
  <div class="papersheet__face-item animated fadeInUp">
    <img draggable="false" src="https://s3.amazonaws.com/uifaces/faces/twitter/fffabs/128.jpg" alt="" />
  </div>
      
</div>

              
            
!

CSS

              
                  // SETTINGS
  // ######################################## 
  
  @_paper-color: #ECEFF1;
  @_icon-color: #37474F;
  @import url("https://daneden.github.io/animate.css/animate.min.css");


  // Style
  // ######################################## 

  :root {
  width: 100%;
  overflow: hidden;
  height: 100%; }  


  body {
  width: 100%;
  height: 100%; 
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: 400ms all;
  background-color: #263238;
    
    &.opened {
    background-color: #E53935; }
  }
  

  // papersheet wrapper
  .papersheet {
  position: relative;
  overflow: hidden;
  text-align: center;
  box-sizing: border-box;
  transition: all 200ms;
  width: 100%;  
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
    
  // Remove this for full-space
  max-width: 50%;
  min-width: 50rem;
  max-height: 50%;
  min-height: 20rem;
  //---------------------------
   
     &:hover {
     cursor: pointer; }
  
    &.opened {
    transition: all 900ms;
    box-shadow: 0px 5px 20px rgba(0,0,0,0.50); }
  }
  

  // trigger element
  .papersheet__trigger { 
  z-index: 1;
  display: inline-block;
  padding: 2rem;
  border-radius: 50%;
  position: absolute;
  background-color: transparent;     
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 800ms cubic-bezier(0.190, 1.000, 0.220, 1.000);
  cursor: pointer;
       
    
    // rotating animation when opened
    .opened & {
    background-color: @_paper-color;
    top: 10%; }
        
    
    // Style when clicked
    &:active:before {
    background-color: desaturate(darken(@_paper-color, 10%), 30%); }
    
    
    // Background bubble
    &:before {
    content: "";
    background-color: @_paper-color;    
    display: block;
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    bottom: 50%;
    right: 50%;
    width: 6rem;
    height: 6rem;
    z-index: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition-delay: 2s;
    transition: all 400ms cubic-bezier(0.165, 0.840, 0.440, 1.000); }  
    
    
    // Background bubble opened
    .opened &:before {
    width: 3000px;
    height: 3000px;
    transition: all 2.5s cubic-bezier(0.165, 0.840, 0.440, 1.000); }  
    
  }  


  // trigger element icon
  .papersheet__trigger-icon {
  fill: @_icon-color;
  vertical-align: bottom;  
  transform: rotate(45deg); 
  transition: all 800ms cubic-bezier(0.190, 1.000, 0.220, 1.000);
  transition-delay: 50ms;
  width: 1.8rem;
  height: 1.8rem;
    
    // icon position when opened
    .opened & {
    transform: rotate(-90deg); }
  }


  // face bubble element
  .papersheet__face-item {
  border-radius: 50%;
  margin: 0 1.5rem;
  z-index: 1;
  height: 6rem;
  width: 6rem;
  display: none;
  overflow: hidden;
  animation-duration: 500ms;
  
    &:nth-child(2) {
    animation-delay: 50; }
    
    
    &:nth-child(3) {
    animation-delay: 100ms; }    
    
    
    &:nth-child(4) {
    animation-delay: 150ms; }
    
    
    // img inside bubble
    img {
    max-width: 100%; }
    
    // style when opened
    .opened & {
    transform: translateX(60%);
    display: block; }
  }

              
            
!

JS

              
                _papersheet= $(".papersheet");
_trigger= $(".papersheet__trigger");


_trigger.click(function(){

  if (_papersheet.hasClass("opened")) {
    //$(this).removeClass("opened");
    $("body").stop().removeClass("opened");
    $(this).parent(".papersheet").stop().removeClass("opened");
    
  } else {
    //$(this).addClass("opened");
    $("body").stop().addClass("opened");
    $(this).parent(".papersheet").stop().addClass("opened");
    
  }

});

              
            
!
999px

Console