Blossom Carousel Logo
Advanced

Slideshow

Create a slideshow with parallax effects.
.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  scroll-snap-type: x mandatory;
  height: 22.5rem;
}

.slide {
  width: 100%;
  height: 100%;
  overflow: hidden;
  scroll-snap-align: center;

  view-timeline: --slide inline;
}

.slide .card {
  width: 100%;
  height: 100%;

  animation: parallax linear both;
  animation-timeline: --slide;
  animation-range: cover;
}

@keyframes parallax {
  0% {
    transform: translateX(-50%);
  }
  50% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(50%);
  }
}