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.

            
              <svg style="display: none" xmlns="http://www.w3.org/2000/svg">
  <symbol id="fake-📰"  viewBox="0 0 100 100" preserveAspectRatio="none">
    <rect class="article_a" width="100" height="43"></rect><rect class="article_a" y="66" width="49" height="34"></rect><rect class="article_a" x="51" y="66" width="49" height="34"></rect><rect class="article_a" x="2" y="45" width="96" height="4"></rect><rect class="article_a" x="2" y="50" width="79" height="4"></rect><rect class="article_b" x="2" y="92" width="39" height="4"></rect><rect class="article_b" x="53" y="92" width="39" height="4"></rect><rect class="article_a" x="2" y="56" width="6" height="1"></rect><rect class="article_a" x="9" y="56" width="42" height="1"></rect>
  </symbol>
</svg>

<main class="scroll-container">
  <section class="section">
    <svg class="fake-📰">
      <use xlink:href="#fake-📰" />
    </svg>

    <a href="#" class="button">
      <span class="button__text">Just a button</span>
    </a>
  </section>
    
  <div class="section section--alt">
    <svg class="fake-📰 fake-📰--alt">
      <use xlink:href="#fake-📰" />
    </svg>
    
    <a href="#" class="button">
      <span class="button__text">Another button</span>
    </a>
  </div>

  <section class="section">
    <svg class="fake-📰">
      <use xlink:href="#fake-📰" />
    </svg>
    
    <div class="divider">
      <span class="divider__bottom"></span>
      <span class="divider__front"></span>
      <span class="divider__top"></span>
      <img class="portrait" src="https://78.media.tumblr.com/tumblr_m79kgsyKyj1qfqcmfo1_1280.gif" />
    </div>
    
    
    <a href="#" class="button">
      <span class="button__text">Skeumorphism</span>
    </a>
    
  </section>

  <section class="section section--alt">
    <svg class="fake-📰 fake-📰--alt">
      <use xlink:href="#fake-📰" />
    </svg>

    <a href="#" class="button">
      <span class="button__text">Is back!</span>
    </a>
  </section>
</main>
            
          
!
            
              @import url('https://fonts.googleapis.com/css?family=Barlow+Semi+Condensed');

* { box-sizing: border-box }
$c-bg: #39065A;
$c-a1: #39065A;
$c-a2: #6A0572;
$c-a3: #9A0F98;
$c-a4: #EA0599;

html, body {
  background-color: $c-bg;
  overflow: hidden;
  font-family: 'Barlow Semi Condensed', sans-serif;
}
body {
  font-size: calc(1em + 0.5vw);
}

// create the css parallax container to scroll in
.scroll-container {
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  perspective: 400px; // define the perspective to create the depth
  text-align: center;
}
.section {
  transform-style: preserve-3d; // pass down the 3D perspective from the parent
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 2em 0;
  background-color: $c-a2;
  &--alt {
    background-color: $c-a3;
  }
}
.section + .section { padding-top: 2em }

.button {
  transform-style: preserve-3d;  // pass down the 3D perspective from the parent
  border: none;
  color: $c-a4;
  background: linear-gradient(to bottom, $c-a4 40%, #56065d 60%); // create the top and bottom "walls" on the button
  border-radius: 1em;
  padding: 0;
  display: inline-block;
  font-family: 'Barlow Semi Condensed', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  box-shadow: 
    0px -3px 10px 0 rgba($c-a4, 0.4), // top tight glow
    10px -15px 60px 0 rgba($c-a4, 0.3), // top large glow
    -0 3px 3px 0 rgba($c-a1, 0.3), // bottom tight shadow
    -0 15px 60px 0 rgba($c-a1, 0.3); // bottom large shadow
  position: relative;

  &__text {
    background: $c-a3;
    border-radius: 1em;
    padding: 0.4em 1.3em 0.6em;
    position: relative;
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.1, 0.67, 0.31, 1);
    transform: translate3d(0,0,6px); // Move the outer layer of the button in the z axis
    text-shadow: 0 0px 7px rgba($c-a4, 0.8); // add some text-glow
  }

  // Interactivity
  cursor: pointer;
  transition: box-shadow 0.4s cubic-bezier(0.1, 0.67, 0.31, 1);
  &:hover {
    box-shadow: 
      0px -1px 1px 0 rgba($c-a4, 0.1),
      10px -15px 60px 0 rgba($c-a4, 0.1),
      0px 1px 1px 0 rgba($c-a1, 0.1),
      10px 15px 60px 0 rgba($c-a1, 0.1);
    .button__text {
      transform: translate3d(0,0,1px); // animate the button in z-axis
    }
  }
  &:focus, &:active {
    outline: none;
    -webkit-tap-highlight-color:  rgba(255, 255, 255, 0); 
    .button__text {
      transform: translate3d(0,0,0);
    }
  }
}

.button + .button {
  margin-top: 2em;
}

.divider {
  transform-style: preserve-3d;  // pass down the 3D perspective from the parent
  margin: 2em 25% 4em;
  width: 50%;
  height: 10px;
  position: relative;
  background: #ead3ac;
  box-shadow: 
    0px -3px 10px 0 rgba(234, 211, 172, 0.37), // top tight glow
    10px -15px 60px 0 rgba(234, 211, 172, 0.61), // top large glow
    0 3px 3px 0 rgba(74, 29, 29, 0.38), // bottom tight shadow
    0 15px 60px 0 rgba(165, 92, 92, 0.84); // bottom large shadow

  &__top, &__front, &__bottom, .portrait {
    display: block;
    width: 100%;
    position: absolute;
    top: 0; left: 0;
  }
  &__top {
    transform: rotateX(90deg) translateZ(50px);
    background: linear-gradient(to bottom, #ca5651 0%, #ead3ac 100%);
    height: 100px;
  }
  &__front {
    transform: rotateY(0deg) translateZ(50px);
    background: #fffcd1;
    height: 10px;
  }
  &__bottom {
    transform: rotateX(-90deg) translate3D(0, 0, -40px);
    background: #a55d5d;
    height: 100px;
  }
  .portrait {
    width: 150px;
    transform: rotateX(10deg) translate3D(100px, -152px, 50px);
    border: 10px solid white;
  }
  
}

.fake-📰 {
  width: 100%;
  height: 70vh;
  margin: 0 auto;
  max-width: 150vh;
  fill: $c-a3;
  padding: 2em;
  &--alt {
    fill: $c-a2;
  }
}

// debug
.section_off {
  transform: translate3d(50px, 0, -100px) rotateY(20deg);
}
            
          
!
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