Snippets Animation

Bootstrap 5 3D Carousel with Autoplay and Spread Options

A coverflow-style 3D photo carousel with previous and next buttons, keyboard arrows, an autoplay switch and a spread slider.

Bootstrap 5 No jQuery Jan 2020 2.9K views

<section class="wdw-stage">
  <div class="container" style="max-width:1000px">
    <div class="text-center mb-4">
      <span class="wdw-eyebrow">Gallery</span>
      <h2 class="wdw-heading display-6 mt-1 mb-2">3D Carousel</h2>
      <p class="wdw-muted mb-0">Click a photo, use the arrows, or press the arrow keys.</p>
    </div>
    <div class="wdw-card p-3 p-md-4">
      <div class="c3d" id="c3d" tabindex="0" role="region" aria-roledescription="carousel" aria-label="Photo carousel"><button type="button" class="c3d-slide" aria-label="Spring blossoms"><img src="https://images.unsplash.com/photo-1490750967868-88aa4486c946?auto=format&fit=crop&w=720&h=480&q=70" alt="Spring blossoms" width="720" height="480" draggable="false"></button><button type="button" class="c3d-slide" aria-label="Sunlit valley"><img src="https://images.unsplash.com/photo-1469474968028-56623f02e42e?auto=format&fit=crop&w=720&h=480&q=70" alt="Sunlit valley" width="720" height="480" draggable="false"></button><button type="button" class="c3d-slide" aria-label="Forest light"><img src="https://images.unsplash.com/photo-1441974231531-c6227db76b6e?auto=format&fit=crop&w=720&h=480&q=70" alt="Forest light" width="720" height="480" draggable="false"></button><button type="button" class="c3d-slide" aria-label="Mountain meadow"><img src="https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=720&h=480&q=70" alt="Mountain meadow" width="720" height="480" draggable="false"></button><button type="button" class="c3d-slide" aria-label="Alpine lake"><img src="https://images.unsplash.com/photo-1501785888041-af3ef285b470?auto=format&fit=crop&w=720&h=480&q=70" alt="Alpine lake" width="720" height="480" draggable="false"></button><button type="button" class="c3d-slide" aria-label="Misty hills"><img src="https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?auto=format&fit=crop&w=720&h=480&q=70" alt="Misty hills" width="720" height="480" draggable="false"></button><button type="button" class="c3d-slide" aria-label="Green fields"><img src="https://images.unsplash.com/photo-1472214103451-9374bd1c798e?auto=format&fit=crop&w=720&h=480&q=70" alt="Green fields" width="720" height="480" draggable="false"></button></div>
      <p class="text-center fw-semibold mb-3" id="c3dCaption" aria-live="polite"></p>
      <div class="d-flex flex-wrap align-items-center justify-content-center gap-3">
        <button type="button" class="btn btn-outline-primary rounded-pill" id="c3dPrev" aria-label="Previous photo">← Prev</button>
        <button type="button" class="btn btn-primary rounded-pill" id="c3dNext" aria-label="Next photo">Next →</button>
        <div class="form-check form-switch ms-md-3 mb-0">
          <input class="form-check-input" type="checkbox" role="switch" id="c3dAuto">
          <label class="form-check-label" for="c3dAuto">Autoplay</label>
        </div>
        <div class="d-flex align-items-center gap-2">
          <label for="c3dSpread" class="small wdw-muted mb-0">Spread</label>
          <input type="range" class="form-range" id="c3dSpread" min="40" max="140" value="90" style="width:120px">
        </div>
      </div>
    </div>
  </div>
</section>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.