JSFiddle - React, Tailwind, and code Playground
by crnacura
HTML
<div class="slideshow">
<div style="background-image: url(http://lorempixel.com/1200/600/fashion/1)"></div>
<div style="background-image: url(http://lorempixel.com/1200/600/fashion/2)"></div>
<div style="background-image: url(http://lorempixel.com/1200/600/fashion/3)"></div>
<div style="background-image: url(http://lorempixel.com/1200/600/fashion/4)"></div>
</div>
CSS
.slideshow {
position: fixed;
overflow: hidden;
width: 100%;
height: 100%;
}
.slideshow > div {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
background-size: cover;
}
.slideshow > div {
-webkit-animation: ssfader 80s linear infinite 0s backwards;
animation: ssfader 80s linear infinite 0s backwards;
}
.slideshow > div:nth-child(2) {
-webkit-animation-delay: 20s;
animation-delay: 20s;
}
.slideshow > div:nth-child(3) {
-webkit-animation-delay: 40s;
animation-delay: 40s;
}
.slideshow > div:nth-child(4) {
-webkit-animation-delay: 60s;
animation-delay: 60s;
}
@-webkit-keyframes ssfader {
0%, 100% {
opacity: 0;
}
8%, 17% {
opacity: 1;
}
25% {
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
44% {
opacity: 0;
-webkit-transform: scale(1.3);
transform: scale(1.3);
}
}
@keyframes ssfader {
0%, 100% {
opacity: 0;
}
8%, 17% {
opacity: 1;
}
25% {
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
44% {
opacity: 0;
-webkit-transform: scale(1.3);
transform: scale(1.3);
}
}