Well, I have used in my project ImageGallery library and everything works well, although there is one annoying thing. If I want to fast slide between images in component, I need to wait image_count*each_image_slideDuration. IS it possible to ignore slideDuration animation (not remove it), so if user want to slide between images fast, he doesn`t need to wait when animation ends for one image to slide to another.
Now, I can handle when animation ends and starts, maybe it can help:
<ImageGallery
startIndex={this.state.currentFileIndex}
stopPropagation={false}
useBrowserFullscreen={false}
showThumbnails={showThumbnails && !isMobile && files.length > 1}
renderThumbInner={(data) => {
const { isVideo, original, thumbnail } = data;
if (!isVideo || thumbnail) {
return (
<div className="image-gallery-thumbnail-inner">
<img
className="image-gallery-thumbnail-image"
src={thumbnail || original}
alt={SeoConfig(pp, ATTRIBUTE.alt)}
title={SeoConfig(pp, ATTRIBUTE.imgTitle)}
loading="lazy"
height="56"
/>
</div>
);
}
return (
<div className="image-gallery-thumbnail-inner">
<video width="128" height="98">
<source src={original} type="video/webm" />
<source src={original} type="video/mp4" />
</video>
</div>
);
}}
items={files}
onSlide={(currentIndex) => {
this.handleFileSwitch(currentIndex);
console.log(`Animation ${this.imageGallery.slideDuration}ms`);
setTimeout(() => {
console.log('Animation is done');
}, this.imageGallery.slideDuration);
}}
onBeforeSlide={() => {
console.log('Animation started');
}}
disableSwipe={isMobile && isPanorama}
slideInterval={2000}
slideDuration={380}
onScreenChange={this.toggleFullScreen}
showNav={!isMobile || (isMobile && isPanorama)}
onClick={this.handleFullScreen}
ref={(ref) => {
this.imageGallery = ref;
}}
/>
Ignoring the animation I want to also on mobile (when swiping), and when sliding with arrows (showNav props)