I am on the hunt for a CSS-only infinite loop moving div. While I stumbled upon this codepen that almost fits the bill, I'm struggling to configure it so that the animation displays one logo at a time. Essentially, my goal is to initiate the animation, slide in one logo, pause for 5 seconds, and then introduce the next one.
https://codepen.io/jackoliver/pen/qVbQqW
HTML
<div class="slider">
<div class="slide-track">
<div class="slide">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/557257/1.png" height="100" width="250" alt="" />
</div>
<div class="slide">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/557257/2.png" height="100" width="250" alt="" />
</div>
<div class="slide">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/557257/3.png" height="100" width="250" alt="" />
</div>
(... Continues with more image tags ...)
</div>
</div>
CSS
body {
align-items: center;
background: #E3E3E3;
display: flex;
height: 100vh;
justify-content: center;
}
@mixin white-gradient {
background: linear-gradient(to right, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%);
}
$animationSpeed: 40s;
// Animation
@keyframes scroll {
0% { transform: translateX(0); }
100% { transform: translateX(calc(-250px * 7))}
}
// Styling
.slider {
background: white;
box-shadow: 0 10px 20px -5px rgba(0, 0, 0, .125);
height: 100px;
margin: auto;
overflow:hidden;
position: relative;
width: 960px;
&::before,
&::after {
@include white-gradient;
content: "";
height: 100px;
position: absolute;
width: 200px;
z-index: 2;
}
(... Style rules continue ...)
If anyone has any insight on how to tackle this issue, please share your knowledge!
Many thanks!!