I have this code that creates a wine glass with CSS:
body{
background: #000;
}
.wrap {
width: 100px;
margin: 0 auto;
position: relative;
}
.glass{
margin: 0 auto;
height: 100px;
width: 100px;
border-radius: 0px 0px 50% 50%;
padding-top: 50px;
box-sizing: border-box;
background-color: rgba(0,222,255, 0.3);
}
.liquid{
width: 100px;
bottom: 96px;
left: 0;
position: absolute;
height: 50px;
border-radius: 0px 0px 100px 100px;
display:block;
z-index: -1;
background-color: rgba(255,0,0, 0.5);
}
.stem {
margin: 0 auto;
height: 75px;
width: 10px;
background-color: rgba(0,222,255, 0.3);
border-bottom: 2px solid rgb(0,155.4,178.5) ;
border-radius: 0px 0px 5px 5px;
}
.base {
margin: 0 auto;
margin-top: -6px;
width: 100px;
height: 25px;
border-radius: 50%;
background-color: rgba(0,222,255, 0.3);
}
<div class="wrap">
<div class="glass"></div>
<div class="liquid"></div>
<div class="stem"></div>
<div class="base"></div>
</div>
The part that simulates the liquid in the cup is div .liquid
that has height of 50px
.
How would I make this height from 50px to 100px, animated and take 4 seconds, once the page is opened, using only CSS?
I tried to do with .animate
of jQuery but it gets stuck because of other functions running at the same time.