<div class="frame">
<div class="mushroom-container">
<div class="mushroom-head"></div>
<div class="mushroom-body">
<div class="eyes">
<div class="eye"></div>
<div class="eye"></div>
</div>
<div class="mouth"></div>
</div>
<div class="shadow"></div>
</div>
</div>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.frame {
height: 400px;
width: 600px;
background: linear-gradient(45deg, #f5c9c9, rgb(231, 200, 189));
display: flex;
align-items: center;
justify-content: center;
&:hover {
mix-blend-mode: exclusion;
background: radial-gradient(closest-side, #fafafa 2%, #ebf8e1 17%, #000);
}
}
.mushroom-container {
height: 200px;
width: 200px;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
transform-origin: 50% 100%;
animation: breath 2.5s cubic-bezier(0.41, -0.48, 0.68, 0.71) infinite;
transition: all 0.25s ease-out;
&:hover {
animation: breath 0.8s cubic-bezier(0.41, -0.18, 0.68, 0.81) infinite;
mix-blend-mode: exclusion;
width: 100px;
}
}
.mushroom-head {
height: 70%;
width: 110%;
background: radial-gradient(
circle at 70% 40%,
rgb(153, 26, 26) 10%,
#490606 70%,
#360808 100%
);
border-radius: 100% 100% 50% 50%;
z-index: 1;
}
.mushroom-body {
height: 70%;
width: 60%;
background: radial-gradient(
circle at 60% 58%,
rgb(220, 198, 198) 1%,
#f5b3a6 63%,
#9d5950 100%
);
border-radius: 100% 100% 40% 40%;
position: absolute;
bottom: 0;
}
.mushroom-body .eyes {
height: 15%;
width: 100%;
/* background-color:pink; */
position: absolute;
bottom: 25%;
display: flex;
flex-direction: row;
justify-content: space-around;
animation: breath 2.5s cubic-bezier(0.41, -0.48, 0.68, 0.71) infinite 0.3s;
}
.eye {
height: 100%;
width: 20%;
background: radial-gradient(
circle at 70% 40%,
#fff 10%,
#000000 15%,
#030303 100%
);
border-radius: 50%;
z-index: 1;
}
.eye::after {
content: "";
position: absolute;
height: 60%;
width: 20%;
background: radial-gradient(#f8b7b7 5%, #ffffff00 100%);
border-radius: 50%;
top: 90%;
filter: blur(2px);
}
.mouth {
height: 10%;
width: 12%;
background-color: #ff2146;
box-shadow: inset -1px 1px 3px #efcde6,
inset -2px 2px 10px rgba(15, 15, 15, 0.4);
border-radius: 100% 100% 70% 70%;
position: absolute;
bottom: 15%;
left: 45%;
animation: bubble-face 2s cubic-bezier(0.41, -0.48, 0.68, 0.71) infinite 0.1s;
overflow: hidden;
}
.shadow {
background-color: rgba(0, 0, 0, 0.15);
width: 90%;
height: 20%;
position: absolute;
bottom: -3%;
left: 0px;
border-radius: 50%;
z-index: -1;
/* animation: shadow 2s cubic-bezier(.41,-0.48,.68,.71) infinite; */
}
@keyframes breath {
0%,
100% {
transform: scaleY(1.09);
}
50% {
transform: scaleY(1);
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.