cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="rectangle">
  <div class="p1"></div>
  <div class="p2"></div>
  <div class="p3"></div>
  <div class="p4"></div>
</div>
            
          
!
            
              $bezier-shape: cubic-bezier(.4,.2,0,1);

html,body { height: 100%; }

body { perspective: 1000px; }

.rectangle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 614px;
  transform: translate3d(-50%,-50%,0);
  transform-style: preserve-3d;

  .p1 {
    position: absolute;
    background-color: brown;
    height: 100px;
    width: 100px;
    transform: translate3d(0,0,0);
    animation: p1Ani 3s 1s forwards $bezier-shape;
  }

  .p2 {
    position: absolute;
    height: 220px;
    width: 0;
    border-left: 300px solid brown;
    border-bottom: 71px solid transparent;
    transform: translate3d(100px,0,0);
    animation: p2Ani 3s 1s forwards $bezier-shape;
  }

  .p3 {
    position: absolute;
    height: 191px;
    width: 0;
    border-left: 100px solid brown;
    border-bottom: 24px solid transparent;
    transform: translate3d(0,100px,0);
    animation: p3Ani 3s 1s forwards $bezier-shape;
  }

  .p4 {
    position: absolute;
    height: 300px;
    width: 0;
    border-right: 400px solid brown;
    border-top: 95px solid transparent;
    transform: translate3d(0,219px,0);
  }
}


@keyframes p1Ani {
  25% { transform: translate3d(-150px,-50px,0) scale(.8) rotate(45deg); }
  50% { transform: translate3d(430px,-50px,0) scale(1) rotate(0); }
  75% { transform: translate3d(430px,130px,0) scale(.3) rotate(3turn); }
  to { transform: translate3d(-130px,29px,0) scale(1) rotate(0); }
}

@keyframes p2Ani {
  33% { transform: translate3d(100px,0,0) scale(.7) rotate(0); } 
  66% { transform: translate3d(0,29px,0) scale(.7) rotate(1turn); }
  to { transform: translate3d(0,29px,0) scale(1); }
}

@keyframes p3Ani {
  33% { transform: translate3d(0,100px,0) scale(.7) rotate(0); }
  66% { transform: translate3d(300px,29px,0) scale(.7) rotate(-1turn); }
  to {  transform: translate3d(300px,29px,0) scale(1); }
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console