Canvas

Glass Slideshow

A slideshow component featuring organic glass bubble transitions with refraction and chromatic aberration.


Installation

Install the component

Run the following command to install the component and its dependencies:
npx @motion-core/cli add glass-slideshow

Import the component

Import the component into your Svelte file:
import { GlassSlideshow } from "$lib/motion-core";
import { GlassSlideshow } from "$lib/motion-core";

Usage

Props

2000ms
1.000
1.000
1.000
1.000
5000ms
<script lang="ts">
	import { GlassSlideshow } from "motion-core";
	import type { ComponentProps } from "svelte";

	type Props = Partial<ComponentProps<typeof GlassSlideshow>>;

	const images = [
		"/images/demos/sample-7.jpg",
		"/images/demos/sample-5.jpg",
		"/images/demos/sample-4.jpg",
	];

	let {
		transitionDuration = 2000,
		intensity = 1,
		distortion = 1,
		chromaticAberration = 1,
		refraction = 1,
		autoplay = true,
		autoplayInterval = 5000,
	}: Props = $props();
</script>

<GlassSlideshow
	class="h-full min-h-96 w-full"
	{images}
	{transitionDuration}
	{intensity}
	{distortion}
	{chromaticAberration}
	{refraction}
	{autoplay}
	{autoplayInterval}
/>

Props

GlassSlideshow

PropTypeDefault
images
string[]
index
number 0
transitionDuration
number 2000
intensity
number 1.0
distortion
number 1.0
chromaticAberration
number 1.0
refraction
number 1.0
autoplay
boolean true
autoplayInterval
number 5000
class
string ""