diff --git a/demo/configurator.ts b/demo/configurator.ts
index 821fcbc..a6f8368 100644
--- a/demo/configurator.ts
+++ b/demo/configurator.ts
@@ -23,6 +23,7 @@ export function initConfigurator(): void {
const cfgAutoplay = document.getElementById('cfg-autoplay') as HTMLInputElement
const cfgCycle = document.getElementById('cfg-cycle') as HTMLInputElement
const cfgCoverflow = document.getElementById('cfg-coverflow') as HTMLInputElement
+ const cfgTransparentBg = document.getElementById('cfg-transparent-bg') as HTMLInputElement
const cfgTheme = document.getElementById('cfg-theme') as HTMLSelectElement
const cfgTransition = document.getElementById('cfg-transition') as HTMLSelectElement
const cfgControlsPosition = document.getElementById('cfg-controls-position') as HTMLSelectElement
@@ -42,8 +43,9 @@ export function initConfigurator(): void {
autoplay: cfgAutoplay.checked,
cycle: cfgCycle.checked,
showCoverflow: cfgCoverflow.checked,
+ transparentBackground: cfgTransparentBg.checked,
theme: cfgTheme.value as 'light' | 'dark',
- transitionEffect: cfgTransition.value as 'fade' | 'slide' | 'zoom' | 'flip',
+ transitionEffect: cfgTransition.value as 'fade' | 'slide' | 'zoom' | 'flip' | 'overlap',
controlsPosition: cfgControlsPosition.value as 'center' | 'bottom',
zoomMin: parseFloat(cfgZoomMin.value),
zoomMax: parseFloat(cfgZoomMax.value),
@@ -61,6 +63,7 @@ export function initConfigurator(): void {
if (config.autoplay) opts.push(` autoplay: true,`)
if (!config.cycle) opts.push(` cycle: false,`)
if (config.showCoverflow) opts.push(` showCoverflow: true,`)
+ if (config.transparentBackground) opts.push(` transparentBackground: true,`)
if (config.theme !== 'light') opts.push(` theme: '${config.theme}',`)
if (config.transitionEffect !== 'fade') opts.push(` transitionEffect: '${config.transitionEffect}',`)
if (config.controlsPosition !== 'center') opts.push(` controlsPosition: '${config.controlsPosition}',`)
@@ -78,6 +81,9 @@ export function initConfigurator(): void {
const posLabel = cfgControlsPosition.closest('label') as HTMLElement
posLabel.style.display = cfgControls.checked ? '' : 'none'
+ // Reveal a checkerboard behind the carousel so transparency is visible
+ viewerEl!.classList.toggle('is-transparent-preview', config.transparentBackground === true)
+
// Destroy and recreate (carousel doesn't have an update() method)
if (instance) {
viewerEl!.style.minHeight = `${viewerEl!.offsetHeight}px`
@@ -105,8 +111,8 @@ export function initConfigurator(): void {
}
// Bind all controls to rebuild
- ;[cfgThumbnails, cfgBullets, cfgControls, cfgFilenames, cfgAutoplay, cfgCycle, cfgCoverflow].forEach((el) =>
- el.addEventListener('change', rebuild),
+ ;[cfgThumbnails, cfgBullets, cfgControls, cfgFilenames, cfgAutoplay, cfgCycle, cfgCoverflow, cfgTransparentBg].forEach(
+ (el) => el.addEventListener('change', rebuild),
)
;[cfgTheme, cfgTransition, cfgControlsPosition].forEach((el) => el.addEventListener('change', rebuild))
;[cfgZoomMin, cfgZoomMax, cfgZoomStep].forEach((el) => el.addEventListener('change', rebuild))
diff --git a/demo/demo.css b/demo/demo.css
index 7701d9c..b6a14aa 100644
--- a/demo/demo.css
+++ b/demo/demo.css
@@ -799,6 +799,19 @@ p code {
border-radius: var(--demo-radius-sm);
}
+/* Checkerboard backdrop — only shown while the transparent-background option is
+ on, so the see-through effect is obvious in the preview. */
+#configurator-carousel.is-transparent-preview {
+ background-image:
+ linear-gradient(45deg, rgba(0, 0, 0, 0.08) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.08) 75%),
+ linear-gradient(45deg, rgba(0, 0, 0, 0.08) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.08) 75%);
+ background-size: 24px 24px;
+ background-position:
+ 0 0,
+ 12px 12px;
+ border-radius: 16px;
+}
+
.demo-configurator-panel {
display: flex;
flex-direction: column;
diff --git a/demo/demo.ts b/demo/demo.ts
index bd42b6e..97cc61a 100644
--- a/demo/demo.ts
+++ b/demo/demo.ts
@@ -134,6 +134,18 @@ new CloudImageCarousel('#transition-flip', {
showBullets: true,
}).init()
+// ==========================================================================
+// Transition: overlap (cover) — drag to navigate
+// ==========================================================================
+
+new CloudImageCarousel('#transition-overlap', {
+ images: DEMO_IMAGES,
+ transitionEffect: 'overlap',
+ cycle: true,
+ showThumbnails: false,
+ showBullets: true,
+}).init()
+
// ==========================================================================
// Zoom: default config
// ==========================================================================
diff --git a/demo/index.html b/demo/index.html
index 42ee29b..9bdb940 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -321,7 +321,7 @@
Bottom
@@ -360,6 +360,15 @@
Flip
+
@@ -456,6 +465,10 @@ Options
Coverflow
+