<div id="container">
<div id="beaker">
<div id="liquid">
<div class="bubble"></div>
<div class="bubble"></div>
<div class="bubble"></div>
<div class="bubble"></div>
<div class="bubble"></div>
<div class="bubble"></div>
<div class="bubble"></div>
</div>
</div>
</div>
body { background-color: #0e83cd; }
#container {
height: 270px;
margin: 50px auto;
overflow: hidden;
position: relative;
width: 248px;
}
#container div { position: absolute; }
#beaker {
border: 10px solid #FFF;
border-top: 0;
border-radius: 0 0 30px 30px;
height: 200px;
left: 14px;
bottom: 0;
width: 200px;
}
#beaker:before,
#beaker:after {
border: 10px solid #FFF;
border-bottom: 0;
border-radius: 30px 30px 0 0;
content: '';
height: 30px;
position: absolute;
top: -40px;
width: 30px;
}
#beaker:before { left: -50px; }
#beaker:after { right: -50px; }
#liquid {
background-color: #3C6;
border: 10px solid #3C6;
border-radius: 0 0 20px 20px;
bottom: 0;
height: 170px;
overflow: hidden;
width: 180px;
}
#liquid:after {
background-color: rgba(255, 255, 255, 0.25);
bottom: -10px;
content: '';
height: 200px;
left: -40px;
position: absolute;
transform: rotate(30deg);
transform: rotate(15deg);
width: 110px;
}
#liquid .bubble {
animation-name: bubble;
animation-iteration-count: infinite;
animation-timing-function: linear;
background-color: rgba(255, 255, 255, 0.2);
bottom: 0;
border-radius: 10px;
height: 20px;
width: 20px;
}
@-webkit-keyframes bubble {
0% { bottom: 0; }
50% {
background-color: rgba(255, 255, 255, 0.2);
bottom: 80px;
}
100% {
background-color: rgba(255, 255, 255, 0);
bottom: 160px;
}
}
@for $i from 1 through 7 {
.bubble:nth-child(#{$i}) {
left: random(180) * 1px;
animation-delay: random() * 30ms;
animation-duration: (random(10) + 3) * 100ms;
transform: scale((random(10) + 3)/10);
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.