HEX
Server: Apache
System: Linux ecngx285.inmotionhosting.com 4.18.0-553.79.1.lve.el8.x86_64 #1 SMP Wed Oct 15 17:59:35 UTC 2025 x86_64
User: zeusxp5 (3862)
PHP: 8.3.28
Disabled: NONE
Upload Files
File: /home/zeusxp5/chuair.org/wp-content/plugins/wd-framework/js/PhotoSwipeLightbox.js
/* ###############################  
          PhotoSwipe v5
##################################  */

import PhotoSwipeLightbox from './photoswipe-lightbox.esm.js'
import PhotoSwipe from './photoswipe.esm.js'

document.addEventListener('DOMContentLoaded', init)
function init() {
  const photo_swipe_options = {
    gallery: '.images-gallery-swiper2',
    children: 'a',
    loop: true,
    showHideAnimationType: 'zoom', /* options: fade, zoom, none */
    // zoom: false,
    initialZoomLevel: 'fit',
    secondaryZoomLevel: 1.5,
    maxZoomLevel: 1,
    close: true,
    arrowKeys: true,
    /* ## Options ## */
    bgOpacity: 0.9,/* deafult: 0.8 */
    wheelToZoom: true, /* deafult: undefined */
    counter: false,
    pswpModule: PhotoSwipe,
  }
  if (typeof productImagesGallerySwiper2Array !== 'undefined' && image_array.length > 0) {
  productImagesGallerySwiper2Array.forEach( productImagesGallerySwiper2 => {
    const lightbox = new PhotoSwipeLightbox(photo_swipe_options)
    
    lightbox.init()
    
    lightbox.on('change', () => {
      const { pswp } = lightbox
      productImagesGallerySwiper2.slideTo(pswp.currIndex, 0, false)
    })
    
    lightbox.on('afterInit', () => {
      const { pswp } = lightbox
      if(productImagesGallerySwiper2.params.autoplay.enabled){
        productImagesGallerySwiper2.autoplay.stop()
      }
    })
    
    lightbox.on('closingAnimationStart', () => {
      const { pswp } = lightbox
      productImagesGallerySwiper2.slideTo(pswp.currIndex, 0, false);
      /* if autoplay enabled == true -> autoplay.start() when close lightbox */
      if(productImagesGallerySwiper2.params.autoplay.enabled){
        productImagesGallerySwiper2.autoplay.start()
      }
    })
    
  } )
}
  /************************** images stack gallery zoom *********************************/
  const stackLightbox = new PhotoSwipeLightbox( {
    gallery:'.images-gallery-stack',
    children:'a',
  
    initialZoomLevel: 'fit',
    secondaryZoomLevel: 1.5,
    maxZoomLevel: 2,
    preload: [1, 1],
  
    pswpModule: PhotoSwipe
  } )
  
  stackLightbox.init()
}