lightgallery 2.9.0 → 3.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +690 -0
- package/README.md +31 -21
- package/dist/README.md +229 -0
- package/{css → dist/css}/lg-autoplay.css +7 -4
- package/{css → dist/css}/lg-autoplay.css.map +1 -1
- package/{css → dist/css}/lg-comments.css +0 -6
- package/{css → dist/css}/lg-comments.css.map +1 -1
- package/dist/css/lg-fullscreen.css +11 -0
- package/dist/css/lg-fullscreen.css.map +1 -0
- package/dist/css/lg-justified.css +37 -0
- package/dist/css/lg-justified.css.map +1 -0
- package/{css → dist/css}/lg-pager.css.map +1 -1
- package/{css → dist/css}/lg-rotate.css +0 -16
- package/{css → dist/css}/lg-rotate.css.map +1 -1
- package/dist/css/lg-rtl.css +94 -0
- package/dist/css/lg-rtl.css.map +1 -0
- package/{css → dist/css}/lg-share.css +4 -32
- package/dist/css/lg-share.css.map +1 -0
- package/{css → dist/css}/lg-thumbnail.css +7 -3
- package/dist/css/lg-thumbnail.css.map +1 -0
- package/{css → dist/css}/lg-transitions.css +10 -0
- package/dist/css/lg-transitions.css.map +1 -0
- package/{css → dist/css}/lg-zoom.css +20 -9
- package/dist/css/lg-zoom.css.map +1 -0
- package/{css → dist/css}/lightgallery-bundle.css +150 -118
- package/dist/css/lightgallery-bundle.css.map +1 -0
- package/dist/css/lightgallery-bundle.min.css +1 -0
- package/{css → dist/css}/lightgallery-core.css +49 -7
- package/dist/css/lightgallery-core.css.map +1 -0
- package/{css → dist/css}/lightgallery.css +105 -44
- package/dist/css/lightgallery.css.map +1 -0
- package/dist/lightgallery.es5.js +3848 -0
- package/dist/lightgallery.es5.js.map +1 -0
- package/dist/lightgallery.min.js +1 -0
- package/dist/lightgallery.umd.js +3851 -0
- package/dist/lightgallery.umd.js.map +1 -0
- package/dist/package.json +33 -0
- package/dist/plugins/autoplay/lg-autoplay.es5.js +193 -0
- package/dist/plugins/autoplay/lg-autoplay.es5.js.map +1 -0
- package/dist/plugins/autoplay/lg-autoplay.min.js +1 -0
- package/dist/plugins/autoplay/lg-autoplay.umd.js +196 -0
- package/dist/plugins/autoplay/lg-autoplay.umd.js.map +1 -0
- package/dist/plugins/autoplay/package.json +7 -0
- package/dist/plugins/comment/lg-comment.es5.js +136 -0
- package/dist/plugins/comment/lg-comment.es5.js.map +1 -0
- package/dist/plugins/comment/lg-comment.min.js +1 -0
- package/dist/plugins/comment/lg-comment.umd.js +139 -0
- package/dist/plugins/comment/lg-comment.umd.js.map +1 -0
- package/dist/plugins/comment/package.json +7 -0
- package/dist/plugins/fullscreen/lg-fullscreen.es5.js +114 -0
- package/dist/plugins/fullscreen/lg-fullscreen.es5.js.map +1 -0
- package/dist/plugins/fullscreen/lg-fullscreen.min.js +1 -0
- package/dist/plugins/fullscreen/lg-fullscreen.umd.js +117 -0
- package/dist/plugins/fullscreen/lg-fullscreen.umd.js.map +1 -0
- package/dist/plugins/fullscreen/package.json +7 -0
- package/dist/plugins/hash/lg-hash.es5.js +207 -0
- package/dist/plugins/hash/lg-hash.es5.js.map +1 -0
- package/dist/plugins/hash/lg-hash.min.js +1 -0
- package/dist/plugins/hash/lg-hash.umd.js +210 -0
- package/dist/plugins/hash/lg-hash.umd.js.map +1 -0
- package/dist/plugins/hash/package.json +7 -0
- package/dist/plugins/justified/lg-justified.es5.js +415 -0
- package/dist/plugins/justified/lg-justified.es5.js.map +1 -0
- package/dist/plugins/justified/lg-justified.min.js +1 -0
- package/dist/plugins/justified/lg-justified.umd.js +418 -0
- package/dist/plugins/justified/lg-justified.umd.js.map +1 -0
- package/dist/plugins/justified/package.json +7 -0
- package/dist/plugins/mediumZoom/lg-medium-zoom.es5.js +95 -0
- package/dist/plugins/mediumZoom/lg-medium-zoom.es5.js.map +1 -0
- package/dist/plugins/mediumZoom/lg-medium-zoom.min.js +1 -0
- package/dist/plugins/mediumZoom/lg-medium-zoom.umd.js +98 -0
- package/dist/plugins/mediumZoom/lg-medium-zoom.umd.js.map +1 -0
- package/dist/plugins/mediumZoom/package.json +7 -0
- package/dist/plugins/originCrop/lg-origin-crop.es5.js +622 -0
- package/dist/plugins/originCrop/lg-origin-crop.es5.js.map +1 -0
- package/dist/plugins/originCrop/lg-origin-crop.min.js +1 -0
- package/dist/plugins/originCrop/lg-origin-crop.umd.js +625 -0
- package/dist/plugins/originCrop/lg-origin-crop.umd.js.map +1 -0
- package/dist/plugins/pager/lg-pager.es5.js +96 -0
- package/dist/plugins/pager/lg-pager.es5.js.map +1 -0
- package/dist/plugins/pager/lg-pager.min.js +1 -0
- package/dist/plugins/pager/lg-pager.umd.js +99 -0
- package/dist/plugins/pager/lg-pager.umd.js.map +1 -0
- package/dist/plugins/pager/package.json +7 -0
- package/dist/plugins/relativeCaption/lg-relative-caption.es5.js +98 -0
- package/dist/plugins/relativeCaption/lg-relative-caption.es5.js.map +1 -0
- package/dist/plugins/relativeCaption/lg-relative-caption.min.js +1 -0
- package/dist/plugins/relativeCaption/lg-relative-caption.umd.js +101 -0
- package/dist/plugins/relativeCaption/lg-relative-caption.umd.js.map +1 -0
- package/dist/plugins/relativeCaption/package.json +7 -0
- package/dist/plugins/rotate/lg-rotate.es5.js +226 -0
- package/dist/plugins/rotate/lg-rotate.es5.js.map +1 -0
- package/dist/plugins/rotate/lg-rotate.min.js +1 -0
- package/dist/plugins/rotate/lg-rotate.umd.js +229 -0
- package/dist/plugins/rotate/lg-rotate.umd.js.map +1 -0
- package/dist/plugins/rotate/package.json +7 -0
- package/dist/plugins/share/lg-share.es5.js +309 -0
- package/dist/plugins/share/lg-share.es5.js.map +1 -0
- package/dist/plugins/share/lg-share.min.js +1 -0
- package/dist/plugins/share/lg-share.umd.js +312 -0
- package/dist/plugins/share/lg-share.umd.js.map +1 -0
- package/dist/plugins/share/package.json +7 -0
- package/dist/plugins/thumbnail/lg-thumbnail.es5.js +792 -0
- package/dist/plugins/thumbnail/lg-thumbnail.es5.js.map +1 -0
- package/dist/plugins/thumbnail/lg-thumbnail.min.js +1 -0
- package/dist/plugins/thumbnail/lg-thumbnail.umd.js +795 -0
- package/dist/plugins/thumbnail/lg-thumbnail.umd.js.map +1 -0
- package/dist/plugins/thumbnail/package.json +7 -0
- package/dist/plugins/video/lg-video.es5.js +518 -0
- package/dist/plugins/video/lg-video.es5.js.map +1 -0
- package/dist/plugins/video/lg-video.min.js +1 -0
- package/dist/plugins/video/lg-video.umd.js +521 -0
- package/dist/plugins/video/lg-video.umd.js.map +1 -0
- package/dist/plugins/video/package.json +7 -0
- package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js +72 -0
- package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js.map +1 -0
- package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js +1 -0
- package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js +75 -0
- package/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js.map +1 -0
- package/dist/plugins/vimeoThumbnail/package.json +7 -0
- package/dist/plugins/zoom/lg-zoom.es5.js +1412 -0
- package/dist/plugins/zoom/lg-zoom.es5.js.map +1 -0
- package/dist/plugins/zoom/lg-zoom.min.js +1 -0
- package/dist/plugins/zoom/lg-zoom.umd.js +1415 -0
- package/dist/plugins/zoom/lg-zoom.umd.js.map +1 -0
- package/dist/plugins/zoom/package.json +7 -0
- package/{scss → dist/scss}/_lg-theme-default.scss +68 -18
- package/{scss → dist/scss}/_lg-variables.scss +0 -1
- package/{scss → dist/scss}/lg-autoplay.scss +10 -4
- package/{scss → dist/scss}/lg-comments.scss +0 -8
- package/dist/scss/lg-fullscreen.scss +15 -0
- package/dist/scss/lg-justified.scss +63 -0
- package/{scss → dist/scss}/lg-rotate.scss +0 -24
- package/dist/scss/lg-rtl.scss +145 -0
- package/{scss → dist/scss}/lg-share.scss +6 -33
- package/{scss → dist/scss}/lg-thumbnail.scss +16 -5
- package/{scss → dist/scss}/lg-zoom.scss +46 -9
- package/{scss → dist/scss}/lightgallery-bundle.scss +0 -1
- package/{scss → dist/scss}/lightgallery-core.scss +73 -6
- package/{scss → dist/scss}/lightgallery.scss +0 -1
- package/{scss → dist/scss}/transitions/_lg-scale-up.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-slide-circular-vertical.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-slide-circular.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-soft-zoom.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-zoom-in-big.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-zoom-in-out.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-zoom-in.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-zoom-out-big.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-zoom-out-in.scss +6 -0
- package/{scss → dist/scss}/transitions/_lg-zoom-out.scss +6 -0
- package/{index.d.ts → dist/types/index.d.ts} +8 -4
- package/{lg-events.d.ts → dist/types/lg-events.d.ts} +300 -300
- package/dist/types/lg-icons.d.ts +27 -0
- package/{lg-plugin.d.ts → dist/types/lg-plugin.d.ts} +7 -7
- package/{lg-settings.d.ts → dist/types/lg-settings.d.ts} +555 -425
- package/dist/types/lg-spring-runner.d.ts +14 -0
- package/dist/types/lg-toolbar-overflow.d.ts +36 -0
- package/{lg-utils.d.ts → dist/types/lg-utils.d.ts} +236 -228
- package/{lgQuery.d.ts → dist/types/lgQuery.d.ts} +56 -56
- package/{lightgallery.d.ts → dist/types/lightgallery.d.ts} +385 -305
- package/{plugins → dist/types/plugins}/autoplay/lg-autoplay-settings.d.ts +41 -38
- package/{plugins → dist/types/plugins}/autoplay/lg-autoplay.d.ts +22 -22
- package/{plugins → dist/types/plugins}/comment/lg-comment-settings.d.ts +36 -33
- package/{plugins → dist/types/plugins}/comment/lg-comment.d.ts +25 -25
- package/{plugins → dist/types/plugins}/fullscreen/lg-fullscreen-settings.d.ts +17 -14
- package/{plugins → dist/types/plugins}/fullscreen/lg-fullscreen.d.ts +16 -16
- package/dist/types/plugins/hash/lg-hash-settings.d.ts +28 -0
- package/{plugins → dist/types/plugins}/hash/lg-hash.d.ts +25 -23
- package/dist/types/plugins/justified/lg-justified-settings.d.ts +42 -0
- package/dist/types/plugins/justified/lg-justified.d.ts +55 -0
- package/{plugins → dist/types/plugins}/mediumZoom/lg-medium-zoom-settings.d.ts +16 -16
- package/{plugins → dist/types/plugins}/mediumZoom/lg-medium-zoom.d.ts +12 -12
- package/dist/types/plugins/originCrop/lg-origin-crop-settings.d.ts +12 -0
- package/dist/types/plugins/originCrop/lg-origin-crop.d.ts +79 -0
- package/{plugins → dist/types/plugins}/pager/lg-pager-settings.d.ts +7 -7
- package/{plugins → dist/types/plugins}/pager/lg-pager.d.ts +13 -13
- package/{plugins → dist/types/plugins}/relativeCaption/lg-relative-caption-settings.d.ts +7 -7
- package/{plugins → dist/types/plugins}/relativeCaption/lg-relative-caption.d.ts +14 -14
- package/{plugins → dist/types/plugins}/rotate/lg-rotate-settings.d.ts +47 -45
- package/{plugins → dist/types/plugins}/rotate/lg-rotate.d.ts +25 -24
- package/{plugins → dist/types/plugins}/share/lg-fb-share-utils.d.ts +2 -2
- package/{plugins → dist/types/plugins}/share/lg-pinterest-share-utils.d.ts +2 -2
- package/{plugins → dist/types/plugins}/share/lg-share-settings.d.ts +71 -56
- package/dist/types/plugins/share/lg-share.d.ts +33 -0
- package/dist/types/plugins/share/lg-twitter-share-utils.d.ts +4 -0
- package/{plugins → dist/types/plugins}/share/types.d.ts +6 -6
- package/{plugins → dist/types/plugins}/thumbnail/lg-thumbnail-settings.d.ts +85 -70
- package/dist/types/plugins/thumbnail/lg-thumbnail.d.ts +88 -0
- package/{plugins → dist/types/plugins}/video/lg-video-settings.d.ts +94 -71
- package/{plugins → dist/types/plugins}/video/lg-video.d.ts +116 -104
- package/{plugins → dist/types/plugins}/video/types.d.ts +8 -8
- package/{plugins → dist/types/plugins}/vimeoThumbnail/lg-vimeo-thumbnail-settings.d.ts +11 -11
- package/{plugins → dist/types/plugins}/vimeoThumbnail/lg-vimeo-thumbnail.d.ts +14 -14
- package/{plugins → dist/types/plugins}/zoom/lg-zoom-settings.d.ts +54 -51
- package/{plugins → dist/types/plugins}/zoom/lg-zoom.d.ts +145 -108
- package/{types.d.ts → dist/types/types.d.ts} +40 -40
- package/package.json +237 -8
- package/angular/10/README.md +0 -24
- package/angular/10/bundles/lightgallery-angular-10.umd.js +0 -289
- package/angular/10/bundles/lightgallery-angular-10.umd.js.map +0 -1
- package/angular/10/bundles/lightgallery-angular-10.umd.min.js +0 -2
- package/angular/10/bundles/lightgallery-angular-10.umd.min.js.map +0 -1
- package/angular/10/esm2015/lib/lightgallery-angular.component.js +0 -225
- package/angular/10/esm2015/lib/lightgallery-angular.module.js +0 -17
- package/angular/10/esm2015/lib/lightgallery-angular.service.js +0 -14
- package/angular/10/esm2015/lightgallery-angular-10.js +0 -5
- package/angular/10/esm2015/public-api.js +0 -7
- package/angular/10/fesm2015/lightgallery-angular-10.js +0 -261
- package/angular/10/fesm2015/lightgallery-angular-10.js.map +0 -1
- package/angular/10/lib/lightgallery-angular.component.d.ts +0 -39
- package/angular/10/lib/lightgallery-angular.component.d.ts.map +0 -1
- package/angular/10/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/10/lib/lightgallery-angular.module.d.ts.map +0 -1
- package/angular/10/lib/lightgallery-angular.service.d.ts +0 -7
- package/angular/10/lib/lightgallery-angular.service.d.ts.map +0 -1
- package/angular/10/lightgallery-angular-10.d.ts +0 -6
- package/angular/10/lightgallery-angular-10.d.ts.map +0 -1
- package/angular/10/package.json +0 -21
- package/angular/10/public-api.d.ts +0 -4
- package/angular/10/public-api.d.ts.map +0 -1
- package/angular/11/README.md +0 -24
- package/angular/11/bundles/lightgallery-angular-11.umd.js +0 -290
- package/angular/11/bundles/lightgallery-angular-11.umd.js.map +0 -1
- package/angular/11/bundles/lightgallery-angular-11.umd.min.js +0 -2
- package/angular/11/bundles/lightgallery-angular-11.umd.min.js.map +0 -1
- package/angular/11/esm2015/lib/lightgallery-angular.component.js +0 -225
- package/angular/11/esm2015/lib/lightgallery-angular.module.js +0 -18
- package/angular/11/esm2015/lib/lightgallery-angular.service.js +0 -14
- package/angular/11/esm2015/lightgallery-angular-11.js +0 -5
- package/angular/11/esm2015/public-api.js +0 -7
- package/angular/11/fesm2015/lightgallery-angular-11.js +0 -262
- package/angular/11/fesm2015/lightgallery-angular-11.js.map +0 -1
- package/angular/11/lib/lightgallery-angular.component.d.ts +0 -39
- package/angular/11/lib/lightgallery-angular.component.d.ts.map +0 -1
- package/angular/11/lib/lightgallery-angular.module.d.ts +0 -8
- package/angular/11/lib/lightgallery-angular.module.d.ts.map +0 -1
- package/angular/11/lib/lightgallery-angular.service.d.ts +0 -7
- package/angular/11/lib/lightgallery-angular.service.d.ts.map +0 -1
- package/angular/11/lightgallery-angular-11.d.ts +0 -6
- package/angular/11/lightgallery-angular-11.d.ts.map +0 -1
- package/angular/11/package.json +0 -21
- package/angular/11/public-api.d.ts +0 -4
- package/angular/11/public-api.d.ts.map +0 -1
- package/angular/12/README.md +0 -24
- package/angular/12/bundles/lightgallery-angular-12.umd.js +0 -296
- package/angular/12/bundles/lightgallery-angular-12.umd.js.map +0 -1
- package/angular/12/esm2015/lib/lightgallery-angular.component.js +0 -221
- package/angular/12/esm2015/lib/lightgallery-angular.module.js +0 -17
- package/angular/12/esm2015/lib/lightgallery-angular.service.js +0 -14
- package/angular/12/esm2015/lightgallery-angular-12.js +0 -5
- package/angular/12/esm2015/public-api.js +0 -7
- package/angular/12/fesm2015/lightgallery-angular-12.js +0 -258
- package/angular/12/fesm2015/lightgallery-angular-12.js.map +0 -1
- package/angular/12/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/12/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/12/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/12/lightgallery-angular-12.d.ts +0 -5
- package/angular/12/package.json +0 -18
- package/angular/12/public-api.d.ts +0 -3
- package/angular/13/README.md +0 -24
- package/angular/13/esm2020/lib/lightgallery-angular.component.mjs +0 -221
- package/angular/13/esm2020/lib/lightgallery-angular.module.mjs +0 -17
- package/angular/13/esm2020/lib/lightgallery-angular.service.mjs +0 -14
- package/angular/13/esm2020/lightgallery-angular-13.mjs +0 -5
- package/angular/13/esm2020/public-api.mjs +0 -7
- package/angular/13/fesm2015/lightgallery-angular-13.mjs +0 -258
- package/angular/13/fesm2015/lightgallery-angular-13.mjs.map +0 -1
- package/angular/13/fesm2020/lightgallery-angular-13.mjs +0 -258
- package/angular/13/fesm2020/lightgallery-angular-13.mjs.map +0 -1
- package/angular/13/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/13/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/13/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/13/lightgallery-angular-13.d.ts +0 -5
- package/angular/13/package.json +0 -31
- package/angular/13/public-api.d.ts +0 -3
- package/angular/14/README.md +0 -24
- package/angular/14/esm2020/lib/lightgallery-angular.component.mjs +0 -217
- package/angular/14/esm2020/lib/lightgallery-angular.module.mjs +0 -17
- package/angular/14/esm2020/lib/lightgallery-angular.service.mjs +0 -14
- package/angular/14/esm2020/lightgallery-angular-14.mjs +0 -5
- package/angular/14/esm2020/public-api.mjs +0 -7
- package/angular/14/fesm2015/lightgallery-angular-14.mjs +0 -254
- package/angular/14/fesm2015/lightgallery-angular-14.mjs.map +0 -1
- package/angular/14/fesm2020/lightgallery-angular-14.mjs +0 -254
- package/angular/14/fesm2020/lightgallery-angular-14.mjs.map +0 -1
- package/angular/14/index.d.ts +0 -5
- package/angular/14/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/14/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/14/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/14/package.json +0 -31
- package/angular/14/public-api.d.ts +0 -3
- package/angular/15/README.md +0 -24
- package/angular/15/esm2022/lib/lightgallery-angular.component.mjs +0 -218
- package/angular/15/esm2022/lib/lightgallery-angular.module.mjs +0 -18
- package/angular/15/esm2022/lib/lightgallery-angular.service.mjs +0 -15
- package/angular/15/esm2022/lightgallery-angular-15.mjs +0 -5
- package/angular/15/esm2022/public-api.mjs +0 -7
- package/angular/15/fesm2022/lightgallery-angular-15.mjs +0 -254
- package/angular/15/fesm2022/lightgallery-angular-15.mjs.map +0 -1
- package/angular/15/index.d.ts +0 -5
- package/angular/15/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/15/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/15/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/15/package.json +0 -25
- package/angular/15/public-api.d.ts +0 -3
- package/angular/16/README.md +0 -24
- package/angular/16/esm2022/lib/lightgallery-angular.component.mjs +0 -218
- package/angular/16/esm2022/lib/lightgallery-angular.module.mjs +0 -18
- package/angular/16/esm2022/lib/lightgallery-angular.service.mjs +0 -15
- package/angular/16/esm2022/lightgallery-angular-16.mjs +0 -5
- package/angular/16/esm2022/public-api.mjs +0 -7
- package/angular/16/fesm2022/lightgallery-angular-16.mjs +0 -254
- package/angular/16/fesm2022/lightgallery-angular-16.mjs.map +0 -1
- package/angular/16/index.d.ts +0 -5
- package/angular/16/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/16/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/16/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/16/package.json +0 -25
- package/angular/16/public-api.d.ts +0 -3
- package/angular/9/README.md +0 -24
- package/angular/9/bundles/lightgallery-angular-9.umd.js +0 -271
- package/angular/9/bundles/lightgallery-angular-9.umd.js.map +0 -1
- package/angular/9/bundles/lightgallery-angular-9.umd.min.js +0 -2
- package/angular/9/bundles/lightgallery-angular-9.umd.min.js.map +0 -1
- package/angular/9/esm2015/lib/lightgallery-angular.component.js +0 -225
- package/angular/9/esm2015/lib/lightgallery-angular.module.js +0 -17
- package/angular/9/esm2015/lib/lightgallery-angular.service.js +0 -14
- package/angular/9/esm2015/lightgallery-angular-9.js +0 -5
- package/angular/9/esm2015/public-api.js +0 -7
- package/angular/9/esm5/lib/lightgallery-angular.component.js +0 -228
- package/angular/9/esm5/lib/lightgallery-angular.module.js +0 -21
- package/angular/9/esm5/lib/lightgallery-angular.service.js +0 -17
- package/angular/9/esm5/lightgallery-angular-9.js +0 -5
- package/angular/9/esm5/public-api.js +0 -7
- package/angular/9/fesm2015/lightgallery-angular-9.js +0 -261
- package/angular/9/fesm2015/lightgallery-angular-9.js.map +0 -1
- package/angular/9/fesm5/lightgallery-angular-9.js +0 -268
- package/angular/9/fesm5/lightgallery-angular-9.js.map +0 -1
- package/angular/9/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/9/lib/lightgallery-angular.module.d.ts +0 -6
- package/angular/9/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/9/lightgallery-angular-9.d.ts +0 -5
- package/angular/9/package.json +0 -23
- package/angular/9/public-api.d.ts +0 -3
- package/angular/README.md +0 -24
- package/angular/esm2022/lib/lightgallery-angular.component.mjs +0 -218
- package/angular/esm2022/lib/lightgallery-angular.module.mjs +0 -18
- package/angular/esm2022/lib/lightgallery-angular.service.mjs +0 -15
- package/angular/esm2022/lightgallery-angular.mjs +0 -5
- package/angular/esm2022/public-api.mjs +0 -7
- package/angular/fesm2022/lightgallery-angular.mjs +0 -254
- package/angular/fesm2022/lightgallery-angular.mjs.map +0 -1
- package/angular/index.d.ts +0 -5
- package/angular/lib/lightgallery-angular.component.d.ts +0 -38
- package/angular/lib/lightgallery-angular.module.d.ts +0 -7
- package/angular/lib/lightgallery-angular.service.d.ts +0 -6
- package/angular/package.json +0 -25
- package/angular/public-api.d.ts +0 -3
- package/css/lg-fullscreen.css +0 -8
- package/css/lg-fullscreen.css.map +0 -1
- package/css/lg-share.css.map +0 -1
- package/css/lg-thumbnail.css.map +0 -1
- package/css/lg-transitions.css.map +0 -1
- package/css/lg-zoom.css.map +0 -1
- package/css/lightgallery-bundle.css.map +0 -1
- package/css/lightgallery-bundle.min.css +0 -1
- package/css/lightgallery-core.css.map +0 -1
- package/css/lightgallery.css.map +0 -1
- package/fonts/lg.svg +0 -54
- package/fonts/lg.ttf +0 -0
- package/fonts/lg.woff +0 -0
- package/fonts/lg.woff2 +0 -0
- package/lib/index.js +0 -8
- package/lib/index.js.map +0 -1
- package/lib/lg-events.js +0 -37
- package/lib/lg-events.js.map +0 -1
- package/lib/lg-plugin.js +0 -13
- package/lib/lg-plugin.js.map +0 -1
- package/lib/lg-settings.js +0 -83
- package/lib/lg-settings.js.map +0 -1
- package/lib/lg-utils.js +0 -328
- package/lib/lg-utils.js.map +0 -1
- package/lib/lgQuery.js +0 -385
- package/lib/lgQuery.js.map +0 -1
- package/lib/lightgallery.js +0 -1949
- package/lib/lightgallery.js.map +0 -1
- package/lib/plugins/autoplay/lg-autoplay-settings.js +0 -16
- package/lib/plugins/autoplay/lg-autoplay-settings.js.map +0 -1
- package/lib/plugins/autoplay/lg-autoplay.js +0 -184
- package/lib/plugins/autoplay/lg-autoplay.js.map +0 -1
- package/lib/plugins/comment/lg-comment-settings.js +0 -17
- package/lib/plugins/comment/lg-comment-settings.js.map +0 -1
- package/lib/plugins/comment/lg-comment.js +0 -140
- package/lib/plugins/comment/lg-comment.js.map +0 -1
- package/lib/plugins/fullscreen/lg-fullscreen-settings.js +0 -10
- package/lib/plugins/fullscreen/lg-fullscreen-settings.js.map +0 -1
- package/lib/plugins/fullscreen/lg-fullscreen.js +0 -108
- package/lib/plugins/fullscreen/lg-fullscreen.js.map +0 -1
- package/lib/plugins/hash/lg-hash-settings.js +0 -9
- package/lib/plugins/hash/lg-hash-settings.js.map +0 -1
- package/lib/plugins/hash/lg-hash.js +0 -139
- package/lib/plugins/hash/lg-hash.js.map +0 -1
- package/lib/plugins/mediumZoom/lg-medium-zoom-settings.js +0 -9
- package/lib/plugins/mediumZoom/lg-medium-zoom-settings.js.map +0 -1
- package/lib/plugins/mediumZoom/lg-medium-zoom.js +0 -73
- package/lib/plugins/mediumZoom/lg-medium-zoom.js.map +0 -1
- package/lib/plugins/pager/lg-pager-settings.js +0 -7
- package/lib/plugins/pager/lg-pager-settings.js.map +0 -1
- package/lib/plugins/pager/lg-pager.js +0 -82
- package/lib/plugins/pager/lg-pager.js.map +0 -1
- package/lib/plugins/relativeCaption/lg-relative-caption-settings.js +0 -7
- package/lib/plugins/relativeCaption/lg-relative-caption-settings.js.map +0 -1
- package/lib/plugins/relativeCaption/lg-relative-caption.js +0 -97
- package/lib/plugins/relativeCaption/lg-relative-caption.js.map +0 -1
- package/lib/plugins/rotate/lg-rotate-settings.js +0 -18
- package/lib/plugins/rotate/lg-rotate-settings.js.map +0 -1
- package/lib/plugins/rotate/lg-rotate.js +0 -206
- package/lib/plugins/rotate/lg-rotate.js.map +0 -1
- package/lib/plugins/share/lg-fb-share-utils.js +0 -10
- package/lib/plugins/share/lg-fb-share-utils.js.map +0 -1
- package/lib/plugins/share/lg-pinterest-share-utils.js +0 -17
- package/lib/plugins/share/lg-pinterest-share-utils.js.map +0 -1
- package/lib/plugins/share/lg-share-settings.js +0 -15
- package/lib/plugins/share/lg-share-settings.js.map +0 -1
- package/lib/plugins/share/lg-share.js +0 -130
- package/lib/plugins/share/lg-share.js.map +0 -1
- package/lib/plugins/share/lg-twitter-share-utils.js +0 -11
- package/lib/plugins/share/lg-twitter-share-utils.js.map +0 -1
- package/lib/plugins/share/types.js +0 -3
- package/lib/plugins/share/types.js.map +0 -1
- package/lib/plugins/thumbnail/lg-thumbnail-settings.js +0 -23
- package/lib/plugins/thumbnail/lg-thumbnail-settings.js.map +0 -1
- package/lib/plugins/thumbnail/lg-thumbnail.js +0 -414
- package/lib/plugins/thumbnail/lg-thumbnail.js.map +0 -1
- package/lib/plugins/video/lg-video-settings.js +0 -15
- package/lib/plugins/video/lg-video-settings.js.map +0 -1
- package/lib/plugins/video/lg-video-utils.js +0 -84
- package/lib/plugins/video/lg-video-utils.js.map +0 -1
- package/lib/plugins/video/lg-video.js +0 -411
- package/lib/plugins/video/lg-video.js.map +0 -1
- package/lib/plugins/video/types.js +0 -3
- package/lib/plugins/video/types.js.map +0 -1
- package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.js +0 -8
- package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail-settings.js.map +0 -1
- package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail.js +0 -122
- package/lib/plugins/vimeoThumbnail/lg-vimeo-thumbnail.js.map +0 -1
- package/lib/plugins/zoom/lg-zoom-settings.js +0 -21
- package/lib/plugins/zoom/lg-zoom-settings.js.map +0 -1
- package/lib/plugins/zoom/lg-zoom.js +0 -909
- package/lib/plugins/zoom/lg-zoom.js.map +0 -1
- package/lib/types.js +0 -3
- package/lib/types.js.map +0 -1
- package/lightgallery-2.9.0.tgz +0 -0
- package/lightgallery.es5.js +0 -2786
- package/lightgallery.es5.js.map +0 -1
- package/lightgallery.min.js +0 -8
- package/lightgallery.umd.js +0 -2794
- package/lightgallery.umd.js.map +0 -1
- package/lit/custom-elements.json +0 -82
- package/lit/lightgallery.esm.js +0 -59
- package/lit/lightgallery.umd.js +0 -37
- package/lit/package.json +0 -8
- package/plugins/autoplay/lg-autoplay.es5.js +0 -250
- package/plugins/autoplay/lg-autoplay.es5.js.map +0 -1
- package/plugins/autoplay/lg-autoplay.min.js +0 -8
- package/plugins/autoplay/lg-autoplay.umd.js +0 -258
- package/plugins/autoplay/lg-autoplay.umd.js.map +0 -1
- package/plugins/autoplay/package.json +0 -7
- package/plugins/comment/lg-comment.es5.js +0 -205
- package/plugins/comment/lg-comment.es5.js.map +0 -1
- package/plugins/comment/lg-comment.min.js +0 -8
- package/plugins/comment/lg-comment.umd.js +0 -213
- package/plugins/comment/lg-comment.umd.js.map +0 -1
- package/plugins/comment/package.json +0 -7
- package/plugins/fullscreen/lg-fullscreen.es5.js +0 -135
- package/plugins/fullscreen/lg-fullscreen.es5.js.map +0 -1
- package/plugins/fullscreen/lg-fullscreen.min.js +0 -8
- package/plugins/fullscreen/lg-fullscreen.umd.js +0 -143
- package/plugins/fullscreen/lg-fullscreen.umd.js.map +0 -1
- package/plugins/fullscreen/package.json +0 -7
- package/plugins/hash/lg-hash-settings.d.ts +0 -16
- package/plugins/hash/lg-hash.es5.js +0 -198
- package/plugins/hash/lg-hash.es5.js.map +0 -1
- package/plugins/hash/lg-hash.min.js +0 -8
- package/plugins/hash/lg-hash.umd.js +0 -206
- package/plugins/hash/lg-hash.umd.js.map +0 -1
- package/plugins/hash/package.json +0 -7
- package/plugins/mediumZoom/lg-medium-zoom.es5.js +0 -132
- package/plugins/mediumZoom/lg-medium-zoom.es5.js.map +0 -1
- package/plugins/mediumZoom/lg-medium-zoom.min.js +0 -8
- package/plugins/mediumZoom/lg-medium-zoom.umd.js +0 -140
- package/plugins/mediumZoom/lg-medium-zoom.umd.js.map +0 -1
- package/plugins/mediumZoom/package.json +0 -7
- package/plugins/pager/lg-pager.es5.js +0 -139
- package/plugins/pager/lg-pager.es5.js.map +0 -1
- package/plugins/pager/lg-pager.min.js +0 -8
- package/plugins/pager/lg-pager.umd.js +0 -147
- package/plugins/pager/lg-pager.umd.js.map +0 -1
- package/plugins/pager/package.json +0 -7
- package/plugins/relativeCaption/lg-relative-caption.es5.js +0 -154
- package/plugins/relativeCaption/lg-relative-caption.es5.js.map +0 -1
- package/plugins/relativeCaption/lg-relative-caption.min.js +0 -8
- package/plugins/relativeCaption/lg-relative-caption.umd.js +0 -162
- package/plugins/relativeCaption/lg-relative-caption.umd.js.map +0 -1
- package/plugins/relativeCaption/package.json +0 -7
- package/plugins/rotate/lg-rotate.es5.js +0 -274
- package/plugins/rotate/lg-rotate.es5.js.map +0 -1
- package/plugins/rotate/lg-rotate.min.js +0 -8
- package/plugins/rotate/lg-rotate.umd.js +0 -282
- package/plugins/rotate/lg-rotate.umd.js.map +0 -1
- package/plugins/rotate/package.json +0 -7
- package/plugins/share/lg-share.d.ts +0 -15
- package/plugins/share/lg-share.es5.js +0 -219
- package/plugins/share/lg-share.es5.js.map +0 -1
- package/plugins/share/lg-share.min.js +0 -8
- package/plugins/share/lg-share.umd.js +0 -227
- package/plugins/share/lg-share.umd.js.map +0 -1
- package/plugins/share/lg-twitter-share-utils.d.ts +0 -2
- package/plugins/share/package.json +0 -7
- package/plugins/thumbnail/lg-thumbnail.d.ts +0 -48
- package/plugins/thumbnail/lg-thumbnail.es5.js +0 -487
- package/plugins/thumbnail/lg-thumbnail.es5.js.map +0 -1
- package/plugins/thumbnail/lg-thumbnail.min.js +0 -8
- package/plugins/thumbnail/lg-thumbnail.umd.js +0 -495
- package/plugins/thumbnail/lg-thumbnail.umd.js.map +0 -1
- package/plugins/thumbnail/package.json +0 -7
- package/plugins/video/lg-video-utils.d.ts +0 -10
- package/plugins/video/lg-video.es5.js +0 -545
- package/plugins/video/lg-video.es5.js.map +0 -1
- package/plugins/video/lg-video.min.js +0 -8
- package/plugins/video/lg-video.umd.js +0 -553
- package/plugins/video/lg-video.umd.js.map +0 -1
- package/plugins/video/package.json +0 -7
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js +0 -182
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js.map +0 -1
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js +0 -8
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js +0 -190
- package/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js.map +0 -1
- package/plugins/vimeoThumbnail/package.json +0 -7
- package/plugins/zoom/lg-zoom.es5.js +0 -980
- package/plugins/zoom/lg-zoom.es5.js.map +0 -1
- package/plugins/zoom/lg-zoom.min.js +0 -8
- package/plugins/zoom/lg-zoom.umd.js +0 -988
- package/plugins/zoom/lg-zoom.umd.js.map +0 -1
- package/plugins/zoom/package.json +0 -7
- package/react/Lightgallery.d.ts +0 -33
- package/react/Lightgallery.es5.js +0 -2988
- package/react/Lightgallery.es5.js.map +0 -1
- package/react/Lightgallery.umd.js +0 -2994
- package/react/Lightgallery.umd.js.map +0 -1
- package/react/package.json +0 -7
- package/scss/_lg-fonts.scss +0 -27
- package/scss/lg-fullscreen.scss +0 -9
- package/vue/LightGallery.vue.d.ts +0 -37
- package/vue/LightGalleryVue.common.js +0 -9343
- package/vue/LightGalleryVue.common.js.map +0 -1
- package/vue/LightGalleryVue.umd.js +0 -9353
- package/vue/LightGalleryVue.umd.js.map +0 -1
- package/vue/LightGalleryVue.umd.min.js +0 -8
- package/vue/LightGalleryVue.umd.min.js.map +0 -1
- package/vue/package.json +0 -7
- /package/{css → dist/css}/lg-medium-zoom.css +0 -0
- /package/{css → dist/css}/lg-medium-zoom.css.map +0 -0
- /package/{css → dist/css}/lg-pager.css +0 -0
- /package/{css → dist/css}/lg-relative-caption.css +0 -0
- /package/{css → dist/css}/lg-relative-caption.css.map +0 -0
- /package/{css → dist/css}/lg-video.css +0 -0
- /package/{css → dist/css}/lg-video.css.map +0 -0
- /package/{images → dist/images}/loading.gif +0 -0
- /package/{scss → dist/scss}/_lg-mixins.scss +0 -0
- /package/{scss → dist/scss}/lg-medium-zoom.scss +0 -0
- /package/{scss → dist/scss}/lg-pager.scss +0 -0
- /package/{scss → dist/scss}/lg-relative-caption.scss +0 -0
- /package/{scss → dist/scss}/lg-transitions.scss +0 -0
- /package/{scss → dist/scss}/lg-video.scss +0 -0
- /package/{scss → dist/scss}/transitions/_index.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-lollipop-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-lollipop.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-rotate-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-rotate.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-cross-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-cross.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-only-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-only-y-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-only-y.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-only.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-ver-cross-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-ver-cross.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-ver-rev.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew-ver.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-skew.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-vertical-growth.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-slide-vertical.scss +0 -0
- /package/{scss → dist/scss}/transitions/_lg-tube.scss +0 -0
|
@@ -1,909 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
var lg_zoom_settings_1 = require("./lg-zoom-settings");
|
|
15
|
-
var lg_events_1 = require("../../lg-events");
|
|
16
|
-
var ZOOM_TRANSITION_DURATION = 500;
|
|
17
|
-
var Zoom = /** @class */ (function () {
|
|
18
|
-
function Zoom(instance, $LG) {
|
|
19
|
-
// get lightGallery core plugin instance
|
|
20
|
-
this.core = instance;
|
|
21
|
-
this.$LG = $LG;
|
|
22
|
-
this.settings = __assign(__assign({}, lg_zoom_settings_1.zoomSettings), this.core.settings);
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
// Append Zoom controls. Actual size, Zoom-in, Zoom-out
|
|
26
|
-
Zoom.prototype.buildTemplates = function () {
|
|
27
|
-
var zoomIcons = this.settings.showZoomInOutIcons
|
|
28
|
-
? "<button id=\"" + this.core.getIdName('lg-zoom-in') + "\" type=\"button\" aria-label=\"" + this.settings.zoomPluginStrings['zoomIn'] + "\" class=\"lg-zoom-in lg-icon\"></button><button id=\"" + this.core.getIdName('lg-zoom-out') + "\" type=\"button\" aria-label=\"" + this.settings.zoomPluginStrings['zoomOut'] + "\" class=\"lg-zoom-out lg-icon\"></button>"
|
|
29
|
-
: '';
|
|
30
|
-
if (this.settings.actualSize) {
|
|
31
|
-
zoomIcons += "<button id=\"" + this.core.getIdName('lg-actual-size') + "\" type=\"button\" aria-label=\"" + this.settings.zoomPluginStrings['viewActualSize'] + "\" class=\"" + this.settings.actualSizeIcons.zoomIn + " lg-icon\"></button>";
|
|
32
|
-
}
|
|
33
|
-
this.core.outer.addClass('lg-use-transition-for-zoom');
|
|
34
|
-
this.core.$toolbar.first().append(zoomIcons);
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* @desc Enable zoom option only once the image is completely loaded
|
|
38
|
-
* If zoomFromOrigin is true, Zoom is enabled once the dummy image has been inserted
|
|
39
|
-
*
|
|
40
|
-
* Zoom styles are defined under lg-zoomable CSS class.
|
|
41
|
-
*/
|
|
42
|
-
Zoom.prototype.enableZoom = function (event) {
|
|
43
|
-
var _this = this;
|
|
44
|
-
// delay will be 0 except first time
|
|
45
|
-
var _speed = this.settings.enableZoomAfter + event.detail.delay;
|
|
46
|
-
// set _speed value 0 if gallery opened from direct url and if it is first slide
|
|
47
|
-
if (this.$LG('body').first().hasClass('lg-from-hash') &&
|
|
48
|
-
event.detail.delay) {
|
|
49
|
-
// will execute only once
|
|
50
|
-
_speed = 0;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
// Remove lg-from-hash to enable starting animation.
|
|
54
|
-
this.$LG('body').first().removeClass('lg-from-hash');
|
|
55
|
-
}
|
|
56
|
-
this.zoomableTimeout = setTimeout(function () {
|
|
57
|
-
if (!_this.isImageSlide(_this.core.index)) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
_this.core.getSlideItem(event.detail.index).addClass('lg-zoomable');
|
|
61
|
-
if (event.detail.index === _this.core.index) {
|
|
62
|
-
_this.setZoomEssentials();
|
|
63
|
-
}
|
|
64
|
-
}, _speed + 30);
|
|
65
|
-
};
|
|
66
|
-
Zoom.prototype.enableZoomOnSlideItemLoad = function () {
|
|
67
|
-
// Add zoomable class
|
|
68
|
-
this.core.LGel.on(lg_events_1.lGEvents.slideItemLoad + ".zoom", this.enableZoom.bind(this));
|
|
69
|
-
};
|
|
70
|
-
Zoom.prototype.getDragCords = function (e) {
|
|
71
|
-
return {
|
|
72
|
-
x: e.pageX,
|
|
73
|
-
y: e.pageY,
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
Zoom.prototype.getSwipeCords = function (e) {
|
|
77
|
-
var x = e.touches[0].pageX;
|
|
78
|
-
var y = e.touches[0].pageY;
|
|
79
|
-
return {
|
|
80
|
-
x: x,
|
|
81
|
-
y: y,
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
Zoom.prototype.getDragAllowedAxises = function (scale, scaleDiff) {
|
|
85
|
-
if (!this.containerRect) {
|
|
86
|
-
return {
|
|
87
|
-
allowX: false,
|
|
88
|
-
allowY: false,
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
var $image = this.core
|
|
92
|
-
.getSlideItem(this.core.index)
|
|
93
|
-
.find('.lg-image')
|
|
94
|
-
.first()
|
|
95
|
-
.get();
|
|
96
|
-
var height = 0;
|
|
97
|
-
var width = 0;
|
|
98
|
-
var rect = $image.getBoundingClientRect();
|
|
99
|
-
if (scale) {
|
|
100
|
-
height = $image.offsetHeight * scale;
|
|
101
|
-
width = $image.offsetWidth * scale;
|
|
102
|
-
}
|
|
103
|
-
else if (scaleDiff) {
|
|
104
|
-
height = rect.height + scaleDiff * rect.height;
|
|
105
|
-
width = rect.width + scaleDiff * rect.width;
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
height = rect.height;
|
|
109
|
-
width = rect.width;
|
|
110
|
-
}
|
|
111
|
-
var allowY = height > this.containerRect.height;
|
|
112
|
-
var allowX = width > this.containerRect.width;
|
|
113
|
-
return {
|
|
114
|
-
allowX: allowX,
|
|
115
|
-
allowY: allowY,
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
Zoom.prototype.setZoomEssentials = function () {
|
|
119
|
-
this.containerRect = this.core.$content.get().getBoundingClientRect();
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* @desc Image zoom
|
|
123
|
-
* Translate the wrap and scale the image to get better user experience
|
|
124
|
-
*
|
|
125
|
-
* @param {String} scale - Zoom decrement/increment value
|
|
126
|
-
*/
|
|
127
|
-
Zoom.prototype.zoomImage = function (scale, scaleDiff, reposition, resetToMax) {
|
|
128
|
-
if (!this.containerRect || Math.abs(scaleDiff) <= 0)
|
|
129
|
-
return;
|
|
130
|
-
var offsetX = this.containerRect.width / 2 + this.containerRect.left;
|
|
131
|
-
var offsetY = this.containerRect.height / 2 +
|
|
132
|
-
this.containerRect.top +
|
|
133
|
-
this.scrollTop;
|
|
134
|
-
var originalX;
|
|
135
|
-
var originalY;
|
|
136
|
-
if (scale === 1) {
|
|
137
|
-
this.positionChanged = false;
|
|
138
|
-
}
|
|
139
|
-
var dragAllowedAxises = this.getDragAllowedAxises(0, scaleDiff);
|
|
140
|
-
var allowY = dragAllowedAxises.allowY, allowX = dragAllowedAxises.allowX;
|
|
141
|
-
if (this.positionChanged) {
|
|
142
|
-
originalX = this.left / (this.scale - scaleDiff);
|
|
143
|
-
originalY = this.top / (this.scale - scaleDiff);
|
|
144
|
-
this.pageX = offsetX - originalX;
|
|
145
|
-
this.pageY = offsetY - originalY;
|
|
146
|
-
this.positionChanged = false;
|
|
147
|
-
}
|
|
148
|
-
var possibleSwipeCords = this.getPossibleSwipeDragCords(scaleDiff);
|
|
149
|
-
var x;
|
|
150
|
-
var y;
|
|
151
|
-
var _x = offsetX - this.pageX;
|
|
152
|
-
var _y = offsetY - this.pageY;
|
|
153
|
-
if (scale - scaleDiff > 1) {
|
|
154
|
-
var scaleVal = (scale - scaleDiff) / Math.abs(scaleDiff);
|
|
155
|
-
_x =
|
|
156
|
-
(scaleDiff < 0 ? -_x : _x) +
|
|
157
|
-
this.left * (scaleVal + (scaleDiff < 0 ? -1 : 1));
|
|
158
|
-
_y =
|
|
159
|
-
(scaleDiff < 0 ? -_y : _y) +
|
|
160
|
-
this.top * (scaleVal + (scaleDiff < 0 ? -1 : 1));
|
|
161
|
-
x = _x / scaleVal;
|
|
162
|
-
y = _y / scaleVal;
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
var scaleVal = (scale - scaleDiff) * scaleDiff;
|
|
166
|
-
x = _x * scaleVal;
|
|
167
|
-
y = _y * scaleVal;
|
|
168
|
-
}
|
|
169
|
-
if (reposition) {
|
|
170
|
-
if (allowX) {
|
|
171
|
-
if (this.isBeyondPossibleLeft(x, possibleSwipeCords.minX)) {
|
|
172
|
-
x = possibleSwipeCords.minX;
|
|
173
|
-
}
|
|
174
|
-
else if (this.isBeyondPossibleRight(x, possibleSwipeCords.maxX)) {
|
|
175
|
-
x = possibleSwipeCords.maxX;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
if (scale > 1) {
|
|
180
|
-
if (x < possibleSwipeCords.minX) {
|
|
181
|
-
x = possibleSwipeCords.minX;
|
|
182
|
-
}
|
|
183
|
-
else if (x > possibleSwipeCords.maxX) {
|
|
184
|
-
x = possibleSwipeCords.maxX;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
// @todo fix this
|
|
189
|
-
if (allowY) {
|
|
190
|
-
if (this.isBeyondPossibleTop(y, possibleSwipeCords.minY)) {
|
|
191
|
-
y = possibleSwipeCords.minY;
|
|
192
|
-
}
|
|
193
|
-
else if (this.isBeyondPossibleBottom(y, possibleSwipeCords.maxY)) {
|
|
194
|
-
y = possibleSwipeCords.maxY;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
// If the translate value based on index of beyond the viewport, utilize the available space to prevent image being cut out
|
|
199
|
-
if (scale > 1) {
|
|
200
|
-
//If image goes beyond viewport top, use the minim possible translate value
|
|
201
|
-
if (y < possibleSwipeCords.minY) {
|
|
202
|
-
y = possibleSwipeCords.minY;
|
|
203
|
-
}
|
|
204
|
-
else if (y > possibleSwipeCords.maxY) {
|
|
205
|
-
y = possibleSwipeCords.maxY;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
this.setZoomStyles({
|
|
211
|
-
x: x,
|
|
212
|
-
y: y,
|
|
213
|
-
scale: scale,
|
|
214
|
-
});
|
|
215
|
-
this.left = x;
|
|
216
|
-
this.top = y;
|
|
217
|
-
if (resetToMax) {
|
|
218
|
-
this.setZoomImageSize();
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
Zoom.prototype.resetImageTranslate = function (index) {
|
|
222
|
-
if (!this.isImageSlide(index)) {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
var $image = this.core.getSlideItem(index).find('.lg-image').first();
|
|
226
|
-
this.imageReset = false;
|
|
227
|
-
$image.removeClass('reset-transition reset-transition-y reset-transition-x');
|
|
228
|
-
this.core.outer.removeClass('lg-actual-size');
|
|
229
|
-
$image.css('width', 'auto').css('height', 'auto');
|
|
230
|
-
setTimeout(function () {
|
|
231
|
-
$image.removeClass('no-transition');
|
|
232
|
-
}, 10);
|
|
233
|
-
};
|
|
234
|
-
Zoom.prototype.setZoomImageSize = function () {
|
|
235
|
-
var _this = this;
|
|
236
|
-
var $image = this.core
|
|
237
|
-
.getSlideItem(this.core.index)
|
|
238
|
-
.find('.lg-image')
|
|
239
|
-
.first();
|
|
240
|
-
setTimeout(function () {
|
|
241
|
-
var actualSizeScale = _this.getCurrentImageActualSizeScale();
|
|
242
|
-
if (_this.scale >= actualSizeScale) {
|
|
243
|
-
$image.addClass('no-transition');
|
|
244
|
-
_this.imageReset = true;
|
|
245
|
-
}
|
|
246
|
-
}, ZOOM_TRANSITION_DURATION);
|
|
247
|
-
setTimeout(function () {
|
|
248
|
-
var actualSizeScale = _this.getCurrentImageActualSizeScale();
|
|
249
|
-
if (_this.scale >= actualSizeScale) {
|
|
250
|
-
var dragAllowedAxises = _this.getDragAllowedAxises(_this.scale);
|
|
251
|
-
$image
|
|
252
|
-
.css('width', $image.get().naturalWidth + 'px')
|
|
253
|
-
.css('height', $image.get().naturalHeight + 'px');
|
|
254
|
-
_this.core.outer.addClass('lg-actual-size');
|
|
255
|
-
if (dragAllowedAxises.allowX && dragAllowedAxises.allowY) {
|
|
256
|
-
$image.addClass('reset-transition');
|
|
257
|
-
}
|
|
258
|
-
else if (dragAllowedAxises.allowX &&
|
|
259
|
-
!dragAllowedAxises.allowY) {
|
|
260
|
-
$image.addClass('reset-transition-x');
|
|
261
|
-
}
|
|
262
|
-
else if (!dragAllowedAxises.allowX &&
|
|
263
|
-
dragAllowedAxises.allowY) {
|
|
264
|
-
$image.addClass('reset-transition-y');
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}, ZOOM_TRANSITION_DURATION + 50);
|
|
268
|
-
};
|
|
269
|
-
/**
|
|
270
|
-
* @desc apply scale3d to image and translate to image wrap
|
|
271
|
-
* @param {style} X,Y and scale
|
|
272
|
-
*/
|
|
273
|
-
Zoom.prototype.setZoomStyles = function (style) {
|
|
274
|
-
var $imageWrap = this.core
|
|
275
|
-
.getSlideItem(this.core.index)
|
|
276
|
-
.find('.lg-img-wrap')
|
|
277
|
-
.first();
|
|
278
|
-
var $image = this.core
|
|
279
|
-
.getSlideItem(this.core.index)
|
|
280
|
-
.find('.lg-image')
|
|
281
|
-
.first();
|
|
282
|
-
var $dummyImage = this.core.outer
|
|
283
|
-
.find('.lg-current .lg-dummy-img')
|
|
284
|
-
.first();
|
|
285
|
-
this.scale = style.scale;
|
|
286
|
-
$image.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
|
|
287
|
-
$dummyImage.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
|
|
288
|
-
var transform = 'translate3d(' + style.x + 'px, ' + style.y + 'px, 0)';
|
|
289
|
-
$imageWrap.css('transform', transform);
|
|
290
|
-
};
|
|
291
|
-
/**
|
|
292
|
-
* @param index - Index of the current slide
|
|
293
|
-
* @param event - event will be available only if the function is called on clicking/taping the imags
|
|
294
|
-
*/
|
|
295
|
-
Zoom.prototype.setActualSize = function (index, event) {
|
|
296
|
-
var _this = this;
|
|
297
|
-
if (this.zoomInProgress) {
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
this.zoomInProgress = true;
|
|
301
|
-
var currentItem = this.core.galleryItems[this.core.index];
|
|
302
|
-
this.resetImageTranslate(index);
|
|
303
|
-
setTimeout(function () {
|
|
304
|
-
// Allow zoom only on image
|
|
305
|
-
if (!currentItem.src ||
|
|
306
|
-
_this.core.outer.hasClass('lg-first-slide-loading')) {
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
var scale = _this.getCurrentImageActualSizeScale();
|
|
310
|
-
var prevScale = _this.scale;
|
|
311
|
-
if (_this.core.outer.hasClass('lg-zoomed')) {
|
|
312
|
-
_this.scale = 1;
|
|
313
|
-
}
|
|
314
|
-
else {
|
|
315
|
-
_this.scale = _this.getScale(scale);
|
|
316
|
-
}
|
|
317
|
-
_this.setPageCords(event);
|
|
318
|
-
_this.beginZoom(_this.scale);
|
|
319
|
-
_this.zoomImage(_this.scale, _this.scale - prevScale, true, true);
|
|
320
|
-
}, 50);
|
|
321
|
-
setTimeout(function () {
|
|
322
|
-
_this.core.outer.removeClass('lg-grabbing').addClass('lg-grab');
|
|
323
|
-
}, 60);
|
|
324
|
-
setTimeout(function () {
|
|
325
|
-
_this.zoomInProgress = false;
|
|
326
|
-
}, ZOOM_TRANSITION_DURATION + 110);
|
|
327
|
-
};
|
|
328
|
-
Zoom.prototype.getNaturalWidth = function (index) {
|
|
329
|
-
var $image = this.core.getSlideItem(index).find('.lg-image').first();
|
|
330
|
-
var naturalWidth = this.core.galleryItems[index].width;
|
|
331
|
-
return naturalWidth
|
|
332
|
-
? parseFloat(naturalWidth)
|
|
333
|
-
: undefined || $image.get().naturalWidth;
|
|
334
|
-
};
|
|
335
|
-
Zoom.prototype.getActualSizeScale = function (naturalWidth, width) {
|
|
336
|
-
var _scale;
|
|
337
|
-
var scale;
|
|
338
|
-
if (naturalWidth >= width) {
|
|
339
|
-
_scale = naturalWidth / width;
|
|
340
|
-
scale = _scale || 2;
|
|
341
|
-
}
|
|
342
|
-
else {
|
|
343
|
-
scale = 1;
|
|
344
|
-
}
|
|
345
|
-
return scale;
|
|
346
|
-
};
|
|
347
|
-
Zoom.prototype.getCurrentImageActualSizeScale = function () {
|
|
348
|
-
var $image = this.core
|
|
349
|
-
.getSlideItem(this.core.index)
|
|
350
|
-
.find('.lg-image')
|
|
351
|
-
.first();
|
|
352
|
-
var width = $image.get().offsetWidth;
|
|
353
|
-
var naturalWidth = this.getNaturalWidth(this.core.index) || width;
|
|
354
|
-
return this.getActualSizeScale(naturalWidth, width);
|
|
355
|
-
};
|
|
356
|
-
Zoom.prototype.getPageCords = function (event) {
|
|
357
|
-
var cords = {};
|
|
358
|
-
if (event) {
|
|
359
|
-
cords.x = event.pageX || event.touches[0].pageX;
|
|
360
|
-
cords.y = event.pageY || event.touches[0].pageY;
|
|
361
|
-
}
|
|
362
|
-
else {
|
|
363
|
-
var containerRect = this.core.$content
|
|
364
|
-
.get()
|
|
365
|
-
.getBoundingClientRect();
|
|
366
|
-
cords.x = containerRect.width / 2 + containerRect.left;
|
|
367
|
-
cords.y =
|
|
368
|
-
containerRect.height / 2 + this.scrollTop + containerRect.top;
|
|
369
|
-
}
|
|
370
|
-
return cords;
|
|
371
|
-
};
|
|
372
|
-
Zoom.prototype.setPageCords = function (event) {
|
|
373
|
-
var pageCords = this.getPageCords(event);
|
|
374
|
-
this.pageX = pageCords.x;
|
|
375
|
-
this.pageY = pageCords.y;
|
|
376
|
-
};
|
|
377
|
-
Zoom.prototype.manageActualPixelClassNames = function () {
|
|
378
|
-
var $actualSize = this.core.getElementById('lg-actual-size');
|
|
379
|
-
$actualSize
|
|
380
|
-
.removeClass(this.settings.actualSizeIcons.zoomIn)
|
|
381
|
-
.addClass(this.settings.actualSizeIcons.zoomOut);
|
|
382
|
-
};
|
|
383
|
-
// If true, zoomed - in else zoomed out
|
|
384
|
-
Zoom.prototype.beginZoom = function (scale) {
|
|
385
|
-
this.core.outer.removeClass('lg-zoom-drag-transition lg-zoom-dragging');
|
|
386
|
-
if (scale > 1) {
|
|
387
|
-
this.core.outer.addClass('lg-zoomed');
|
|
388
|
-
this.manageActualPixelClassNames();
|
|
389
|
-
}
|
|
390
|
-
else {
|
|
391
|
-
this.resetZoom();
|
|
392
|
-
}
|
|
393
|
-
return scale > 1;
|
|
394
|
-
};
|
|
395
|
-
Zoom.prototype.getScale = function (scale) {
|
|
396
|
-
var actualSizeScale = this.getCurrentImageActualSizeScale();
|
|
397
|
-
if (scale < 1) {
|
|
398
|
-
scale = 1;
|
|
399
|
-
}
|
|
400
|
-
else if (scale > actualSizeScale) {
|
|
401
|
-
scale = actualSizeScale;
|
|
402
|
-
}
|
|
403
|
-
return scale;
|
|
404
|
-
};
|
|
405
|
-
Zoom.prototype.init = function () {
|
|
406
|
-
var _this = this;
|
|
407
|
-
if (!this.settings.zoom) {
|
|
408
|
-
return;
|
|
409
|
-
}
|
|
410
|
-
this.buildTemplates();
|
|
411
|
-
this.enableZoomOnSlideItemLoad();
|
|
412
|
-
var tapped = null;
|
|
413
|
-
this.core.outer.on('dblclick.lg', function (event) {
|
|
414
|
-
if (!_this.$LG(event.target).hasClass('lg-image')) {
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
_this.setActualSize(_this.core.index, event);
|
|
418
|
-
});
|
|
419
|
-
this.core.outer.on('touchstart.lg', function (event) {
|
|
420
|
-
var $target = _this.$LG(event.target);
|
|
421
|
-
if (event.touches.length === 1 && $target.hasClass('lg-image')) {
|
|
422
|
-
if (!tapped) {
|
|
423
|
-
tapped = setTimeout(function () {
|
|
424
|
-
tapped = null;
|
|
425
|
-
}, 300);
|
|
426
|
-
}
|
|
427
|
-
else {
|
|
428
|
-
clearTimeout(tapped);
|
|
429
|
-
tapped = null;
|
|
430
|
-
event.preventDefault();
|
|
431
|
-
_this.setActualSize(_this.core.index, event);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
this.core.LGel.on(lg_events_1.lGEvents.containerResize + ".zoom " + lg_events_1.lGEvents.rotateRight + ".zoom " + lg_events_1.lGEvents.rotateLeft + ".zoom " + lg_events_1.lGEvents.flipHorizontal + ".zoom " + lg_events_1.lGEvents.flipVertical + ".zoom", function () {
|
|
436
|
-
if (!_this.core.lgOpened ||
|
|
437
|
-
!_this.isImageSlide(_this.core.index) ||
|
|
438
|
-
_this.core.touchAction) {
|
|
439
|
-
return;
|
|
440
|
-
}
|
|
441
|
-
var _LGel = _this.core
|
|
442
|
-
.getSlideItem(_this.core.index)
|
|
443
|
-
.find('.lg-img-wrap')
|
|
444
|
-
.first();
|
|
445
|
-
_this.top = 0;
|
|
446
|
-
_this.left = 0;
|
|
447
|
-
_this.setZoomEssentials();
|
|
448
|
-
_this.setZoomSwipeStyles(_LGel, { x: 0, y: 0 });
|
|
449
|
-
_this.positionChanged = true;
|
|
450
|
-
});
|
|
451
|
-
// Update zoom on resize and orientationchange
|
|
452
|
-
this.$LG(window).on("scroll.lg.zoom.global" + this.core.lgId, function () {
|
|
453
|
-
if (!_this.core.lgOpened)
|
|
454
|
-
return;
|
|
455
|
-
_this.scrollTop = _this.$LG(window).scrollTop();
|
|
456
|
-
});
|
|
457
|
-
this.core.getElementById('lg-zoom-out').on('click.lg', function () {
|
|
458
|
-
// Allow zoom only on image
|
|
459
|
-
if (!_this.isImageSlide(_this.core.index)) {
|
|
460
|
-
return;
|
|
461
|
-
}
|
|
462
|
-
var timeout = 0;
|
|
463
|
-
if (_this.imageReset) {
|
|
464
|
-
_this.resetImageTranslate(_this.core.index);
|
|
465
|
-
timeout = 50;
|
|
466
|
-
}
|
|
467
|
-
setTimeout(function () {
|
|
468
|
-
var scale = _this.scale - _this.settings.scale;
|
|
469
|
-
if (scale < 1) {
|
|
470
|
-
scale = 1;
|
|
471
|
-
}
|
|
472
|
-
_this.beginZoom(scale);
|
|
473
|
-
_this.zoomImage(scale, -_this.settings.scale, true, !_this.settings.infiniteZoom);
|
|
474
|
-
}, timeout);
|
|
475
|
-
});
|
|
476
|
-
this.core.getElementById('lg-zoom-in').on('click.lg', function () {
|
|
477
|
-
_this.zoomIn();
|
|
478
|
-
});
|
|
479
|
-
this.core.getElementById('lg-actual-size').on('click.lg', function () {
|
|
480
|
-
_this.setActualSize(_this.core.index);
|
|
481
|
-
});
|
|
482
|
-
this.core.LGel.on(lg_events_1.lGEvents.beforeOpen + ".zoom", function () {
|
|
483
|
-
_this.core.outer.find('.lg-item').removeClass('lg-zoomable');
|
|
484
|
-
});
|
|
485
|
-
this.core.LGel.on(lg_events_1.lGEvents.afterOpen + ".zoom", function () {
|
|
486
|
-
_this.scrollTop = _this.$LG(window).scrollTop();
|
|
487
|
-
// Set the initial value center
|
|
488
|
-
_this.pageX = _this.core.outer.width() / 2;
|
|
489
|
-
_this.pageY = _this.core.outer.height() / 2 + _this.scrollTop;
|
|
490
|
-
_this.scale = 1;
|
|
491
|
-
});
|
|
492
|
-
// Reset zoom on slide change
|
|
493
|
-
this.core.LGel.on(lg_events_1.lGEvents.afterSlide + ".zoom", function (event) {
|
|
494
|
-
var prevIndex = event.detail.prevIndex;
|
|
495
|
-
_this.scale = 1;
|
|
496
|
-
_this.positionChanged = false;
|
|
497
|
-
_this.zoomInProgress = false;
|
|
498
|
-
_this.resetZoom(prevIndex);
|
|
499
|
-
_this.resetImageTranslate(prevIndex);
|
|
500
|
-
if (_this.isImageSlide(_this.core.index)) {
|
|
501
|
-
_this.setZoomEssentials();
|
|
502
|
-
}
|
|
503
|
-
});
|
|
504
|
-
// Drag option after zoom
|
|
505
|
-
this.zoomDrag();
|
|
506
|
-
this.pinchZoom();
|
|
507
|
-
this.zoomSwipe();
|
|
508
|
-
// Store the zoomable timeout value just to clear it while closing
|
|
509
|
-
this.zoomableTimeout = false;
|
|
510
|
-
this.positionChanged = false;
|
|
511
|
-
this.zoomInProgress = false;
|
|
512
|
-
};
|
|
513
|
-
Zoom.prototype.zoomIn = function () {
|
|
514
|
-
// Allow zoom only on image
|
|
515
|
-
if (!this.isImageSlide(this.core.index)) {
|
|
516
|
-
return;
|
|
517
|
-
}
|
|
518
|
-
var scale = this.scale + this.settings.scale;
|
|
519
|
-
if (!this.settings.infiniteZoom) {
|
|
520
|
-
scale = this.getScale(scale);
|
|
521
|
-
}
|
|
522
|
-
this.beginZoom(scale);
|
|
523
|
-
this.zoomImage(scale, Math.min(this.settings.scale, scale - this.scale), true, !this.settings.infiniteZoom);
|
|
524
|
-
};
|
|
525
|
-
// Reset zoom effect
|
|
526
|
-
Zoom.prototype.resetZoom = function (index) {
|
|
527
|
-
this.core.outer.removeClass('lg-zoomed lg-zoom-drag-transition');
|
|
528
|
-
var $actualSize = this.core.getElementById('lg-actual-size');
|
|
529
|
-
var $item = this.core.getSlideItem(index !== undefined ? index : this.core.index);
|
|
530
|
-
$actualSize
|
|
531
|
-
.removeClass(this.settings.actualSizeIcons.zoomOut)
|
|
532
|
-
.addClass(this.settings.actualSizeIcons.zoomIn);
|
|
533
|
-
$item.find('.lg-img-wrap').first().removeAttr('style');
|
|
534
|
-
$item.find('.lg-image').first().removeAttr('style');
|
|
535
|
-
this.scale = 1;
|
|
536
|
-
this.left = 0;
|
|
537
|
-
this.top = 0;
|
|
538
|
-
// Reset pagx pagy values to center
|
|
539
|
-
this.setPageCords();
|
|
540
|
-
};
|
|
541
|
-
Zoom.prototype.getTouchDistance = function (e) {
|
|
542
|
-
return Math.sqrt((e.touches[0].pageX - e.touches[1].pageX) *
|
|
543
|
-
(e.touches[0].pageX - e.touches[1].pageX) +
|
|
544
|
-
(e.touches[0].pageY - e.touches[1].pageY) *
|
|
545
|
-
(e.touches[0].pageY - e.touches[1].pageY));
|
|
546
|
-
};
|
|
547
|
-
Zoom.prototype.pinchZoom = function () {
|
|
548
|
-
var _this = this;
|
|
549
|
-
var startDist = 0;
|
|
550
|
-
var pinchStarted = false;
|
|
551
|
-
var initScale = 1;
|
|
552
|
-
var prevScale = 0;
|
|
553
|
-
var $item = this.core.getSlideItem(this.core.index);
|
|
554
|
-
this.core.outer.on('touchstart.lg', function (e) {
|
|
555
|
-
$item = _this.core.getSlideItem(_this.core.index);
|
|
556
|
-
if (!_this.isImageSlide(_this.core.index)) {
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
if (e.touches.length === 2) {
|
|
560
|
-
e.preventDefault();
|
|
561
|
-
if (_this.core.outer.hasClass('lg-first-slide-loading')) {
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
initScale = _this.scale || 1;
|
|
565
|
-
_this.core.outer.removeClass('lg-zoom-drag-transition lg-zoom-dragging');
|
|
566
|
-
_this.setPageCords(e);
|
|
567
|
-
_this.resetImageTranslate(_this.core.index);
|
|
568
|
-
_this.core.touchAction = 'pinch';
|
|
569
|
-
startDist = _this.getTouchDistance(e);
|
|
570
|
-
}
|
|
571
|
-
});
|
|
572
|
-
this.core.$inner.on('touchmove.lg', function (e) {
|
|
573
|
-
if (e.touches.length === 2 &&
|
|
574
|
-
_this.core.touchAction === 'pinch' &&
|
|
575
|
-
(_this.$LG(e.target).hasClass('lg-item') ||
|
|
576
|
-
$item.get().contains(e.target))) {
|
|
577
|
-
e.preventDefault();
|
|
578
|
-
var endDist = _this.getTouchDistance(e);
|
|
579
|
-
var distance = startDist - endDist;
|
|
580
|
-
if (!pinchStarted && Math.abs(distance) > 5) {
|
|
581
|
-
pinchStarted = true;
|
|
582
|
-
}
|
|
583
|
-
if (pinchStarted) {
|
|
584
|
-
prevScale = _this.scale;
|
|
585
|
-
var _scale = Math.max(1, initScale + -distance * 0.02);
|
|
586
|
-
_this.scale =
|
|
587
|
-
Math.round((_scale + Number.EPSILON) * 100) / 100;
|
|
588
|
-
var diff = _this.scale - prevScale;
|
|
589
|
-
_this.zoomImage(_this.scale, Math.round((diff + Number.EPSILON) * 100) / 100, false, false);
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
});
|
|
593
|
-
this.core.$inner.on('touchend.lg', function (e) {
|
|
594
|
-
if (_this.core.touchAction === 'pinch' &&
|
|
595
|
-
(_this.$LG(e.target).hasClass('lg-item') ||
|
|
596
|
-
$item.get().contains(e.target))) {
|
|
597
|
-
pinchStarted = false;
|
|
598
|
-
startDist = 0;
|
|
599
|
-
if (_this.scale <= 1) {
|
|
600
|
-
_this.resetZoom();
|
|
601
|
-
}
|
|
602
|
-
else {
|
|
603
|
-
var actualSizeScale = _this.getCurrentImageActualSizeScale();
|
|
604
|
-
if (_this.scale >= actualSizeScale) {
|
|
605
|
-
var scaleDiff = actualSizeScale - _this.scale;
|
|
606
|
-
if (scaleDiff === 0) {
|
|
607
|
-
scaleDiff = 0.01;
|
|
608
|
-
}
|
|
609
|
-
_this.zoomImage(actualSizeScale, scaleDiff, false, true);
|
|
610
|
-
}
|
|
611
|
-
_this.manageActualPixelClassNames();
|
|
612
|
-
_this.core.outer.addClass('lg-zoomed');
|
|
613
|
-
}
|
|
614
|
-
_this.core.touchAction = undefined;
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
};
|
|
618
|
-
Zoom.prototype.touchendZoom = function (startCoords, endCoords, allowX, allowY, touchDuration) {
|
|
619
|
-
var distanceXnew = endCoords.x - startCoords.x;
|
|
620
|
-
var distanceYnew = endCoords.y - startCoords.y;
|
|
621
|
-
var speedX = Math.abs(distanceXnew) / touchDuration + 1;
|
|
622
|
-
var speedY = Math.abs(distanceYnew) / touchDuration + 1;
|
|
623
|
-
if (speedX > 2) {
|
|
624
|
-
speedX += 1;
|
|
625
|
-
}
|
|
626
|
-
if (speedY > 2) {
|
|
627
|
-
speedY += 1;
|
|
628
|
-
}
|
|
629
|
-
distanceXnew = distanceXnew * speedX;
|
|
630
|
-
distanceYnew = distanceYnew * speedY;
|
|
631
|
-
var _LGel = this.core
|
|
632
|
-
.getSlideItem(this.core.index)
|
|
633
|
-
.find('.lg-img-wrap')
|
|
634
|
-
.first();
|
|
635
|
-
var distance = {};
|
|
636
|
-
distance.x = this.left + distanceXnew;
|
|
637
|
-
distance.y = this.top + distanceYnew;
|
|
638
|
-
var possibleSwipeCords = this.getPossibleSwipeDragCords();
|
|
639
|
-
if (Math.abs(distanceXnew) > 15 || Math.abs(distanceYnew) > 15) {
|
|
640
|
-
if (allowY) {
|
|
641
|
-
if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) {
|
|
642
|
-
distance.y = possibleSwipeCords.minY;
|
|
643
|
-
}
|
|
644
|
-
else if (this.isBeyondPossibleBottom(distance.y, possibleSwipeCords.maxY)) {
|
|
645
|
-
distance.y = possibleSwipeCords.maxY;
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
if (allowX) {
|
|
649
|
-
if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) {
|
|
650
|
-
distance.x = possibleSwipeCords.minX;
|
|
651
|
-
}
|
|
652
|
-
else if (this.isBeyondPossibleRight(distance.x, possibleSwipeCords.maxX)) {
|
|
653
|
-
distance.x = possibleSwipeCords.maxX;
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
if (allowY) {
|
|
657
|
-
this.top = distance.y;
|
|
658
|
-
}
|
|
659
|
-
else {
|
|
660
|
-
distance.y = this.top;
|
|
661
|
-
}
|
|
662
|
-
if (allowX) {
|
|
663
|
-
this.left = distance.x;
|
|
664
|
-
}
|
|
665
|
-
else {
|
|
666
|
-
distance.x = this.left;
|
|
667
|
-
}
|
|
668
|
-
this.setZoomSwipeStyles(_LGel, distance);
|
|
669
|
-
this.positionChanged = true;
|
|
670
|
-
}
|
|
671
|
-
};
|
|
672
|
-
Zoom.prototype.getZoomSwipeCords = function (startCoords, endCoords, allowX, allowY, possibleSwipeCords) {
|
|
673
|
-
var distance = {};
|
|
674
|
-
if (allowY) {
|
|
675
|
-
distance.y = this.top + (endCoords.y - startCoords.y);
|
|
676
|
-
if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) {
|
|
677
|
-
var diffMinY = possibleSwipeCords.minY - distance.y;
|
|
678
|
-
distance.y = possibleSwipeCords.minY - diffMinY / 6;
|
|
679
|
-
}
|
|
680
|
-
else if (this.isBeyondPossibleBottom(distance.y, possibleSwipeCords.maxY)) {
|
|
681
|
-
var diffMaxY = distance.y - possibleSwipeCords.maxY;
|
|
682
|
-
distance.y = possibleSwipeCords.maxY + diffMaxY / 6;
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
else {
|
|
686
|
-
distance.y = this.top;
|
|
687
|
-
}
|
|
688
|
-
if (allowX) {
|
|
689
|
-
distance.x = this.left + (endCoords.x - startCoords.x);
|
|
690
|
-
if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) {
|
|
691
|
-
var diffMinX = possibleSwipeCords.minX - distance.x;
|
|
692
|
-
distance.x = possibleSwipeCords.minX - diffMinX / 6;
|
|
693
|
-
}
|
|
694
|
-
else if (this.isBeyondPossibleRight(distance.x, possibleSwipeCords.maxX)) {
|
|
695
|
-
var difMaxX = distance.x - possibleSwipeCords.maxX;
|
|
696
|
-
distance.x = possibleSwipeCords.maxX + difMaxX / 6;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
else {
|
|
700
|
-
distance.x = this.left;
|
|
701
|
-
}
|
|
702
|
-
return distance;
|
|
703
|
-
};
|
|
704
|
-
Zoom.prototype.isBeyondPossibleLeft = function (x, minX) {
|
|
705
|
-
return x >= minX;
|
|
706
|
-
};
|
|
707
|
-
Zoom.prototype.isBeyondPossibleRight = function (x, maxX) {
|
|
708
|
-
return x <= maxX;
|
|
709
|
-
};
|
|
710
|
-
Zoom.prototype.isBeyondPossibleTop = function (y, minY) {
|
|
711
|
-
return y >= minY;
|
|
712
|
-
};
|
|
713
|
-
Zoom.prototype.isBeyondPossibleBottom = function (y, maxY) {
|
|
714
|
-
return y <= maxY;
|
|
715
|
-
};
|
|
716
|
-
Zoom.prototype.isImageSlide = function (index) {
|
|
717
|
-
var currentItem = this.core.galleryItems[index];
|
|
718
|
-
return this.core.getSlideType(currentItem) === 'image';
|
|
719
|
-
};
|
|
720
|
-
Zoom.prototype.getPossibleSwipeDragCords = function (scale) {
|
|
721
|
-
var $image = this.core
|
|
722
|
-
.getSlideItem(this.core.index)
|
|
723
|
-
.find('.lg-image')
|
|
724
|
-
.first();
|
|
725
|
-
var bottom = this.core.mediaContainerPosition.bottom;
|
|
726
|
-
var imgRect = $image.get().getBoundingClientRect();
|
|
727
|
-
var imageHeight = imgRect.height;
|
|
728
|
-
var imageWidth = imgRect.width;
|
|
729
|
-
if (scale) {
|
|
730
|
-
imageHeight = imageHeight + scale * imageHeight;
|
|
731
|
-
imageWidth = imageWidth + scale * imageWidth;
|
|
732
|
-
}
|
|
733
|
-
var minY = (imageHeight - this.containerRect.height) / 2;
|
|
734
|
-
var maxY = (this.containerRect.height - imageHeight) / 2 + bottom;
|
|
735
|
-
var minX = (imageWidth - this.containerRect.width) / 2;
|
|
736
|
-
var maxX = (this.containerRect.width - imageWidth) / 2;
|
|
737
|
-
var possibleSwipeCords = {
|
|
738
|
-
minY: minY,
|
|
739
|
-
maxY: maxY,
|
|
740
|
-
minX: minX,
|
|
741
|
-
maxX: maxX,
|
|
742
|
-
};
|
|
743
|
-
return possibleSwipeCords;
|
|
744
|
-
};
|
|
745
|
-
Zoom.prototype.setZoomSwipeStyles = function (LGel, distance) {
|
|
746
|
-
LGel.css('transform', 'translate3d(' + distance.x + 'px, ' + distance.y + 'px, 0)');
|
|
747
|
-
};
|
|
748
|
-
Zoom.prototype.zoomSwipe = function () {
|
|
749
|
-
var _this = this;
|
|
750
|
-
var startCoords = {};
|
|
751
|
-
var endCoords = {};
|
|
752
|
-
var isMoved = false;
|
|
753
|
-
// Allow x direction drag
|
|
754
|
-
var allowX = false;
|
|
755
|
-
// Allow Y direction drag
|
|
756
|
-
var allowY = false;
|
|
757
|
-
var startTime = new Date();
|
|
758
|
-
var endTime = new Date();
|
|
759
|
-
var possibleSwipeCords;
|
|
760
|
-
var _LGel;
|
|
761
|
-
var $item = this.core.getSlideItem(this.core.index);
|
|
762
|
-
this.core.$inner.on('touchstart.lg', function (e) {
|
|
763
|
-
// Allow zoom only on image
|
|
764
|
-
if (!_this.isImageSlide(_this.core.index)) {
|
|
765
|
-
return;
|
|
766
|
-
}
|
|
767
|
-
$item = _this.core.getSlideItem(_this.core.index);
|
|
768
|
-
if ((_this.$LG(e.target).hasClass('lg-item') ||
|
|
769
|
-
$item.get().contains(e.target)) &&
|
|
770
|
-
e.touches.length === 1 &&
|
|
771
|
-
_this.core.outer.hasClass('lg-zoomed')) {
|
|
772
|
-
e.preventDefault();
|
|
773
|
-
startTime = new Date();
|
|
774
|
-
_this.core.touchAction = 'zoomSwipe';
|
|
775
|
-
_LGel = _this.core
|
|
776
|
-
.getSlideItem(_this.core.index)
|
|
777
|
-
.find('.lg-img-wrap')
|
|
778
|
-
.first();
|
|
779
|
-
var dragAllowedAxises = _this.getDragAllowedAxises(0);
|
|
780
|
-
allowY = dragAllowedAxises.allowY;
|
|
781
|
-
allowX = dragAllowedAxises.allowX;
|
|
782
|
-
if (allowX || allowY) {
|
|
783
|
-
startCoords = _this.getSwipeCords(e);
|
|
784
|
-
}
|
|
785
|
-
possibleSwipeCords = _this.getPossibleSwipeDragCords();
|
|
786
|
-
// reset opacity and transition duration
|
|
787
|
-
_this.core.outer.addClass('lg-zoom-dragging lg-zoom-drag-transition');
|
|
788
|
-
}
|
|
789
|
-
});
|
|
790
|
-
this.core.$inner.on('touchmove.lg', function (e) {
|
|
791
|
-
if (e.touches.length === 1 &&
|
|
792
|
-
_this.core.touchAction === 'zoomSwipe' &&
|
|
793
|
-
(_this.$LG(e.target).hasClass('lg-item') ||
|
|
794
|
-
$item.get().contains(e.target))) {
|
|
795
|
-
e.preventDefault();
|
|
796
|
-
_this.core.touchAction = 'zoomSwipe';
|
|
797
|
-
endCoords = _this.getSwipeCords(e);
|
|
798
|
-
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords);
|
|
799
|
-
if (Math.abs(endCoords.x - startCoords.x) > 15 ||
|
|
800
|
-
Math.abs(endCoords.y - startCoords.y) > 15) {
|
|
801
|
-
isMoved = true;
|
|
802
|
-
_this.setZoomSwipeStyles(_LGel, distance);
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
});
|
|
806
|
-
this.core.$inner.on('touchend.lg', function (e) {
|
|
807
|
-
if (_this.core.touchAction === 'zoomSwipe' &&
|
|
808
|
-
(_this.$LG(e.target).hasClass('lg-item') ||
|
|
809
|
-
$item.get().contains(e.target))) {
|
|
810
|
-
e.preventDefault();
|
|
811
|
-
_this.core.touchAction = undefined;
|
|
812
|
-
_this.core.outer.removeClass('lg-zoom-dragging');
|
|
813
|
-
if (!isMoved) {
|
|
814
|
-
return;
|
|
815
|
-
}
|
|
816
|
-
isMoved = false;
|
|
817
|
-
endTime = new Date();
|
|
818
|
-
var touchDuration = endTime.valueOf() - startTime.valueOf();
|
|
819
|
-
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration);
|
|
820
|
-
}
|
|
821
|
-
});
|
|
822
|
-
};
|
|
823
|
-
Zoom.prototype.zoomDrag = function () {
|
|
824
|
-
var _this = this;
|
|
825
|
-
var startCoords = {};
|
|
826
|
-
var endCoords = {};
|
|
827
|
-
var isDragging = false;
|
|
828
|
-
var isMoved = false;
|
|
829
|
-
// Allow x direction drag
|
|
830
|
-
var allowX = false;
|
|
831
|
-
// Allow Y direction drag
|
|
832
|
-
var allowY = false;
|
|
833
|
-
var startTime;
|
|
834
|
-
var endTime;
|
|
835
|
-
var possibleSwipeCords;
|
|
836
|
-
var _LGel;
|
|
837
|
-
this.core.outer.on('mousedown.lg.zoom', function (e) {
|
|
838
|
-
// Allow zoom only on image
|
|
839
|
-
if (!_this.isImageSlide(_this.core.index)) {
|
|
840
|
-
return;
|
|
841
|
-
}
|
|
842
|
-
var $item = _this.core.getSlideItem(_this.core.index);
|
|
843
|
-
if (_this.$LG(e.target).hasClass('lg-item') ||
|
|
844
|
-
$item.get().contains(e.target)) {
|
|
845
|
-
startTime = new Date();
|
|
846
|
-
_LGel = _this.core
|
|
847
|
-
.getSlideItem(_this.core.index)
|
|
848
|
-
.find('.lg-img-wrap')
|
|
849
|
-
.first();
|
|
850
|
-
var dragAllowedAxises = _this.getDragAllowedAxises(0);
|
|
851
|
-
allowY = dragAllowedAxises.allowY;
|
|
852
|
-
allowX = dragAllowedAxises.allowX;
|
|
853
|
-
if (_this.core.outer.hasClass('lg-zoomed')) {
|
|
854
|
-
if (_this.$LG(e.target).hasClass('lg-object') &&
|
|
855
|
-
(allowX || allowY)) {
|
|
856
|
-
e.preventDefault();
|
|
857
|
-
startCoords = _this.getDragCords(e);
|
|
858
|
-
possibleSwipeCords = _this.getPossibleSwipeDragCords();
|
|
859
|
-
isDragging = true;
|
|
860
|
-
_this.core.outer
|
|
861
|
-
.removeClass('lg-grab')
|
|
862
|
-
.addClass('lg-grabbing lg-zoom-drag-transition lg-zoom-dragging');
|
|
863
|
-
// reset opacity and transition duration
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
});
|
|
868
|
-
this.$LG(window).on("mousemove.lg.zoom.global" + this.core.lgId, function (e) {
|
|
869
|
-
if (isDragging) {
|
|
870
|
-
isMoved = true;
|
|
871
|
-
endCoords = _this.getDragCords(e);
|
|
872
|
-
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords);
|
|
873
|
-
_this.setZoomSwipeStyles(_LGel, distance);
|
|
874
|
-
}
|
|
875
|
-
});
|
|
876
|
-
this.$LG(window).on("mouseup.lg.zoom.global" + this.core.lgId, function (e) {
|
|
877
|
-
if (isDragging) {
|
|
878
|
-
endTime = new Date();
|
|
879
|
-
isDragging = false;
|
|
880
|
-
_this.core.outer.removeClass('lg-zoom-dragging');
|
|
881
|
-
// Fix for chrome mouse move on click
|
|
882
|
-
if (isMoved &&
|
|
883
|
-
(startCoords.x !== endCoords.x ||
|
|
884
|
-
startCoords.y !== endCoords.y)) {
|
|
885
|
-
endCoords = _this.getDragCords(e);
|
|
886
|
-
var touchDuration = endTime.valueOf() - startTime.valueOf();
|
|
887
|
-
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration);
|
|
888
|
-
}
|
|
889
|
-
isMoved = false;
|
|
890
|
-
}
|
|
891
|
-
_this.core.outer.removeClass('lg-grabbing').addClass('lg-grab');
|
|
892
|
-
});
|
|
893
|
-
};
|
|
894
|
-
Zoom.prototype.closeGallery = function () {
|
|
895
|
-
this.resetZoom();
|
|
896
|
-
this.zoomInProgress = false;
|
|
897
|
-
};
|
|
898
|
-
Zoom.prototype.destroy = function () {
|
|
899
|
-
// Unbind all events added by lightGallery zoom plugin
|
|
900
|
-
this.$LG(window).off(".lg.zoom.global" + this.core.lgId);
|
|
901
|
-
this.core.LGel.off('.lg.zoom');
|
|
902
|
-
this.core.LGel.off('.zoom');
|
|
903
|
-
clearTimeout(this.zoomableTimeout);
|
|
904
|
-
this.zoomableTimeout = false;
|
|
905
|
-
};
|
|
906
|
-
return Zoom;
|
|
907
|
-
}());
|
|
908
|
-
exports.default = Zoom;
|
|
909
|
-
//# sourceMappingURL=lg-zoom.js.map
|