Mouse in the House by
Suspicious mouse
On: 1 Jul 2016
Personal site: http://codepen.io/superoak
<div class="circle">
<div class="rat">
<div class="ear left"></div>
<div class="ear right"></div>
<div class="body">
<div class="eye left"></div>
<div class="eye right"></div>
<div class="blush left"></div>
<div class="blush right"></div>
<div class="nose"></div>
<div class="mouth"></div>
</div>
<div class="tail"></div>
</div>
</div>
body {
background-color: #f5efe3;
text-align: center;
}
.circle {
display: inline-block;
position: relative;
margin-top: 20px;
width: 300px;
height: 300px;
background-color: #edc951;
border-radius: 50%;
}
.rat .body {
z-index: 3;
position: absolute;
left: 50%;
top: 50%;
margin-left: -80px;
margin-top: -104px;
width: 160px;
height: 208px;
background-color: #999A9C;
border-radius: 100px 100px 40px 40px / 200px 200px 60px 60px;
}
.rat .body:after, .rat .body:before {
background-color: #999A9C;
width: 30px;
height: 20px;
border-radius: 8px;
position: absolute;
bottom: -10px;
content: "";
}
.rat .body:before {
left: 30px;
}
.rat .body:after {
right: 30px;
}
.rat .ear,
.rat .eye,
.rat .nose,
.rat .blush,
.rat .mouth,
.rat .tail {
position: absolute;
}
.rat .ear {
top: 10px;
background: #FFC5D3;
width: 75px;
height: 75px;
border-radius: 50%;
border: 15px solid #999A9C;
border-bottom-width: 5px;
z-index: 2;
}
.rat .ear.left {
right: 55%;
-webkit-transform: rotate(-25deg);
transform: rotate(-25deg);
}
.rat .ear.right {
left: 55%;
-webkit-transform: rotate(25deg);
transform: rotate(25deg);
}
.rat .eye {
width: 40px;
height: 40px;
border-radius: 50%;
background-color: white;
top: 50px;
-webkit-animation: eye 8s linear infinite;
animation: eye 8s linear infinite;
}
.rat .eye.left {
left: 30px;
}
.rat .eye.right {
right: 30px;
}
.rat .eye:after {
position: absolute;
left: 5px;
top: 5px;
width: 30px;
height: 30px;
content: "";
background-color: #3E4347;
border-radius: 50%;
-webkit-animation: eyeBall 7s infinite;
animation: eyeBall 7s infinite;
}
.rat .blush {
top: 95px;
width: 27px;
height: 19px;
border-radius: 50%;
background-color: #FFC5D3;
}
.rat .blush.left {
left: 30px;
}
.rat .blush.right {
right: 30px;
}
.rat .nose {
position: absolute;
left: 50%;
margin-left: -13px;
top: 50%;
background-color: #3E4347;
width: 26px;
height: 16px;
border-radius: 20px 20px 40px 40px/ 10px 10px 40px 40px;
}
.rat .mouth {
width: 20px;
height: 10px;
border-top: 4px solid #3E4347;
top: 130px;
left: 50%;
margin-left: -10px;
border-radius: 50%;
}
.rat .tail {
width: 120px;
height: 120px;
background-color: #F29A2E;
border-radius: 50%;
z-index: 1;
bottom: 50px;
left: 50%;
-webkit-transform-origin: left bottom;
transform-origin: left bottom;
-webkit-animation: tail 2s ease-in-out infinite alternate;
animation: tail 2s ease-in-out infinite alternate;
}
.rat .tail:after {
content: "";
width: 120px;
height: 120px;
background-color: #edc951;
border-radius: 50%;
position: absolute;
left: -10px;
bottom: 10px;
}
@-webkit-keyframes tail {
from {
-webkit-transform: rotate(-5deg);
transform: rotate(-5deg);
}
to {
-webkit-transform: rotate(5deg);
transform: rotate(5deg);
}
}
@keyframes tail {
from {
-webkit-transform: rotate(-5deg);
transform: rotate(-5deg);
}
to {
-webkit-transform: rotate(5deg);
transform: rotate(5deg);
}
}
@-webkit-keyframes eye {
0%, 9%, 11%, 100% {
-webkit-transform: scaleY(1);
transform: scaleY(1);
}
10% {
-webkit-transform: scaleY(0);
transform: scaleY(0);
}
}
@keyframes eye {
0%, 9%, 11%, 100% {
-webkit-transform: scaleY(1);
transform: scaleY(1);
}
10% {
-webkit-transform: scaleY(0);
transform: scaleY(0);
}
}
@-webkit-keyframes eyeBall {
0%, 70%, 80%, 100% {
-webkit-transform: translateX(0);
transform: translateX(0);
}
75% {
-webkit-transform: translateX(-5px);
transform: translateX(-5px);
}
}
@keyframes eyeBall {
0%, 70%, 80%, 100% {
-webkit-transform: translateX(0);
transform: translateX(0);
}
75% {
-webkit-transform: translateX(-5px);
transform: translateX(-5px);
}
}
61