JSFiddle - React, Tailwind, and code Playground
HTML
<div class="coin"></div>
CSS
body {
-webkit-transform: perspective(500px);
-webkit-transform-style: preserve-3d;
}
.coin {
background-size: 100% 100%;
border-radius: 100%;
height: 100px;
margin: 50px auto;
position: relative;
width: 100px;
-webkit-transition: .5s linear;
-webkit-transform-style: preserve-3d;
animation: ROTATION 5s linear infinite;
}
.coin:after {
background-color: #a37131;
background-image: -webkit-linear-gradient(hsla(0,0%,100%,.25), hsla(0,0%,0%,.25));
bottom: 0;
content: '';
left: 45px;
position: absolute;
top: 0;
width: 5px;
background-size:cover;
z-index: -10;
-webkit-transform: rotateY(-90deg);
-webkit-transform-origin: 100% 50%;
animation: ROTATION_BACK 5s linear infinite;
}
.coin:before {
background-color: #a37131;
background-image: -webkit-linear-gradient(hsla(0,0%,100%,.25), hsla(0,0%,0%,.25));
background-size:cover;
border-radius: 100%;
content: '';
height: 100px;
left: 0;
position: absolute;
top: 0;
width: 100px;
-webkit-transform: translateZ(-5px);
animation: ROTATION_BACK 5s linear infinite;
}
@keyframes ROTATION {
0% {
transform: rotateY(0deg);
background: url("http://www.europaplus.ru/upload/thumb/news_308/images/news/Air_900.jpg") no-repeat 100% 0;
}
25%{
transform: rotateY(90deg);
background: url("http://www.europaplus.ru/upload/thumb/news_308/images/news/Air_900.jpg") no-repeat 100% 0;
}
25.1%{
transform: rotateY(90deg);
background-color: #a37131;
background-image: -webkit-linear-gradient(hsla(0,0%,100%,.25), hsla(0,0%,0%,.25));
}
75%{
background-color: #a37131;
background-image: -webkit-linear-gradient(hsla(0,0%,100%,.25), hsla(0,0%,0%,.25));
}
75.1%{
background: url("http://www.europaplus.ru/upload/thumb/news_308/images/news/Air_900.jpg") no-repeat 100% 0;
}
100% {
background:...