1 2let splide_slideshow = { 3 4 init: () => { 5 let $slideshow = $('.slideshow.splide').first() 6 7 // hacky way to ensure it doesn't run 8 // dynamic_modules_fallback loads all modules 9 // disregarding conditions from galleries_js_modules 10 if (!$slideshow.length) return; 11 12 let interval = $slideshow.data('splide-interval') 13 let custom_pagination = $slideshow.hasClass('pagination_gallery_locations'); 14 let show_arrows = $slideshow.hasClass('show-arrows') 15 16 let splide_options = { 17 interval: interval, //ms 18 arrows: show_arrows, 19 } 20 21 if ($slideshow.hasClass('fullscreen_vertical')){ 22 $('body').addClass('type-fullscreen'); 23 splide_options = { 24 ...splide_options, 25 type: 'slide', 26 direction : 'ttb', 27 height: '100vh', 28 wheel : true, 29 releaseWheel: true, 30 waitForTransition: true, 31 speed: 700, 32 } 33 } else { 34 splide_options = { 35 ...splide_options, 36 type: 'fade', 37 rewind: true, 38 pauseOnHover: false, 39 autoplay: true, 40 } 41 } 42 43 let splide = new Splide( '.slideshow', splide_options); 44 45 if (custom_pagination) { 46 let locations = $slideshow.data('custom-pagination').split(',') 47 splide.on( 'pagination:mounted', function ( data ) { 48 data.items.forEach( function ( item ) { 49 item.button.textContent = String( locations[item.page] ); 50 }); 51 }); 52 } 53 54 if ($slideshow.hasClass('fullscreen') && !$slideshow.hasClass('split')){ 55 splide.on('active', function(data) { 56 if (data.slide.classList.contains('fullscreen-slide-image-light')){ 57 $slideshow.addClass('slide-light') 58 $('body').addClass('fullscreen-slide-light') 59 $slideshow.removeClass('slide-dark') 60 $('body').removeClass('fullscreen-slide-dark') 61 } else if (data.slide.classList.contains('fullscreen-slide-image-dark')) { 62 $slideshow.addClass('slide-dark') 63 $('body').addClass('fullscreen-slide-dark') 64 $slideshow.removeClass('slide-light') 65 $('body').removeClass('fullscreen-slide-light') 66 } else { 67 $slideshow.addClass('slide-dark') 68 $('body').addClass('fullscreen-slide-dark') 69 $slideshow.removeClass('slide-light') 70 $('body').removeClass('fullscreen-slide-light') 71 } 72 }) 73 } 74 75 splide.mount(); 76 } 77} 78 79window.galleries = window.galleries || {}; 80window.galleries.splide_slideshow = splide_slideshow; 81export default splide_slideshow;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.