import './bootstrap'; import PhotoSwipeLightbox from 'photoswipe/lightbox'; import * as FilePond from 'filepond'; import FilePondPluginImageExifOrientation from 'filepond-plugin-image-exif-orientation'; import FilePondPluginImagePreview from 'filepond-plugin-image-preview'; import FilePondPluginFileValidateSize from 'filepond-plugin-file-validate-size'; import FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type'; FilePond.registerPlugin(FilePondPluginImageExifOrientation); FilePond.registerPlugin(FilePondPluginImagePreview); FilePond.registerPlugin(FilePondPluginFileValidateSize); FilePond.registerPlugin(FilePondPluginFileValidateType); window.FilePond = FilePond; document.addEventListener('alpine:init', () => { Alpine.store('uploader', { states: {}, setState(state, value) { this.states[state] = value; }, }); }); const lightbox = new PhotoSwipeLightbox({ gallery: '#album', children: 'a', bgOpacity: 1, arrowPrevSVG: '', arrowNextSVG: '', closeSVG: '
', zoomSVG: '', pswpModule: () => import('photoswipe') }); lightbox.on('uiRegister', function() { lightbox.pswp.ui.registerElement({ name: 'download-button', order: 9, isButton: true, tagName: 'button', html: '', onInit: (el, pswp) => { el.setAttribute('download', ''); el.setAttribute('target', '_blank'); el.setAttribute('rel', 'noopener'); pswp.on('change', () => { el.href = pswp.currSlide.data.element.dataset.pswpDownload; }); } }); lightbox.pswp.ui.registerElement({ name: 'rotate-button-clk', ariaLabel: 'Rotate clockwise', order: 8, isButton: true, html: '', onClick: (event, el) => { // Rotate } }); lightbox.pswp.ui.registerElement({ name: 'rotate-button-cclk', ariaLabel: 'Rotate counter-clockwise', order: 7, isButton: true, html: '', onClick: (event, el) => { // Rotate } }); }); lightbox.init();