Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

HTML

              
                .screen.one
 %h1 Every Website in 2018
 %a.btn Enter
.screen.two
 %p cobra winfrey wants to<br>show notifications
 %a.btn Allow
 %a.btn Block
.screen.three
 %p are you sure you want to <br>change your homepage<br> to this website?
 %a.btn Yes
 %a.btn No
.screen.four
 %p We value your privacy.  In an age of unsolicited emails, you can trust Cobra Winfrey to keep your information confidential. We are a company that will protect and safeguard the privacy of our customers. See our privacy policy below for the details of our pledge to your privacy.
.screen.five
 %h1 Are you over 18?
 %p This website requires you to be 18 or older to enter
 %a.btn.enter Yes
 %a.btn No
 .datepicker
  %input{:type => "number"}/
  %input{:type => "number"}/
  %input{:type => "number"}/
  %a.btn.submit Submit
.screen.six
 %h1 Is your city Gary, Indiana?
 %a.btn Yes
 %a.btn No
.screen.seven
 %img{:src => "https://puu.sh/BPuFj/f3dc332522.svg"}/
 %h1 Please subscribe to our newsletter and don't miss any important news.
 %input{:type => "email", :value => "your email"}/
 %a.btn Submit
.screen.eight
 %b Support Team: Cobra
 %p Can I help you today?
 %a.btn Yes
 %a.btn No Thanks
.screen.nine
 %h1 It looks like you're using an ad blocker.
 %p Please consider disabling your ad blocker, ad revenue powers our content and we swear the ads are nowhere near as intrusive as everything you've been subjected to thus far.
 %a.btn Got It!
.screen.ten
 %h1 Did you find what you were looking for?
 %a.btn Yes
 %a.btn No 
.screen.eleven
 %h1 Aw Snap!
 %p Something went wrong while displaying this page. To continue, refresh or visit another page. 
.screen.twelve
 %h2 Don't forget to subscribe to our Social Media!
 %i.fab.fa-facebook
 %i.fab.fa-twitter-square
 %i.fab.fa-codepen
 %i.fab.fa-linkedin

  
              
            
!

