123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              #frame
#stage
  #box
    .in.one
  #box
    .in.two
  #box
    .in.thr
  #box
    .in.fou
            
          
!
            
              //Color
$clr1: #ABC7C9
$clr2: #F8F3E8
$clr3: darken($clr2,2%)
$clr4: #F3BCAA

//Mixin
=center
  position: absolute
  top: 50%
  left: 50%
  transform: translate(-50%, -50%)

//Container
#stage
  +center
  width: 350px
  height: 350px
  perspective: 800
#frame
  +center
  width: 350px
  height: 350px
  opacity: 0
  box-shadow: 0 0 40px rgba(0,0,0,0.06)
  animation: show 0.5s 3s ease forwards

//Folds
#box
  position: absolute
  width: 150px
  height: 150px
  background: $clr1
  border: 25px solid $clr2
  box-shadow: 0 0 40px rgba(0,0,0,0.07)
  overflow: hidden
  border-radius: 4px
  .in
    position: absolute
    width: 100px
    height: 100px
    border-radius: 50%
    background: rgba(darken($clr2,6%),0.6)
    animation: grow 0.5s 3s cubic-bezier(0.66,-0.30,0.66,1) forwards
    &.one
      left: 100px
      bottom: -50px
    &.two
      left: -50px
      bottom: -50px
    &.thr
      left: 100px
      bottom: 100px
    &.fou
      left: -50px
      bottom: 100px
  &:nth-child(1)
    background: $clr3
    border-radius: 5px 0 0 0
    border-right: none
    border-bottom: none
    animation: clr 1s 1s ease forwards
  &:nth-child(2)
    background: $clr3
    border-radius: 0 5px 0 0
    left: 175px
    border-left: none
    border-bottom: none
    transform-origin: 0 0
    transform: rotateY(180deg)
    animation: fold 1s 1s ease forwards
  &:nth-child(3)
    background: $clr3
    border-radius: 0 0 0 5px
    top: 175px
    width: 150px
    opacity: 0
    border-top: none
    border-right: none
    transform: rotateX(180deg)
    transform-origin: 0 0
    animation: fold2 1s 2s ease forwards
  &:nth-child(4)
    background: $clr3
    border-radius: 0 0 5px 0
    top: 175px
    left: 175px
    opacity: 0
    border-top: none
    border-left: none
    transform: rotateX(180deg)
    transform-origin: 0 0
    animation: fold2 1s 2s ease forwards
  
//Animation  
@keyframes clr
  99.99%
    background: $clr3
  100%
    background: $clr1

@keyframes fold
  99.99%
    background: $clr3
  100%
    background: $clr1
    transform: rotateY(360deg)

@keyframes fold2
  0%
    opacity: 1
    background: $clr3
  25%
    opacity: 1
    background: $clr3
  40%
    opacity: 1
    background: $clr1
  100%
    opacity: 1
    background: $clr1
    transform: rotateX(0deg)
  
@keyframes show
  100%
    opacity: 1
  
@keyframes grow
  100%
    width: 170px
    height: 170px
    border-radius: 10%
    left: -10px
    bottom: -10px
    background: rgba(darken($clr1,10%),0.8)

//
body
  background: #ccc
  overflow: hidden
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console