CSS
body {
background: #c0392b;
}
.dance-container {
height: 64px;
left: 50%;
margin: 32px 0 0 -32px;
position: absolute;
top: 50%;
width: 64px;
}
.shadow {
background: rgba(0, 0, 0, 0.4);
border-radius: 50%;
height: 8px;
left: -10%;
margin-top: -4px;
position: absolute;
top: 100%;
width: 120%;
z-index: 1;
animation: shadow 0.5s linear infinite alternate;
transform: translateX(-50%);
}
.avatar-container {
height: 64px;
left: 0;
position: absolute;
top: 0;
width: 64px;
z-index: 2;
animation: the-forbidden-dance 0.5s linear infinite alternate;
transform-origin: center bottom;
}
.avatar {
background: url("https://goo.gl/O6FMKo") no-repeat center center;
background-size: contain;
border-radius: 3px;
height: 100%;
width: 100%;
animation: do-a-flip 10s linear 0.5s infinite;
}
@keyframes the-forbidden-dance {
0% {
transform: translate3d(0, -180px, 0) scaleY(1);
animation-timing-function: cubic-bezier(0.895, 0.03, 0.685, 0.22);
}
80% {
transform: translate3d(0, 0, 0) scaleY(2) scaleX(0.6);
}
90% {
transform: translate3d(0, 0, 0) scaleY(0.4) scaleX(1);
}
100% {
transform: translate3d(0, 0, 0) scaleY(0.25) scaleX(2);
}
}
@keyframes do-a-flip {
0% {
transform: rotate(0deg);
}
21% {
transform: rotate(0deg);
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
28% {
transform: rotate(-360deg);
}
71% {
transform: rotate(-360deg);
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
78% {
transform: rotate(360deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes shadow {
0% {
opacity: 0.5;
transform: scaleX(0.5) scaleY(0.5);
animation-timing-function: cubic-bezier(0.895, 0.03, 0.685, 0.22);
}
90% {
opacity: 1;
transform: scaleX(1.15) scaleY(0.1);
}
100% {
opacity: 1;
transform: scaleX(1.15) scaleY(0.1);
}
}