Now let’s take a look at the code behind it:
// CSS
.mug-container {
position: relative;
width: 100%;
height: 70vh;
background-color: #b91a5f;
overflow: hidden;
z-index: -1;
}
.mug {
width: 260px;
height: 160px;
background-color: #e9f5a9;
border-bottom-left-radius: 260px;
border-bottom-right-radius: 260px;
margin-top: -80px;
margin-left: -147px;
position: absolute;
top: 60%;
left: 50%;
}
.mug:before {
position: absolute;
color: #e85a71;
content: "≈";
font-family: "Times New Roman", Times, serif;
font-size: 90px;
font-weight: 700;
line-height: 0;
top: 0;
left: 40%;
-webkit-animation-name: blend;
animation-name: blend;
-webkit-animation-duration: 2.3s;
animation-duration: 2.3s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-delay: 2s;
animation-delay: 2s;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
transform: rotate(100deg) translate(50px);
transform-style: preserve-3d;
z-index: -1;
}
.mug:after {
width: 85px;
height: 95px;
content: "";
border: 28px solid #e9f5a9;
border-radius: 50%;
position: absolute;
top: 0;
right: -43px;
}
.mug__bottom {
width: 87px;
height: 13px;
background-color: #e9f5a9;
border-radius: 40%;
margin-left: -44px;
position: absolute;
bottom: 0;
left: 50%;
}
.tree {
width: 0;
height: 0;
border-style: solid;
border-top-width: 0;
border-color: transparent transparent #e85a71 transparent;
position: absolute;
left: 50%;
}
.xmas {
list-style-type: none;
}
.xmas__01 {
border-right-width: 24px;
border-bottom-width: 24px;
border-left-width: 24px;
margin-left: -24px;
border-bottom-color: #41D3BD;
top: 22px;
z-index: 3;
}
.xmas__02 {
border-right-width: 34px;
border-bottom-width: 34px;
border-left-width: 34px;
margin-left: -34px;
border-bottom-color: #2EC4B6;
top: 30px;
z-index: 2;
}
.xmas__03 {
border-right-width: 42px;
border-bottom-width: 42px;
border-left-width: 42px;
margin-left: -42px;
border-bottom-color: #4eb2b3;
top: 38px;
z-index: 1;
}
.xmas__04 {
border-right-width: 50px;
border-bottom-width: 50px;
border-left-width: 50px;
margin-left: -50px;
border-bottom-color: #519fa0;
top: 45px;
z-index: 0;
}
.serve {
-webkit-animation-name: serve;
animation-name: serve;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
animation-direction: reverse;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
@-webkit-keyframes blend {
40%, 50% {
color: #FADAD8;
}
80%, 100% {
color: #e85a71;
opacity: 0;
font-size: 92px;
transform: rotate(95deg) translate(-85px) scaleX(2);
}
}
@keyframes blend {
40%, 50% {
color: #FADAD8;
}
80%, 100% {
color: #e85a71;
opacity: 0;
font-size: 92px;
transform: rotate(95deg) translate(-85px) scaleX(2);
}
}
@-webkit-keyframes serve {
100% {
top: 150%;
}
}
@keyframes serve {
100% {
top: 150%;
}
}
// HTML
<div class='mug-container'>
<div class="mug serve">
<ul class="xmas">
<li class="xmas__01 tree serve"></li>
<li class="xmas__02 tree serve"></li>
<li class="xmas__03 tree serve"></li>
<li class="xmas__04 tree serve"></li>
</ul>
<div class="mug__bottom"></div>
</div>
</div>