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

              
                <div class="container">
  <div class="counter"></div>  
  <div class="tap">
    <div class="base">
      <div class="pipes">
        <span class="pipe1"></span>
        <span class="pipe2"></span>
        <span class="pipe-base"></span>
        <div class="spicket">
        <div class="spout">
          <span class="top"></span>
          <span class="bottom"></span>
        </div>
        <span class="cover"></span>
        <span class="handle"></span>
      </div>
     </div> 
    </div>
  </div>
  <div class="beer-container">
   <div class="beer">
    <span class="stream"></span>
    <span class="fill"></span>
    <span class="splash"></span>
    <span class="foam"></span>
   </div>
  </div>
  <div class="beer-glass">
    <span class="glass">
      <span class="handle"></span>
      <span class="main"></span>
    </span>
  </div>
  <div class="divide"></div>
</div>
              
            
!

CSS

              
                $grey: #cccccc;
$lightGrey:#eeeeee;
$lighterGrey: #ededed;
$lightestGrey: #f3f3f3;
$darkGrey: #bcbcbc;
$white: #ffffff;
$yellow: #ffc300;
$darkYellow: #ffd85a;
$green: #d9e022;
$darkGreen:#ced11f;

body{
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
.container{
  width: 400px;
  height: 300px;
  position: relative;
}
.counter{
  position: absolute;
  height: 2px;
  width: 75%;
  background-color: #333;
  border-radius: 2px;
  bottom: 49px;
  left: 50%;
  transform: translate(-50%);
}
.tap{
  position: absolute;
  bottom: 51px;
  left: 30%;
  transform: translate(-30%);
  .base{
    .pipes{
      position: relative;
      height: 200px;
      .pipe1{
      position: absolute;
      background-color: $grey;
      height: 75%;
      width: 16px;
      bottom: 0;
      border-radius: 40px 40px 0 0;
      background-image:
         linear-gradient(
      to top, 
      $darkGrey, $darkGrey 8px, $grey 12px
    );
      }
       .pipe2{
      position: absolute;
      background-color: $grey;
      height: 16px;
      width: 60px;
      top: 25%;
      border-radius: 40px 0 0          40px;
      }
      .pipe-base{
      position: absolute;
      bottom: 0;
      background-color: $darkGrey;
      height: 8px;
      width: 28px;
      left: -6px;
      border-radius: 2px 2px 0 0;
      }
    }
    .spicket{
      position: absolute;
      height: 36px;
      top: 50px;
      left: 60px;
      &::before{
          content: "";
          position: absolute;
          width: 6px;
          height: 6px;
          background-color: $darkGrey;
          top: -10px;
          left: 5px;
        }
 
      .spout{
        .top{
        position: absolute;
        top: 20px;
        left: 1.5px;
        height: 14px;
        width: 14px;
        background: $grey;
        clip-path: polygon(0 0, 100% 0, 75% 100%, 25% 100%);
        animation: 8s spoutUp infinite;
      }
        .bottom{
          position: absolute;
          width: 11px;
          height: 2px;
          background-color: $darkGrey;
          bottom: 1px;
          left: 3px;
          border-radius: 2px;
          animation: 8s spoutUp infinite;
        }
      }
      .cover{
        position: absolute;
        top:-6px;
        height: 28px;
        width: 16px;
        background: $green;
        border-radius: 2px;
      }
      .handle{
        position: absolute;
        top: -62px;
        height: 54px;
        width: 20px;
        background: $green;
        border-radius: 2px;
        left: -2px;
        clip-path: polygon(2% 0, 98% 0, 75% 100%, 25% 100%);
        transform-origin: bottom;
        animation: 8s turnOnTap infinite;
        
        &::after{
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        height: 46px;
        width: 12px;
        border-radius: 2px;
        background: $darkGreen;
        clip-path: polygon(2% 0, 98% 0, 75% 100%, 25% 100%);
        }
      }
    }
  }
}
.beer-glass{
  position: absolute;
  bottom: 51px;
  left: 41%;
  animation: 8s slideIn cubic-bezier(.04,.58,.13,1) infinite;
  .glass{
    position: relative;
    height: 200px;
    // opacity: .75;
    .main{
    opacity: .3;
    position: absolute;
    background-color: $darkGrey;
    height: 80px;
    width: 50px;
    bottom: 6px;
    border-radius: 2px;
      &::before{
        content: "";
        position: absolute; 
        bottom: -6px;
        left: 50%;
        transform: translate(-50%);
        height: 6px;
        width: 44px;
        background-color: $darkGrey;
      }
      &::after{
      content: "";
        position: absolute; 
        bottom: 4px;
        left: 7px;
        height: 66px;
        width: 6px;
        border-radius: 2px;
        background-color: $lightestGrey;
        box-shadow: 
          10px 0px 0px $lightestGrey,
          20px 0px 0px $lightestGrey,
          30px 0px 0px $lightestGrey,
          ;
      }
      }
    .handle{
    position: absolute;
    height: 42px;
    width: 16px;
    bottom: 26px;
    border-radius: 0 4px 4px 0;
    left: 49px;
     background-image:
    linear-gradient(
      to right, 
      $grey, $grey 1px, $lightGrey 4px
    );
      &::after{
    content: "";
    position: absolute;
    background-color: $white;
    height: 30px;
    width: 10px;
    bottom: 6px;
    border-radius: 2px;
    left: 0;
      }
    }
  }
}
.beer-container{
  position: absolute;
  bottom: 51px;
  left: 46%;
  .beer{
    position: relative;
    height: 200px;
  
  .stream{
    // opacity: .5;
    position: absolute;
    background-color: $yellow;
    height: 106px;
    width: 8px;
    top: 85px;
    animation: 8s pourBeer linear infinite;
    }
    .fill{
      // opacity: .7;
      position: absolute;
      bottom: 8px;
      height: 56px;
      width: 42px;
      background-color: $yellow;
      left: -16px;
      border-radius: 0 0 2px 2px;
      animation: 8s fillCup infinite;
    }
     .splash{
      position: absolute;
      bottom: 64px;
      left: -10px;
      background-color: $yellow;
      height: 6px;
      width: 6px;
      border-radius: 50% 50% 0 50%;
      transform-origin: bottom;
      animation: 8s splash infinite;
       &::before{
        content: "";
        position: absolute;
        bottom: 2px;
        left: 12px;
        background-color: $yellow;
        height: 6px;
        width: 6px;
        border-radius: 50% 50% 0 50%;
        transform: rotate(45deg);
       }
        &::after{
        content: "";
        position: absolute;
        bottom: 0;
        left: 24px;
        background-color: $yellow;
        height: 6px;
        width: 6px;
        border-radius: 50% 50% 50% 0%;
       }
    }
     .foam{
      position: absolute;
      bottom: 64px;
      height: 8px;
      width: 42px;
      background-color: $white;
      z-index: 1;
      opacity: 1;
      left: -16px;
      border-radius: 2px 2px 0 0;
      animation: 8s foamItUp infinite;
    }
  }
}
.divide{
  height: 300px;
  width: 400px;
  background-color: $white;
  position: absolute;
  right: -350px;
}
@keyframes pourBeer{
  0%{
    transform-origin: top;
    transform: scaleY(0);
  }
  28%{
    transform-origin: top;
    transform: scaleY(0);
  }
  30%{
    transform-origin: top;
    transform: scaleY(1);
  }
  50%{
    transform: scaleY(1);
    transform-origin: bottom;
  }
  52%{
    transform: scaleY(0);
  }
  100%{
    transform: scaleY(0);
  }
}
@keyframes fillCup{
  0%{
    transform: scaleY(0);
    transform-origin: bottom;
  }
  30%{
    transform: scaleY(0);
    transform-origin: bottom;
  }
  75%{
    transform: scaleY(1);
    transform-origin: bottom;
  }
  100%{
    transform: scaleY(1);
    transform-origin: bottom;
  }
}
@keyframes foamItUp{
  0%{
    transform: scaleY(0);
  }
  65%{
    transform: scaleY(0);
    transform-origin: bottom;
  }
  75%{
    transform: scaleY(1);
    transform-origin: bottom;
  }
}
@keyframes turnOnTap{
  24%{
    transform: rotate(0deg);
  }
  25%{
    transform: rotate(-14deg);
  }
  49%{
    transform: rotate(-14deg);
  }
  50%{
    transform: rotate(0deg);
  }
}
@keyframes slideIn{
  0%{
   transform: translate(400px);
  }
  25%{
    transform: translate(0);
  }
}
@keyframes spoutUp{
  0%{
    transform: translateY(0px);
  }
  24%{
    transform: translateY(0px);
  }
  27%{
    transform: translateY(-4px);
  }
  30%{
    transform: translateY(0px);
  }
}
@keyframes splash{
  0%{
    opacity: 0;
    transform: translateY(30px);
  }
  52%{
    opacity: 0;
     transform: translateY(30px);
   
  }
  55%{
    opacity: 1;
    transform: translateY(0);
   
  }
  75%{
    transform: translateY(30px);
  }
  100%{
    transform: translateY(30px);
  }
}
              
            
!

JS

              
                // Inspired by Sean Leach on Dribbble:

// https://dribbble.com/shots/3886784-Beer-o-clock
              
            
!
999px

Console