Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ add another resource

JavaScript

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

Packages

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.

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

              
                <body>
<div class="murica">
</div>
<div class="ballotwrap">
  <div class="ballot">
    <h1>BALLOT</h1>
    <p>
      <span><i class="fa fa-circle-o" aria-hidden="true"></i> Ken Bone</span>
      <span><i class="fa fa-circle-o" aria-hidden="true"></i> Harambe</span>
      <span><i class="fa fa-circle" aria-hidden="true"></i> Andrew Gillum</span>
      <span><i class="fa fa-circle-o" aria-hidden="true"></i> Treat Williams</span>
    </p>
  </div>
  </div>
<section class="container">
  <div id="cube">
    <figure class="front">
      <div class="eye"></div>
      <div class="eye"></div>
      <div class="mouth"></div>
    </figure>
    <figure class="back"></figure>
    <figure class="right"></figure>
    <figure class="left"></figure>
    <figure class="top"><h1>HERE</h1></figure>
    <figure class="top2"><h1>VOTE</h1></figure>
    <figure class="top3"></figure>
    <figure class="top4"></figure>
  </div>
</section>
</body>
              
            
!

CSS

              
                $brown : #b0926d;
$sans : 'Oswald', sans-serif;
$red : #ce0010;
$blue : #085394;
$white : #ffffff;
$black : #231f20;
$sans2 : 'Dosis';

