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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                - var fragments = 30;

mixin fragment(n)
  if (n > 0)
    div.fragment(class = "fragment-" + n)
      +fragment(n - 1)
div.container(ontouchstart = "")


                // original image size is 1200 x 1703
$w: 320px
$h: $w * 1.41916667
$fragments: 30
$fragmentH: $h / $fragments
$transDur: 0.25s
$cutDelay: 8

.container, .fragment-cont, .fragment
  transform-style: preserve-3d
  -webkit-transform-style: preserve-3d
  transition: transform $transDur

  margin: 0
  perspective: 800px
  -webkit-perspective: 800px
  width: $w
  height: $h
  margin: auto
  transform: rotateX(45deg) rotateZ(45deg)
    // roll up
      transform: translateY(-$fragmentH) translate3d(0,2px,5px) rotateX(0deg + (360/$fragments*-3))
      transform: translateY($fragmentH) rotateX(0deg + (360/$fragments*3))
      @for $i from 1 through $fragments
          transition-delay: ($transDur/$cutDelay) * ($i - 1)
// for containing fragments and moving them to top of global container
  transform: translateY(-$fragmentH) rotateX(0deg)
  // background size has extra 0.75% to hide white edge at right; then in second @for loop, 0.25% of fragment height (0.0025) is added to background position to preserve top dark edge of paper
  background-image: url(
  background-size: 100.75% auto
  width: 100%
  height: $fragmentH
  transform-origin: 0% 0%
  -webkit-transform-origin: 0% 0%
  transform: translateY($fragmentH)
// roll down
@for $j from 1 through $fragments
  .fragment-#{$fragments - ($j - 1)}
    background-position: 0 (($h * 0.0025) + ($fragmentH * ($fragments - ($j - 1))))
    transition-delay: ($transDur/$cutDelay) * ($j - 1)