<!-- Sliderを包むコンテナ要素 -->
<div class="swiper">
  <!-- スライド要素を包む要素 -->
  <div class="swiper-wrapper">
    <!-- 各スライド -->
    <div class="swiper-slide slide1">
      <p>loop1</p>
    </div>
    <div class="swiper-slide slide2">
      <p>loop2</p>
    </div>
    <div class="swiper-slide slide3">
      <p>loop3</p>
    </div>
  </div>
</div>
.swiper {
  /*スライダーの幅と高さを調整*/
  width: 100%;
  height: 200px;
  margin: 0.5rem auto;
}

.swiper-slide {
  /*スライド要素の幅と高さを調整*/
  width: 100%;
  height: 100%;

  /*テキストの位置調整*/
  display: flex;
  justify-content: center;
  align-items: center;

  /*テキストの色と太さを指定*/
  color: #fff;
  font-weight: bold;
}

/*各スライドの背景色の設定*/
.slide1 {
  background-color: #88acbd;
}

.slide2 {
  background-color: #99cb1f;
}

.slide3 {
  background-color: #e43a47;
}

.swiper-wrapper {
  transition-timing-function: linear;
}
const swiper = new Swiper(".swiper", {
  speed: 10000,
  slidesPerView: 2,
  loop: true,
  centeredSlides: true,
  preventInteractionOnTransition: true,
  autoplay: {
    delay: 0 // 0にすることで流れ続けるようになる
  }
});

External CSS

  1. https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.css

External JavaScript

  1. https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js