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 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>
<head>
  <meta charset="UTF-8">
  <title>Threedify</title>
</head>
<body>
  <main>
    <header>
      <a href="#">Threedify</a>
    </header>
    <section>
      <div>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pulvinar lectus odio. Maecenas sagittis, elit vitae luctus molestie, purus diam viverra massa, in mattis velit ipsum id eros. Quisque ac hendrerit eros. Phasellus fringilla risus a nisl adipiscing, fringilla molestie dolor vehicula. Nam eget venenatis felis. Vestibulum tristique rhoncus metus sollicitudin cursus. Mauris iaculis, purus convallis laoreet sagittis, sapien neque rhoncus lectus, porta dapibus lacus elit nec nisl. Fusce tristique pretium elit ornare laoreet.
        <p>Sed ullamcorper, urna vel gravida condimentum, ligula augue condimentum sapien, mattis condimentum nibh sem ut felis. Nunc volutpat, nisl id porta lobortis, sapien orci commodo leo, at posuere ante neque et turpis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dapibus at nibh nec luctus. Integer consequat nisi tempor, interdum sem vel, egestas libero. Nam rhoncus elementum ligula, ac dictum massa ultricies sed. Nulla vehicula nec dui vitae fringilla.</p>
      </div>
    </section>
    <section>
      <div>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pulvinar lectus odio. Maecenas sagittis, elit vitae luctus molestie, purus diam viverra massa, in mattis velit ipsum id eros. Quisque ac hendrerit eros. Phasellus fringilla risus a nisl adipiscing, fringilla molestie dolor vehicula. Nam eget venenatis felis. Vestibulum tristique rhoncus metus sollicitudin cursus. Mauris iaculis, purus convallis laoreet sagittis, sapien neque rhoncus lectus, porta dapibus lacus elit nec nisl. Fusce tristique pretium elit ornare laoreet.
        <p>Sed ullamcorper, urna vel gravida condimentum, ligula augue condimentum sapien, mattis condimentum nibh sem ut felis. Nunc volutpat, nisl id porta lobortis, sapien orci commodo leo, at posuere ante neque et turpis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dapibus at nibh nec luctus. Integer consequat nisi tempor, interdum sem vel, egestas libero. Nam rhoncus elementum ligula, ac dictum massa ultricies sed. Nulla vehicula nec dui vitae fringilla.</p>
      </div>
    </section>
    <section>
      <div>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pulvinar lectus odio. Maecenas sagittis, elit vitae luctus molestie, purus diam viverra massa, in mattis velit ipsum id eros. Quisque ac hendrerit eros. Phasellus fringilla risus a nisl adipiscing, fringilla molestie dolor vehicula. Nam eget venenatis felis. Vestibulum tristique rhoncus metus sollicitudin cursus. Mauris iaculis, purus convallis laoreet sagittis, sapien neque rhoncus lectus, porta dapibus lacus elit nec nisl. Fusce tristique pretium elit ornare laoreet.
        <p>Sed ullamcorper, urna vel gravida condimentum, ligula augue condimentum sapien, mattis condimentum nibh sem ut felis. Nunc volutpat, nisl id porta lobortis, sapien orci commodo leo, at posuere ante neque et turpis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dapibus at nibh nec luctus. Integer consequat nisi tempor, interdum sem vel, egestas libero. Nam rhoncus elementum ligula, ac dictum massa ultricies sed. Nulla vehicula nec dui vitae fringilla.</p>
      </div>
    </section>
    <section>
      <div>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pulvinar lectus odio. Maecenas sagittis, elit vitae luctus molestie, purus diam viverra massa, in mattis velit ipsum id eros. Quisque ac hendrerit eros. Phasellus fringilla risus a nisl adipiscing, fringilla molestie dolor vehicula. Nam eget venenatis felis. Vestibulum tristique rhoncus metus sollicitudin cursus. Mauris iaculis, purus convallis laoreet sagittis, sapien neque rhoncus lectus, porta dapibus lacus elit nec nisl. Fusce tristique pretium elit ornare laoreet.
        <p>Sed ullamcorper, urna vel gravida condimentum, ligula augue condimentum sapien, mattis condimentum nibh sem ut felis. Nunc volutpat, nisl id porta lobortis, sapien orci commodo leo, at posuere ante neque et turpis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dapibus at nibh nec luctus. Integer consequat nisi tempor, interdum sem vel, egestas libero. Nam rhoncus elementum ligula, ac dictum massa ultricies sed. Nulla vehicula nec dui vitae fringilla.</p>
      </div>
    </section>
    <footer>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pulvinar lectus odio. Maecenas sagittis, elit vitae luctus molestie, purus diam viverra massa, in mattis velit ipsum id eros. Quisque ac hendrerit eros. Phasellus fringilla risus a nisl adipiscing, fringilla molestie dolor vehicula. Nam eget venenatis felis. Vestibulum tristique rhoncus metus sollicitudin cursus. Mauris iaculis, purus convallis laoreet sagittis, sapien neque rhoncus lectus, porta dapibus lacus elit nec nisl. Fusce tristique pretium elit ornare laoreet. Sed ullamcorper, urna vel gravida condimentum, ligula augue condimentum sapien, mattis condimentum nibh sem ut felis. Nunc volutpat, nisl id porta lobortis, sapien orci commodo leo, at posuere ante neque et turpis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dapibus at nibh nec luctus. Integer consequat nisi tempor, interdum sem vel, egestas libero. Nam rhoncus elementum ligula, ac dictum massa ultricies sed. Nulla vehicula nec dui vitae fringilla.
        </p>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pulvinar lectus odio. Maecenas sagittis, elit vitae luctus molestie, purus diam viverra massa, in mattis velit ipsum id eros. Quisque ac hendrerit eros. Phasellus fringilla risus a nisl adipiscing, fringilla molestie dolor vehicula. Nam eget venenatis felis. Vestibulum tristique rhoncus metus sollicitudin cursus. Mauris iaculis, purus convallis laoreet sagittis, sapien neque rhoncus lectus, porta dapibus lacus elit nec nisl. Fusce tristique pretium elit ornare laoreet. Sed ullamcorper, urna vel gravida condimentum, ligula augue condimentum sapien, mattis condimentum nibh sem ut felis. Nunc volutpat, nisl id porta lobortis, sapien orci commodo leo, at posuere ante neque et turpis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent dapibus at nibh nec luctus. Integer consequat nisi tempor, interdum sem vel, egestas libero. Nam rhoncus elementum ligula, ac dictum massa ultricies sed. Nulla vehicula nec dui vitae fringilla.
        </p>
    </footer>
  </main>
