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.

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

Console