DRAUGHT BEER
Draught beer responsive width
by Chun
HTML
<div class="beerFestWrapper">
<section class="beerFestContainer">
<div id="action">
<div id="keg">
<div id="pipe-handle"></div>
<div id="pipe"></div>
<div id="pipe-front"></div>
</div>
<div class="glass">
<div class="beer"></div>
<div class="handle">
<div class="top-right"></div>
<div class="bottom-right"></div>
</div>
<div class="front-glass"></div>
</div>
</div>
</section>
<h1>
BUY ME A BEER
</h1>
</div>
http://codepen.io/HugoGroutel/pen/dJniD
CSS
.beerFestWrapper {
margin: 0;
padding: 0;
font-family: sans-serif;
background-color: #E9573F;
text-align: center;
}
.beerFestWrapper h1 {
display: inline-block;
margin-top: 20px;
color: white;
border-top: solid 5px white;
border-bottom: solid 5px white;
transform: skew(0, -5deg);
}
section.beerFestContainer {
background-color: #FC6E51;
}
#action {
margin: 0 auto;
width: 100%;
position: relative;
height: 250px;
overflow: hidden;
}
#keg {
position: absolute;
height: 200px;
width: 70px;
background-color: #656D78;
border-right: solid 20px #434A54;
bottom: 0;
left: 50%;
transform: translate(-50%);
}
#pipe {
position: absolute;
height: 30px;
width: 10px;
top: 30px;
left: 10px;
background-color: #CCD1D9;
}
#pipe:before {
position: absolute;
display: block;
content: " ";
height: 20px;
width: 30px;
top: -5px;
left: 5px;
background: linear-gradient(to bottom, #CCD1D9 50%, #AAB2BD 50%);
border-radius: 0 10px 10px 0;
}
#pipe:after {
position: absolute;
display: block;
content: " ";
width: 10px;
background-color: rgba(255, 206, 84, 0.5);
animation: flow 5s ease infinite;
}
@keyframes flow {
0%, 15% {
top: 30px;
height: 0px;
}
20% {
height: 125px;
}
40% {
top: 30px;
height: 85px;
}
55% {
top: 30px;
height: 60px;
}
60%, 100% {
top: 70px;
height: 0px;
}
}
#pipe-front {
position: absolute;
height: 14px;
width: 14px;
top: 25px;
left: 5px;
background-color: #F5F7FA;
border-radius: 10px;
border: solid 3px #CCD1D9;
}
#pipe-handle {
transform-origin: center bottom;
position: absolute;
width: 0;
height: 5px;
top: -20px;
left: 5px;
border-style: solid;
border-width: 50px 10px 0 10px;
border-color:...
JavaScript
http://codepen.io/HugoGroutel/pen/dJniD