body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background: #e8e8e8;
}
.container {
overflow: hidden;
width: 70%;
border-radius: 8px;
background: #f4f4f4;
padding: 20px 0;
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
}
.wrapper {
display: grid;
grid-auto-flow: column;
grid-auto-columns: 12rem;
gap: 2rem;
width: max-content;
animation: animate 10s linear infinite;
}
.wrapper img {
width: 100%;
height: 14rem;
object-fit: cover;
border-radius: 8px;
transition: transform 0.2s ease-in-out;
}
.wrapper:hover {
animation-play-state: paused;
cursor: pointer;
}
@keyframes animate {
to {
transform: translateX(calc(-5 * (12rem + 2rem)));
}
}
.wrapper img:hover {
transform: scale(1.1);
}