图片灯箱动画优化
- 为图片灯箱加入了从哪来回哪去的动画
This commit is contained in:
@@ -24,13 +24,19 @@
|
||||
const items = images.map((item) => ({
|
||||
...getSize(item),
|
||||
src: item.dataset.originalSrc || item.currentSrc || item.src,
|
||||
alt: item.alt
|
||||
msrc: item.currentSrc || item.src,
|
||||
alt: item.alt,
|
||||
element: item
|
||||
}));
|
||||
|
||||
lightboxPromise ??= import('photoswipe/lightbox').then(({ default: PhotoSwipeLightbox }) => {
|
||||
const lightbox = new PhotoSwipeLightbox({
|
||||
pswpModule: () => import('photoswipe'),
|
||||
bgClickAction: 'close'
|
||||
bgClickAction: 'close',
|
||||
showHideAnimationType: 'zoom',
|
||||
showAnimationDuration: 360,
|
||||
hideAnimationDuration: 300,
|
||||
easing: 'cubic-bezier(0.22, 1, 0.36, 1)'
|
||||
});
|
||||
lightbox.init();
|
||||
return lightbox;
|
||||
|
||||
Reference in New Issue
Block a user