CSS

              
                body{
  display:flex;
  justify-content:center;
  align-items:center;
  width:100vw;
  height:100vh;
  overflow:hidden;
  background:#222;
  perspective:800px;
  .screen{
    position:absolute;
    text-align:center;
    position:absolute;
    display:inline-block;
    transition:0.5s ease-in-out;
    *{
      color:#fff;
      text-align:center;
      font-weight:100;
    }
    input{
      z-index:2;
      position:absolute;
    }
    .btn{
      text-align:center;
      display:inline-block;
      background:blue;
      text-transform:uppercase;
      padding:15px 40px;
      border-radius:5px;
      font-weight:900;
      transition:0.2s ease-in-out;
      cursor:pointer;
      &:hover{
        background:darken(blue, 5%);
      }
    }
    h1{
      margin:0 0 20px;
    }
    &:nth-of-type(12){
      background:#000;
      padding:50px;
      transform:scale(0);
      transition:0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      &.hithere{
        transform:scale(1);
      }
      i{
        font-size:50px;
        margin:0 10px;
        transition:0.2s ease-in-out;
        &:hover{
          color:blue;
        }
      }
      h2{
        margin-top:0;
      }
    }
    &:nth-of-type(11){
      opacity:0;
      pointer-events:none;
      p{
        max-width:375px;
      }
      &.hithere{
        opacity:1;
      }
    }
    &:nth-of-type(10){
      transform-style:preserve-3d;
      pointer-events:none;
      backface-visibility:hidden;
      padding:50px;
      background:rgba(255,255,255,0.15);
      transform:rotateX(-180deg);
      transition:0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      .btn{
        margin:0 10px;
      }
      &.hithere{
        transition-delay:0.5s;
        transform:rotateX(0deg);
        pointer-events:all;
        &.byebye{
          transition:0.4s ease-in-out;
          transition-delay:0s;
          transform:translateY(150vh);
        }
      }
    }
    &:nth-of-type(9){
      z-index:999;
      opacity:0;
      pointer-events:none;
      &.hithere{
        opacity:1;
        pointer-events:all;
        &.byebye{
          opacity:0;
          pointer-events:none;
        }
      }
      p, h1{
        max-width:500px;
        width:90%;
        display:block;
        margin:20px auto;
      }
      .btn{
        border-radius:50px;
      }
      &:before{
        content:'';
        position:absolute;
        width:200vw;
        height:300vh;
        top:-100vh;
        left:-75vw;
        background:rgba(0,0,0,0.85);
        z-index:-1;
      }
    }
    &:nth-of-type(8){
      width:250px;
      height:400px;
      max-height:90vh;
      background:#fff;
      padding:20px;
      border-radius:10px;
      bottom:0;
      right:10px;
      transition:0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      transform:translateY(100vh);
      &.hithere{
        transform:translateY(0vh);
        &.byebye{
          transform:translateY(100vh);
        }
        &:before{
          transform:translateY(0vh);
        }
        p{
          opacity:1;
        }
      }
      &:before{
        content:'';
        position:absolute;
        width:75px;
        height:75px;
        background:url('https://puu.sh/BPuT5/12a182d0d5.svg');
        background-position:center;
        background-size:cover;
        bottom:10px;
        right:10px;
        transition:0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        transition-delay:0.3s;
        transform:translateY(100px);
      }
      p, b{
        color:#000;
        text-align:left;
        display:inline-block;
        width:100%;
      }
      p{
        opacity:0;
        transition:0.2s ease-in-out;
        transition-delay:0.5s;
      }
      b{
        font-weight:900;
      }
      .btn{
        position:absolute;
        padding:10px;
        bottom:10px;
        left:20px;
        &:nth-of-type(2){
          left:80px;
        }
      }
    }
    &:nth-of-type(7){
      transform:translateY(-150vh);
      background:rgba(255,255,255,0.15);
      padding:25px 50px 50px 50px;
      img{
        display:block;
        margin:0px auto;
        max-width:150px;
      }
      &.hithere{
        transform:translateY(0vh);
        &.byebye{
          transform:translateX(-150vw);
        }
      }
      h1{
        max-width:500px;
        margin-top:0;
        font-weight:100;
      }
      input{
        display:inline-block;
        float:left;
        text-align:left;
        position:relative;
        width:calc(100% - 150px);
        height:47.5px;
        background:#222;
        border:none;
        box-shadow:none;
        border-radius:5px;
        text-align:center;
        color:#555;
      }
      .btn{
        position:relative;
        float:right;
      }
    }
    &:nth-of-type(6){
      transform:translateY(-100vh);
      .btn{
        margin:0 10px;
      }
      &.hithere{
        transform:translateY(0);
        &.notyet{
          transform:translateY(-100vh);
        }
        &.byebye{
          transform:translateY(100vh);
        }
      }
    }
    &:nth-of-type(5){
      transform:translateX(-100vw);
      background:rgba(255,255,255,0.15);
      padding:25px 50px;
      margin-top:-25px;
      .btn{
        margin:0;
      }
      input{
        height:47.5px;
        width:40px;
        display:inline-block;
        float:left;
        color:#222;
        position:relative;
        margin-right:10px;
        border:none;
      }
      .datepicker{
        display:table;
        width:100%;
        text-align:left;
        margin-top:20px;
        transform:scaleY(0);
        transition:0.2s ease-in-out;
        transform-origin:top;
        max-width:335px;
        input{
          &:last-of-type{
            width:80px;
            margin-right:0;
          }
        }
        &.hithere{
          transform:scaleY(1);
        }
        .btn{
          float:right;
        }
      }
      &.hithere{
        transform:translateX(0);
        &.byebye{
          transform:translateY(-50px);
          &.gtfo{
            transform:translateY(125vh);
          }
        }
      }
    }
    &:nth-of-type(4){
      bottom:0;
      width:100%;
      padding:50px;
      background:rgba(0,0,0,0.5);
      transform:translateY(100%);
      transition-delay:1s;
      &.hithere{
        transform:translateY(0);
        transition-delay:0s;
      }
      p{
        max-width:80%;
        display:block;
        margin:0px auto;
      }
    }
    &:nth-of-type(2), &:nth-of-type(3){
      background:#eee;
      padding:20px 60px;
      top:0;
      left:25px;
      transform:translateY(-150%);
      &:before{
        content:'';
        position:absolute;
        width:75px;
        height:75px;
        background:url('https://puu.sh/BPvlJ/ceec6d016b.svg');
        background-size:contain;
        background-repeat:no-repeat;
        top:30px;
        left:20px;
      }
      &.three{
        left:auto;
        right:25px;
        &:before{
          top:45px;
        }
      }
      &.hithere{
        transform:translateY(0);
        &.byebye{
          transform:translateY(-150%);
        }
      }
      p{
        line-height:2;
        padding-left:50px;
      }
      a{
        position:absolute;
        background:#eee;
        border-radius:0;
        box-shadow:inset 0 0 0 1px #222;
        width:50%;
        padding:15px 0;
        bottom:-50px;
        &:hover{
          background:#ddd;
        }
        &:first-of-type{
          left:-1px;
        }
        &:last-of-type{
          right:-1px;
        }
      }
      *{
        color:#222;
      }
      
    }
    &:first-of-type{
      &.byebye{
        transform:translateY(-100vh);
        pointer-events:none;
        .btn{
         transition:0.5s ease-in-out; transform:translateY(200vh);
        }
      }
    }
  }
}
              
            
!

JS

              
                $('.btn').click(function(){
  $(this).parent().removeClass("notyet");
  $(this).parent().addClass("byebye");
  $(this).parent().next().addClass("hithere");
  if ($(".four").hasClass("hithere")) {
    setTimeout(function(){
      $(".four").removeClass("hithere");
      $(".five").addClass("hithere");
    }, 2000);
  }
  if ($(".eleven").hasClass("hithere")) {
    setTimeout(function(){
      $(".eleven").removeClass("hithere");
      $(".twelve").addClass("hithere");
    }, 3000);
  }
});

$(".five .enter").click(function(){
  $(".datepicker").addClass("hithere");
  $(".six").addClass("notyet");
});

$(".submit").click(function(){
  $(".five").addClass("gtfo");
  $(".six").removeClass("notyet");
});


              
            
!
999px

Console