</body>
</html>

            
          
!
            
              /* Threedify */
/* https://github.com/neoberg/threedify */

.threedify-parent
  position            fixed
  width               100%
  height              100%
  overflow            hidden

.threedify-target
.threedify-parent
  -webkit-perspective 600px
  -webkit-transform-style preserve-3d

  *
    -webkit-transform-style preserve-3d

.threedify-target
  -webkit-animation threedifyRotate 15s infinite ease

  *
    position         relative

    &:before
      content        ""
      display        block
      background     rgba(0, 0, 0, .05)
      width          100%
      height         100%
      position       absolute
      left           0
      top            0
      -webkit-transform translateZ(-1px)

@keyframes threedifyRotate
  0%
    -webkit-transform rotateX(0deg) rotateY(0deg) translateZ(-1000px)
  25%
    -webkit-transform rotateX(-45deg) rotateY(45deg) translateZ(-200px)
  50%
    -webkit-transform rotateX(45deg) rotateY(-45deg) translateZ(-500px)
  100%
    -webkit-transform rotateX(0deg) rotateY(0deg) translateZ(-1000px)

/* Demo */

body
  font-family       "Helvetica Neue"
  font-size         16px
  color             #415357
  background        #cacaca
  line-height       22px

header
  background        #e94b35
  padding           16px
  box-sizing        border-box

  a
    color           #fff
    font-size       24px
    text-decoration none
    line-height     28px

section
  padding           16px
  border-bottom     1px solid #e4e4e4

footer
  box-sizing        border-box

  p
    padding         16px
    float           left
    width           50%
    box-sizing      border-box

            
          
!
            
              # https://github.com/neoberg/threedify

class Threedify
  constructor : (options = {}) ->
    @target   = options.target or document.body
    @amount   = options.amount or 10
    @parent   = @target.parentElement

    @target.classList.add 'threedify-target'
    @parent.classList.add 'threedify-parent'

    @iterate()

  iterate : (target = @target, level = 0) ->
    if target instanceof HTMLElement

      target.setAttribute 'data-threedify', level
      @style target

      @iterate child, level+1 for key, child of target.childNodes

  style : (target) ->
    index = target.getAttribute 'data-threedify'
    zAxis = (index) * @amount

    target.setAttribute 'style', "-webkit-transform: translateZ(#{zAxis}px)"

window.addEventListener "load", -> new Threedify amount: 25

            
          
!
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.
Loading ..................

Console