Bootstrap 5 Vertical Testimonial Carousel
A vertical stacked-card testimonial carousel that auto-rotates, pauses on hover and has previous and next controls.
<section class="wdw-stage">
<div class="container" style="max-width:1100px">
<div class="row align-items-center gy-5 gx-lg-5">
<div class="col-lg-5">
<span class="wdw-eyebrow">Testimonials</span>
<h2 class="wdw-heading display-6 mt-2">Loved by teams who ship fast</h2>
<p class="wdw-muted fs-5">No contracts, no lock-in. Just great content, whenever you need it.</p>
<div class="d-flex gap-2 mt-4">
<button type="button" class="btn btn-outline-primary rounded-pill px-3" id="vcPrev" aria-label="Previous testimonial">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 15l6-6 6 6"/></svg>
</button>
<button type="button" class="btn btn-primary rounded-pill px-3" id="vcNext" aria-label="Next testimonial">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg>
</button>
<button type="button" class="btn btn-outline-secondary rounded-pill px-3" id="vcPause" aria-pressed="false" aria-label="Pause auto-rotation"><svg class="vc-i-pause" width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><rect x="6" y="5" width="4" height="14" rx="1"/><rect x="14" y="5" width="4" height="14" rx="1"/></svg><svg class="vc-i-play" width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M7 4.5v15a1 1 0 0 0 1.5.9l12-7.5a1 1 0 0 0 0-1.8l-12-7.5A1 1 0 0 0 7 4.5z"/></svg></button>
</div>
</div>
<div class="col-lg-7">
<div class="vc-stack" id="vcStack" role="region" aria-roledescription="carousel" aria-label="Customer testimonials" aria-live="off">
<article class="vc-card wdw-card p-4 pb-3 d-flex flex-column" data-pos="0" aria-hidden="false">
<svg class="vc-quote" width="48" height="48" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M9.5 6C6.5 6.8 4 9.6 4 13.5V18h6v-6H7c0-2 1-3.4 2.8-4zM19.5 6c-3 .8-5.5 3.6-5.5 7.5V18h6v-6h-3c0-2 1-3.4 2.8-4z"/></svg>
<span class="text-warning d-flex gap-1 mb-3" role="img" aria-label="5 out of 5 stars"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg></span>
<blockquote class="fs-5 fw-semibold text-body-emphasis mb-auto lh-base">With no contractual commitments comes the freedom of having top notch content created whenever you need it.</blockquote>
<div class="d-flex align-items-center gap-3 pt-3">
<img class="rounded-circle flex-shrink-0" src="https://i.pravatar.cc/112?img=5" width="48" height="48" alt="Charlize Theron">
<div>
<h3 class="h6 fw-bold mb-0 text-body-emphasis">Charlize Theron</h3>
<p class="small text-body-secondary mb-0">Head of Content, Northwind · New York, NY</p>
</div>
</div>
</article>
<article class="vc-card wdw-card p-4 pb-3 d-flex flex-column" data-pos="1" aria-hidden="true">
<svg class="vc-quote" width="48" height="48" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M9.5 6C6.5 6.8 4 9.6 4 13.5V18h6v-6H7c0-2 1-3.4 2.8-4zM19.5 6c-3 .8-5.5 3.6-5.5 7.5V18h6v-6h-3c0-2 1-3.4 2.8-4z"/></svg>
<span class="text-warning d-flex gap-1 mb-3" role="img" aria-label="5 out of 5 stars"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg></span>
<blockquote class="fs-5 fw-semibold text-body-emphasis mb-auto lh-base">Our turnaround dropped from two weeks to three days. The team feels like an extension of ours.</blockquote>
<div class="d-flex align-items-center gap-3 pt-3">
<img class="rounded-circle flex-shrink-0" src="https://i.pravatar.cc/112?img=12" width="48" height="48" alt="Marcus Oyelaran">
<div>
<h3 class="h6 fw-bold mb-0 text-body-emphasis">Marcus Oyelaran</h3>
<p class="small text-body-secondary mb-0">Product Lead, Kobo Labs · Lagos, NG</p>
</div>
</div>
</article>
<article class="vc-card wdw-card p-4 pb-3 d-flex flex-column" data-pos="2" aria-hidden="true">
<svg class="vc-quote" width="48" height="48" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M9.5 6C6.5 6.8 4 9.6 4 13.5V18h6v-6H7c0-2 1-3.4 2.8-4zM19.5 6c-3 .8-5.5 3.6-5.5 7.5V18h6v-6h-3c0-2 1-3.4 2.8-4z"/></svg>
<span class="text-warning d-flex gap-1 mb-3" role="img" aria-label="5 out of 5 stars"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg></span>
<blockquote class="fs-5 fw-semibold text-body-emphasis mb-auto lh-base">Clear scopes, honest timelines and design that actually ships. We renewed within a month.</blockquote>
<div class="d-flex align-items-center gap-3 pt-3">
<img class="rounded-circle flex-shrink-0" src="https://i.pravatar.cc/112?img=44" width="48" height="48" alt="Sofia Lindqvist">
<div>
<h3 class="h6 fw-bold mb-0 text-body-emphasis">Sofia Lindqvist</h3>
<p class="small text-body-secondary mb-0">Design Director, Fjord & Co · Stockholm, SE</p>
</div>
</div>
</article>
<article class="vc-card wdw-card p-4 pb-3 d-flex flex-column" data-pos="3" aria-hidden="true">
<svg class="vc-quote" width="48" height="48" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M9.5 6C6.5 6.8 4 9.6 4 13.5V18h6v-6H7c0-2 1-3.4 2.8-4zM19.5 6c-3 .8-5.5 3.6-5.5 7.5V18h6v-6h-3c0-2 1-3.4 2.8-4z"/></svg>
<span class="text-warning d-flex gap-1 mb-3" role="img" aria-label="5 out of 5 stars"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg></span>
<blockquote class="fs-5 fw-semibold text-body-emphasis mb-auto lh-base">The quality is consistent across every asset, which is rare for on-demand work.</blockquote>
<div class="d-flex align-items-center gap-3 pt-3">
<img class="rounded-circle flex-shrink-0" src="https://i.pravatar.cc/112?img=33" width="48" height="48" alt="Hiro Tanaka">
<div>
<h3 class="h6 fw-bold mb-0 text-body-emphasis">Hiro Tanaka</h3>
<p class="small text-body-secondary mb-0">Marketing Manager, Kintsugi · Osaka, JP</p>
</div>
</div>
</article>
<article class="vc-card wdw-card p-4 pb-3 d-flex flex-column" data-pos="4" aria-hidden="true">
<svg class="vc-quote" width="48" height="48" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M9.5 6C6.5 6.8 4 9.6 4 13.5V18h6v-6H7c0-2 1-3.4 2.8-4zM19.5 6c-3 .8-5.5 3.6-5.5 7.5V18h6v-6h-3c0-2 1-3.4 2.8-4z"/></svg>
<span class="text-warning d-flex gap-1 mb-3" role="img" aria-label="5 out of 5 stars"><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg><svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5 6.1 20.7l1.2-6.6L2.5 9.5l6.6-.9z"/></svg></span>
<blockquote class="fs-5 fw-semibold text-body-emphasis mb-auto lh-base">Flexible, fast and refreshingly easy to work with. Highly recommended for growing teams.</blockquote>
<div class="d-flex align-items-center gap-3 pt-3">
<img class="rounded-circle flex-shrink-0" src="https://i.pravatar.cc/112?img=25" width="48" height="48" alt="Amara Okafor">
<div>
<h3 class="h6 fw-bold mb-0 text-body-emphasis">Amara Okafor</h3>
<p class="small text-body-secondary mb-0">Founder, Brightside · London, UK</p>
</div>
</div>
</article>
</div>
</div>
</div>
</div>
</section>
/* Web Designer Wall library style — shared base for every Bootstrap 5 snippet.
Indigo accent, Plus Jakarta Sans, soft cards, pill buttons. Works in light and dark. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root,
[data-bs-theme="light"] {
--wdw-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--bs-body-font-family: var(--wdw-font);
--bs-primary: #4f46e5;
--bs-primary-rgb: 79, 70, 229;
--bs-primary-text-emphasis: #3730a3;
--bs-primary-bg-subtle: #eef2ff;
--bs-primary-border-subtle: #c7d2fe;
--bs-link-color: #4f46e5;
--bs-link-color-rgb: 79, 70, 229;
--bs-link-hover-color: #4338ca;
--bs-link-hover-color-rgb: 67, 56, 202;
--bs-focus-ring-color: rgba(79, 70, 229, 0.25);
--bs-border-radius: 0.75rem;
--bs-border-radius-lg: 1rem;
--bs-border-radius-xl: 1.25rem;
--wdw-radius-card: 1.25rem;
--wdw-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 16px 40px -16px rgba(16, 24, 40, 0.22);
--wdw-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -4px rgba(16, 24, 40, 0.12);
--wdw-stage: #f5f6fb;
}
[data-bs-theme="dark"] {
--bs-primary: #818cf8;
--bs-primary-rgb: 129, 140, 248;
--bs-primary-text-emphasis: #c7d2fe;
--bs-primary-bg-subtle: rgba(129, 140, 248, 0.14);
--bs-primary-border-subtle: rgba(129, 140, 248, 0.35);
--bs-link-color: #a5b4fc;
--bs-link-color-rgb: 165, 180, 252;
--bs-link-hover-color: #c7d2fe;
--bs-link-hover-color-rgb: 199, 210, 254;
--bs-focus-ring-color: rgba(129, 140, 248, 0.35);
--wdw-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
--wdw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
--wdw-stage: #0f1117;
}
body { font-family: var(--wdw-font); -webkit-font-smoothing: antialiased; }
/* Bootstrap compiles its blue into these components; point them at the accent. */
.btn-primary {
--bs-btn-bg: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
--bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
--bs-btn-disabled-bg: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-bg: #a5b4fc; --bs-btn-hover-border-color: #a5b4fc; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-outline-primary {
--bs-btn-color: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: var(--bs-primary); --bs-btn-hover-border-color: var(--bs-primary);
--bs-btn-active-bg: var(--bs-primary); --bs-btn-active-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn { --bs-btn-font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-sm { min-height: 36px; }
.form-control, .form-select { min-height: 44px; border-radius: .75rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--bs-primary-rgb), .6); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); }
.nav { --bs-nav-link-color: var(--bs-secondary-color); --bs-nav-link-hover-color: var(--bs-emphasis-color); }
.pagination { --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-color: var(--bs-body-color); --bs-pagination-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--bs-primary); }
.list-group { --bs-list-group-active-bg: var(--bs-primary); --bs-list-group-active-border-color: var(--bs-primary); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--bs-primary); border-radius: .875rem; box-shadow: var(--wdw-shadow-sm); }
.accordion { --bs-accordion-active-bg: var(--bs-primary-bg-subtle); --bs-accordion-active-color: var(--bs-primary-text-emphasis); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.badge { font-weight: 600; }
/* Library building blocks — use these instead of re-inventing them per snippet. */
.wdw-stage { min-height: 100vh; display: flex; align-items: center; background: var(--wdw-stage); padding-block: 3rem; }
.wdw-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: var(--wdw-radius-card); box-shadow: var(--wdw-shadow); }
.wdw-card-sm { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: 1rem; box-shadow: var(--wdw-shadow-sm); }
.wdw-aurora { position: relative; color: #fff; background: radial-gradient(60% 55% at 100% 0, #818cf8 0, transparent 70%), radial-gradient(65% 60% at 0 100%, #ec4899 0, transparent 65%), #1e1b4b; }
.wdw-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-primary); }
.wdw-heading { font-weight: 800; letter-spacing: -.02em; color: var(--bs-emphasis-color); }
.wdw-muted { color: var(--bs-secondary-color); }
.wdw-icon { width: 2.75rem; height: 2.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
/* Component */
.vc-stack { position: relative; height: 440px; max-width: 620px; margin-inline: auto; }
.vc-card { position: absolute; inset: 0 0 auto 0; height: 310px; transition: transform .6s cubic-bezier(.65,0,.35,1), opacity .6s, filter .6s; transform-origin: 50% 0; }
.vc-quote { position: absolute; top: 1rem; right: 1.25rem; color: var(--bs-primary-border-subtle); }
.vc-card[data-pos="0"] { transform: translateY(0); z-index: 5; }
.vc-card[data-pos="1"] { transform: translateY(66px) scale(.95); z-index: 4; opacity: .9; filter: blur(2px); }
.vc-card[data-pos="2"] { transform: translateY(122px) scale(.9); z-index: 3; opacity: .6; filter: blur(3px); }
.vc-card[data-pos="3"], .vc-card[data-pos="4"] { transform: translateY(140px) scale(.85); z-index: 1; opacity: 0; pointer-events: none; }
#vcPause .vc-i-play, #vcPause[aria-pressed="true"] .vc-i-pause { display: none; }
#vcPause[aria-pressed="true"] .vc-i-play { display: inline; }
@media (max-width: 575.98px) { .vc-stack { height: 440px; } .vc-card { height: 330px; } .vc-card blockquote { font-size: 1.05rem !important; } }
@media (prefers-reduced-motion: reduce) { .vc-card { transition: none; } }
@media (min-width: 992px) { .vc-card blockquote { font-size: 1.4rem !important; } }
#vcPause { --bs-btn-color: var(--bs-body-color); --bs-btn-border-color: var(--bs-border-color); }
(function () {
function initStack() {
var stack = document.getElementById('vcStack');
if (!stack) return;
var cards = Array.prototype.slice.call(stack.querySelectorAll('.vc-card'));
var prev = document.getElementById('vcPrev'), next = document.getElementById('vcNext'), toggle = document.getElementById('vcPause');
var offset = 0, timer = null, userPaused = false, hover = false;
var reduced = matchMedia('(prefers-reduced-motion: reduce)').matches;
if (reduced) userPaused = true;
function render() {
cards.forEach(function (c, i) {
var pos = (i - offset + cards.length) % cards.length;
c.dataset.pos = pos;
c.setAttribute('aria-hidden', pos === 0 ? 'false' : 'true');
});
}
function go(d) { offset = (offset + d + cards.length) % cards.length; render(); }
function stop() { clearInterval(timer); timer = null; }
function start() {
stop();
if (userPaused || hover || document.hidden) return;
timer = setInterval(function () { go(1); }, 3500);
}
function syncToggle() {
toggle.setAttribute('aria-pressed', String(userPaused));
toggle.setAttribute('aria-label', userPaused ? 'Start auto-rotation' : 'Pause auto-rotation');
stack.setAttribute('aria-live', userPaused ? 'polite' : 'off');
}
if (next) next.addEventListener('click', function () { go(1); start(); });
if (prev) prev.addEventListener('click', function () { go(-1); start(); });
if (toggle) toggle.addEventListener('click', function () { userPaused = !userPaused; syncToggle(); start(); });
var area = stack.closest('.row') || stack;
area.addEventListener('mouseenter', function () { hover = true; start(); });
area.addEventListener('mouseleave', function () { hover = false; start(); });
area.addEventListener('focusin', function () { hover = true; start(); });
area.addEventListener('focusout', function () { hover = false; start(); });
document.addEventListener('visibilitychange', start);
syncToggle(); render(); start();
}
initStack();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.