FormidableLabs / nuka-carousel

Small, fast, and accessibility-first React carousel library with an easily customizable UI and behavior to fit your brand and site.
https://commerce.nearform.com/open-source/nuka-carousel
Other
2.99k stars 594 forks source link

Can we achieve a crossfade effect between slides when animation="fade"? #1038

Open henrybabbage opened 7 months ago

henrybabbage commented 7 months ago

Bugs and Questions

Prerequisites

Describe Your Environment

Describe the Problem

Not a bug per se, I would just like to ask how I can achieve a "cross-fade" effect when the animation prop is set to "fade"? Currently, when changing slides with the animation prop set to "fade", we see the current image disappear, a flash of the background behind where the image was, and then the next image appear. Swiper slider has a crossfade prop for example, so that the current image fades out and the next image fades in at the same time. Could this effect be achieved another way with the Nuka Carousel?

Here is a StackBlitz example with Nuka.

Here is an example of what I am trying to achieve (Swiper in this example).

Expected behavior:

animation="fade"

Images fade over the top of one another.

Actual behavior

One image fades out. The background is momentarily visible. Then the next image fades in.

Thank you very much for your time.

Andrewryanhyde commented 6 months ago

+1