body{
  position:relative;
  height:100vh;
  width:100vw;
  overflow:hidden;
  background:lighten($blue, 50%);
  perspective: 1000px;
  transform-style: preserve-3d;
  &:before, &:after{
    content:'';
    position:absolute;
    width:100%;
    height:50%;
    bottom:0;
    background:darken($brown, 40%);
  }
  &:before{
    box-shadow:inset 0px 10px 150px darken($brown, 45%);
  }
  &:after{
    bottom:auto;
    top:0;
    z-index:-1;
    background: radial-gradient(ellipse at bottom, $white 0%,transparent 100%);
  }
  .ballotwrap{
    position:absolute;
    width:300px;
    height:calc(50% - 85px);
    overflow:hidden;
    left:50%;
    top:0;
    transform:translateX(-50%);
    z-index:2;
    .ballot{
      position:absolute;
      width:200px;
      height:300px;
      text-align:center;
      background:$white;
      left:50%;
      transform:translateX(-50%);
      top:-300px;
      transition:1s ease-out;
      &:after{
        content:'';
        position:absolute;
        left:0;
        bottom:0;
        height:10px;
        width:100%;
        background:$red;
      }
      h1{
        font-family:$sans;
        color:$white;
        background:$blue;
        margin-top:0px;
        padding:0.5em 0;
        letter-spacing:0.25em;
      }
      span{
        display:block;
        width:100%;
        padding:10px 15px;
        text-align:left;
        color:$black;
        font-family:$sans2;
        text-transform:uppercase;
        letter-spacing:2px;
      }
      i{
        display:inline-block;
        float:left;
        margin-right:10px;
        margin-top:2.5px;
      }
      
    }
    
  }
  .container {
    width: 400px;
    height: 200px;
    position: absolute;
    top:50%;
    left:50%;
    perspective: 1000px;
    transform:translateX(-50%) translateY(-50%);
      #cube {
      width: 100%;
      height: 100%;
      position: absolute;
      transform-style: preserve-3d;
      transform:rotateX(-20deg);
      box-shadow:0px 150px 150px 20px rgba(0,0,0,0.5);
        .front  { transform: rotateY(   0deg ) translateZ( 200px ) translateX(-2px);
                  background:$brown;
                  width:400px;
          .eye{
            position:absolute;
            width:40px;
            height:40px;
            background:darken($brown, 40%);
            left:20%;
            top:20%;
            border-radius:100%;
            &:nth-of-type(2){
              left:auto;
              right:20%;
            }
          }
          .mouth{
            position:absolute;
            width:100px;
            height:20px;
            background:darken($brown, 40%);
            left:50%;
            transform:translateX(-50%);
            top:50%;
            border-radius:40px 40px 40px 40px;
            transition-delay:1s;
            transition:0.2s ease-in-out;
          }
                  
                  }
        .back   { transform: rotateX( 180deg ) translateZ( 180px ); background:darken($brown, 20%) }
        .right  { transform: rotateY(  90deg ) translateZ( 200px );
                  background:darken($brown, 15%);}
        .left   { transform: rotateY( -90deg ) translateZ( 200px );
                  background:darken($brown, 15%);}
        .top    { transform: rotateX(  90deg ) translateZ( 100px ) translateY(222.5px) translateX(23px);
                  background:darken($brown, 5%);
                  height:140px;
                  width:350px;
                  }
        .top2 { transform: rotateX(  90deg ) translateZ( 100px ) translateY(-23px) translateX(15px);
                  background:darken($brown, 5%);
                  height:160px;
                  width:366px;
        }
        .top3, .top4 { transform: rotateX(  90deg ) translateZ( 100px ) translateY(-23px) translateX(2px);
                  background:darken($brown, 5%);
                  height:190px;
                  width:70px;
        }
        .top4{
          transform: rotateX(  90deg ) translateZ( 100px ) translateY(-23px) translateX(323px);
        }
        figure {
        margin: 0;
        width: 396px;
        height: 196px;
        display: block;
        position: absolute;
        z-index:3;
          div{
            z-index:3;
          }
          h1{
            font-size:5em;
            font-family:$sans;
            color:$brown;
            letter-spacing:0.25em;
            position:absolute;
            left:50%;
            top:50%;
            margin-left:7.5px;
            transform:translateX(-50%) translateY(-100%);
          }
        }
    }
  }
  &.wink{
    .murica{
      transition:0.3s ease-in-out;
      transition-delay:1s;
      opacity:1;
    }
    .ballotwrap{
      .ballot{
        animation:drop 1s ease-in-out forwards;
        @keyframes drop{
          0%{
            transform:translateX(-50%) translateY(0%);
          }
          100%{
            transform:translateX(-50%) translateY(275%);
          }
        }
      }
    }
    .container{
      #cube{
        .front{
          .mouth{
            transition-delay:0.8s;
            height:60px;
            border-radius:10px 10px 50px 50px;
          }
          .eye{
            &:nth-of-type(1){
              animation:wink 0.3s ease-in-out 1;
              animation-delay:1.2s;
              @keyframes wink{
                0%{
                  transform:scaleY(1) scaleX(1);
                }
                50%{
                  transform:scaleY(0.2) scaleX(1.4);
                }
                100%{
                  transform:scaleY(1) scaleX(1);
                }
              }
            }
          }
        }
      }
    }
  }
  #grad {
  position: relative;
  width: 100%;
  height: 100%;
}
#grad:after, #grad:before {
  content: '';
  position: absolute;
  background: linear-gradient(90deg, transparent 50%, black 50%, black), linear-gradient(82deg, transparent 50%, #12E0DB 50%, #12E0DB), linear-gradient(67deg, transparent 50%, #000000 50%, #000000), linear-gradient(52deg, transparent 50%, #12E0DB 50%, #12E0DB), linear-gradient(37deg, transparent 50%, #000000 50%, #000000), linear-gradient(22deg, transparent 50%, #12E0DB 50%, #12E0DB), linear-gradient(7deg, transparent 50%, #000000 50%, #000000), linear-gradient(-8deg, transparent 50%, #12E0DB 50%, #12E0DB), linear-gradient(-23deg, transparent 50%, #000000 50%, #000000), linear-gradient(-38deg, transparent 50%, #12E0DB 50%, #12E0DB), linear-gradient(-53deg, transparent 50%, #000000 50%, #000000), linear-gradient(-68deg, transparent 50%, #12E0DB 50%, #12E0DB), linear-gradient(-83deg, transparent 50%, #000000 50%, #000000), linear-gradient(-90deg, transparent 50%, #12E0DB 50%, #12E0DB);
  background-position: 0% 0%;
  background-size: 200% 100%;
  height: 100%;
  width: 50%;
}
:before {
  left: 50%;
  transform: rotate(180deg);
}
  .murica {
  opacity:0;
  transition:0.3s ease-in-out;
  position: absolute;
  width: 150vw;
  height: 150vw;
  z-index:-1;
  left:50%;
  top:50%;
  animation:rotating 20s linear infinite;
    @keyframes rotating{
      0%{
        transform:translateX(-50%) translateY(-50%) rotate(0deg);
      }
      100%{
        transform:translateX(-50%) translateY(-50%) rotate(360deg);
      }
    }
}
.murica:after, .murica:before {
  content: '';
  position: absolute;
  background: linear-gradient(90deg, transparent 50%, $red 50%, $red), linear-gradient(82deg, transparent 50%, $white 50%, $white), linear-gradient(67deg, transparent 50%, $red 50%, $red), linear-gradient(52deg, transparent 50%, $white 50%, $white), linear-gradient(37deg, transparent 50%, $red 50%, $red), linear-gradient(22deg, transparent 50%, $white 50%, $white), linear-gradient(7deg, transparent 50%, $red 50%, $red), linear-gradient(-8deg, transparent 50%, $white 50%, $white), linear-gradient(-23deg, transparent 50%, $red 50%, $red), linear-gradient(-38deg, transparent 50%, $white 50%, $white), linear-gradient(-53deg, transparent 50%, $red 50%, $red), linear-gradient(-68deg, transparent 50%, $white 50%, $white), linear-gradient(-83deg, transparent 50%, $red 50%, $red), linear-gradient(-90deg, transparent 50%, $white 50%, $white);
  background-position: 0% 0%;
  background-size: 200% 100%;
  height: 100%;
  width: 50%;
  box-shadow:inset -5px 0px $white, inset 5px 0px $white;
}
.murica:before {
  left: 50%;
  transform: rotate(180deg);
}
}
  
              
            
!

JS

              
                var $post = $("body");

setInterval(function(){
    $post.toggleClass("wink");
}, 2000);

              
            
!
999px

Console