diff --git a/dist/css/lg-rotate.css b/dist/css/lg-rotate.css index 575622876..080d00e8d 100644 --- a/dist/css/lg-rotate.css +++ b/dist/css/lg-rotate.css @@ -21,6 +21,13 @@ pointer-events: none; } +.lg-outer .lg-img-rotate:before { + content: ''; + display: inline-block; + height: 100%; + vertical-align: middle; +} + .lg-rotate-left:after { content: '\e900'; } diff --git a/dist/css/lg-zoom.css b/dist/css/lg-zoom.css index bd97492bd..abf6893c0 100644 --- a/dist/css/lg-zoom.css +++ b/dist/css/lg-zoom.css @@ -32,24 +32,56 @@ .lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img { -webkit-transform: scale3d(1, 1, 1); transform: scale3d(1, 1, 1); - will-change: opacity, transform; -webkit-transition: -webkit-transform 0.5s cubic-bezier(0.12, 0.415, 0.01, 1.19) 0s, opacity 0.15s !important; -moz-transition: -moz-transform 0.5s cubic-bezier(0.12, 0.415, 0.01, 1.19) 0s, opacity 0.15s !important; -o-transition: -o-transform 0.5s cubic-bezier(0.12, 0.415, 0.01, 1.19) 0s, opacity 0.15s !important; transition: transform 0.5s cubic-bezier(0.12, 0.415, 0.01, 1.19) 0s, opacity 0.15s !important; - -webkit-transform-origin: 0 0; - -moz-transform-origin: 0 0; - -ms-transform-origin: 0 0; - transform-origin: 0 0; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; backface-visibility: hidden; } +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.no-transition, +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.no-transition { + transition: none !important; +} + +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition, +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition { + transform: scale3d(1, 1, 1) translate3d(-50%, -50%, 0px) !important; + max-width: none !important; + max-height: none !important; + top: 50% !important; + left: 50% !important; +} + +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition-x, +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition-x { + transform: scale3d(1, 1, 1) translate3d(-50%, 0, 0px) !important; + top: 0 !important; + left: 50% !important; + max-width: none !important; + max-height: none !important; +} + +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition-y, +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition-y { + transform: scale3d(1, 1, 1) translate3d(0, -50%, 0px) !important; + top: 50% !important; + left: 0% !important; + max-width: none !important; + max-height: none !important; +} + .lg-icon.lg-zoom-in:after { content: '\e311'; } +.lg-actual-size .lg-icon.lg-zoom-in { + opacity: 0.5; + pointer-events: none; +} + .lg-icon.lg-actual-size { font-size: 20px; } diff --git a/dist/css/lightgallery-bundle.css b/dist/css/lightgallery-bundle.css index c6309a3e0..8e4fb3e78 100644 --- a/dist/css/lightgallery-bundle.css +++ b/dist/css/lightgallery-bundle.css @@ -675,24 +675,56 @@ body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-co .lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img { -webkit-transform: scale3d(1, 1, 1); transform: scale3d(1, 1, 1); - will-change: opacity, transform; -webkit-transition: -webkit-transform 0.5s cubic-bezier(0.12, 0.415, 0.01, 1.19) 0s, opacity 0.15s !important; -moz-transition: -moz-transform 0.5s cubic-bezier(0.12, 0.415, 0.01, 1.19) 0s, opacity 0.15s !important; -o-transition: -o-transform 0.5s cubic-bezier(0.12, 0.415, 0.01, 1.19) 0s, opacity 0.15s !important; transition: transform 0.5s cubic-bezier(0.12, 0.415, 0.01, 1.19) 0s, opacity 0.15s !important; - -webkit-transform-origin: 0 0; - -moz-transform-origin: 0 0; - -ms-transform-origin: 0 0; - transform-origin: 0 0; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; backface-visibility: hidden; } +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.no-transition, +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.no-transition { + transition: none !important; +} + +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition, +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition { + transform: scale3d(1, 1, 1) translate3d(-50%, -50%, 0px) !important; + max-width: none !important; + max-height: none !important; + top: 50% !important; + left: 50% !important; +} + +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition-x, +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition-x { + transform: scale3d(1, 1, 1) translate3d(-50%, 0, 0px) !important; + top: 0 !important; + left: 50% !important; + max-width: none !important; + max-height: none !important; +} + +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition-y, +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition-y { + transform: scale3d(1, 1, 1) translate3d(0, -50%, 0px) !important; + top: 50% !important; + left: 0% !important; + max-width: none !important; + max-height: none !important; +} + .lg-icon.lg-zoom-in:after { content: '\e311'; } +.lg-actual-size .lg-icon.lg-zoom-in { + opacity: 0.5; + pointer-events: none; +} + .lg-icon.lg-actual-size { font-size: 20px; } @@ -1125,6 +1157,13 @@ body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-co pointer-events: none; } +.lg-outer .lg-img-rotate:before { + content: ''; + display: inline-block; + height: 100%; + vertical-align: middle; +} + .lg-rotate-left:after { content: '\e900'; } diff --git a/dist/css/lightgallery-bundle.min.css b/dist/css/lightgallery-bundle.min.css index 653670c0a..a7ef6c1ac 100644 --- a/dist/css/lightgallery-bundle.min.css +++ b/dist/css/lightgallery-bundle.min.css @@ -1 +1 @@ -@font-face{font-family:lg;src:url(../fonts/lg.woff2?io9a6k) format("woff2"),url(../fonts/lg.ttf?io9a6k) format("truetype"),url(../fonts/lg.woff?io9a6k) format("woff"),url(../fonts/lg.svg?io9a6k#lg) format("svg");font-weight:400;font-style:normal;font-display:block}.lg-icon{font-family:lg!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.lg-container{font-family:system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Sans','Liberation Sans',sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'}.lg-next,.lg-prev{background-color:rgba(0,0,0,.45);border-radius:2px;color:#999;cursor:pointer;display:block;font-size:22px;margin-top:-10px;padding:8px 10px 9px;position:absolute;top:50%;z-index:1080;outline:0;border:none}.lg-next.disabled,.lg-prev.disabled{opacity:0!important;cursor:default}.lg-next:hover:not(.disabled),.lg-prev:hover:not(.disabled){color:#fff}.lg-single-item .lg-next,.lg-single-item .lg-prev{display:none}.lg-next{right:20px}.lg-next:before{content:'\e095'}.lg-prev{left:20px}.lg-prev:after{content:'\e094'}@-webkit-keyframes lg-right-end{0%{left:0}50%{left:-30px}100%{left:0}}@-moz-keyframes lg-right-end{0%{left:0}50%{left:-30px}100%{left:0}}@-ms-keyframes lg-right-end{0%{left:0}50%{left:-30px}100%{left:0}}@keyframes lg-right-end{0%{left:0}50%{left:-30px}100%{left:0}}@-webkit-keyframes lg-left-end{0%{left:0}50%{left:30px}100%{left:0}}@-moz-keyframes lg-left-end{0%{left:0}50%{left:30px}100%{left:0}}@-ms-keyframes lg-left-end{0%{left:0}50%{left:30px}100%{left:0}}@keyframes lg-left-end{0%{left:0}50%{left:30px}100%{left:0}}.lg-outer.lg-right-end .lg-object{-webkit-animation:lg-right-end .3s;-o-animation:lg-right-end .3s;animation:lg-right-end .3s;position:relative}.lg-outer.lg-left-end .lg-object{-webkit-animation:lg-left-end .3s;-o-animation:lg-left-end .3s;animation:lg-left-end .3s;position:relative}.lg-toolbar{z-index:1082;left:0;position:absolute;top:0;width:100%}.lg-media-overlap .lg-toolbar{background-image:linear-gradient(0deg,rgba(0,0,0,0),rgba(0,0,0,.4))}.lg-toolbar .lg-icon{color:#999;cursor:pointer;float:right;font-size:24px;height:47px;line-height:27px;padding:10px 0;text-align:center;width:50px;text-decoration:none!important;outline:medium none;will-change:color;-webkit-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear;background:0 0;border:none;box-shadow:none}.lg-toolbar .lg-icon.lg-icon-18{font-size:18px}.lg-toolbar .lg-icon:hover{color:#fff}.lg-toolbar .lg-close:after{content:'\e070'}.lg-toolbar .lg-maximize{font-size:22px}.lg-toolbar .lg-maximize:after{content:'\e90a'}.lg-toolbar .lg-download:after{content:'\e0f2'}.lg-sub-html{color:#eee;font-size:16px;padding:10px 40px;text-align:center;z-index:1080;opacity:0;-webkit-transition:opacity .2s ease-out 0s;-o-transition:opacity .2s ease-out 0s;transition:opacity .2s ease-out 0s}.lg-sub-html h4{margin:0;font-size:13px;font-weight:700}.lg-sub-html p{font-size:12px;margin:5px 0 0}.lg-sub-html a{color:inherit}.lg-sub-html a:hover{text-decoration:underline}.lg-media-overlap .lg-sub-html{background-image:linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,.6))}.lg-item .lg-sub-html{position:absolute;bottom:0;right:0;left:0}.lg-error-msg{font-size:14px;color:#999}.lg-counter{color:#999;display:inline-block;font-size:16px;padding-left:20px;padding-top:12px;height:47px;vertical-align:middle}.lg-closing .lg-next,.lg-closing .lg-prev,.lg-closing .lg-sub-html,.lg-closing .lg-toolbar{opacity:0;-webkit-transition:-webkit-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;-moz-transition:-moz-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;-o-transition:-o-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;transition:transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-img-wrap,body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-video-cont{opacity:0;-moz-transform:scale3d(.5,.5,.5);-o-transform:scale3d(.5,.5,.5);-ms-transform:scale3d(.5,.5,.5);-webkit-transform:scale3d(.5,.5,.5);transform:scale3d(.5,.5,.5);will-change:transform,opacity;-webkit-transition:-webkit-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-moz-transition:-moz-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-o-transition:-o-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;transition:transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-img-wrap,body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-video-cont{opacity:1;-moz-transform:scale3d(1,1,1);-o-transform:scale3d(1,1,1);-ms-transform:scale3d(1,1,1);-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}.lg-icon:focus-visible{color:#fff;border-radius:3px;outline:1px dashed rgba(255,255,255,.6)}.lg-toolbar .lg-icon:focus-visible{border-radius:8px;outline-offset:-5px}.lg-outer .lg-thumb-outer{background-color:#0d0a0a;width:100%;max-height:350px;overflow:hidden;float:left}.lg-outer .lg-thumb-outer.lg-grab .lg-thumb-item{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer .lg-thumb-outer.lg-grabbing .lg-thumb-item{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg-thumb-outer.lg-dragging .lg-thumb{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-outer .lg-thumb-outer.lg-rebuilding-thumbnails .lg-thumb{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-outer .lg-thumb-outer.lg-thumb-align-middle{text-align:center}.lg-outer .lg-thumb-outer.lg-thumb-align-left{text-align:left}.lg-outer .lg-thumb-outer.lg-thumb-align-right{text-align:right}.lg-outer.lg-single-item .lg-thumb-outer{display:none}.lg-outer .lg-thumb{padding:5px 0;height:100%;margin-bottom:-5px;display:inline-block;vertical-align:middle}@media (min-width:768px){.lg-outer .lg-thumb{padding:10px 0}}.lg-outer .lg-thumb-item{cursor:pointer;float:left;overflow:hidden;height:100%;border-radius:2px;margin-bottom:5px;will-change:border-color}@media (min-width:768px){.lg-outer .lg-thumb-item{border-radius:4px;border:2px solid #fff;-webkit-transition:border-color .25s ease;-o-transition:border-color .25s ease;transition:border-color .25s ease}}.lg-outer .lg-thumb-item.active,.lg-outer .lg-thumb-item:hover{border-color:#a90707}.lg-outer .lg-thumb-item img{width:100%;height:100%;object-fit:cover;display:block}.lg-outer.lg-can-toggle .lg-item{padding-bottom:0}.lg-outer .lg-toggle-thumb:after{content:'\e1ff'}.lg-outer.lg-animate-thumb .lg-thumb{-webkit-transition-timing-function:cubic-bezier(.215,.61,.355,1);transition-timing-function:cubic-bezier(.215,.61,.355,1)}.lg-outer .lg-video-cont{text-align:center;display:inline-block;vertical-align:middle;position:relative}.lg-outer .lg-video-cont .lg-object{width:100%!important;height:100%!important}.lg-outer .lg-has-iframe .lg-video-cont{-webkit-overflow-scrolling:touch;overflow:auto}.lg-outer .lg-video-object{position:absolute;left:0;right:0;width:100%;height:100%;top:0;bottom:0;z-index:3}.lg-outer .lg-video-poster{z-index:1}.lg-outer .lg-has-video .lg-video-object{opacity:0;will-change:opacity;-webkit-transition:opacity .3s ease-in;-o-transition:opacity .3s ease-in;transition:opacity .3s ease-in}.lg-outer .lg-has-video.lg-video-loaded .lg-video-play-button,.lg-outer .lg-has-video.lg-video-loaded .lg-video-poster{opacity:0!important}.lg-outer .lg-has-video.lg-video-loaded .lg-video-object{opacity:1}@keyframes lg-play-stroke{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes lg-play-rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.lg-video-play-button{width:18%;max-width:140px;position:absolute;top:50%;left:50%;z-index:2;cursor:pointer;transform:translate(-50%,-50%) scale(1);will-change:opacity,transform;-webkit-transition:-webkit-transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s;-moz-transition:-moz-transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s;-o-transition:-o-transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s;transition:transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s}.lg-video-play-button:hover .lg-video-play-icon,.lg-video-play-button:hover .lg-video-play-icon-bg{opacity:1}.lg-video-play-icon-bg{fill:none;stroke-width:3%;stroke:#fcfcfc;opacity:.6;will-change:opacity;-webkit-transition:opacity .12s ease-in;-o-transition:opacity .12s ease-in;transition:opacity .12s ease-in}.lg-video-play-icon-circle{position:absolute;top:0;left:0;bottom:0;right:0;fill:none;stroke-width:3%;stroke:rgba(30,30,30,.9);stroke-opacity:1;stroke-linecap:round;stroke-dasharray:200;stroke-dashoffset:200}.lg-video-play-icon{position:absolute;width:25%;max-width:120px;left:50%;top:50%;transform:translate3d(-50%,-50%,0);opacity:.6;will-change:opacity;-webkit-transition:opacity .12s ease-in;-o-transition:opacity .12s ease-in;transition:opacity .12s ease-in}.lg-video-play-icon .lg-video-play-icon-inner{fill:#fcfcfc}.lg-video-loading .lg-video-play-icon-circle{animation:lg-play-rotate 2s linear .25s infinite,lg-play-stroke 1.5s ease-in-out .25s infinite}.lg-video-loaded .lg-video-play-button{opacity:0;transform:translate(-50%,-50%) scale(.7)}.lg-progress-bar{background-color:#333;height:5px;left:0;position:absolute;top:0;width:100%;z-index:1083;opacity:0;will-change:opacity;-webkit-transition:opacity 80ms ease 0s;-moz-transition:opacity 80ms ease 0s;-o-transition:opacity 80ms ease 0s;transition:opacity 80ms ease 0s}.lg-progress-bar .lg-progress{background-color:#a90707;height:5px;width:0}.lg-progress-bar.lg-start .lg-progress{width:100%}.lg-show-autoplay .lg-progress-bar{opacity:1}.lg-autoplay-button:after{content:'\e01d'}.lg-show-autoplay .lg-autoplay-button:after{content:'\e01a'}.lg-single-item .lg-autoplay-button{opacity:.75;pointer-events:none}.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-image,.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap{will-change:transform;-webkit-transition:-webkit-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s;-moz-transition:-moz-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s;-o-transition:-o-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s;transition:transform .5s cubic-bezier(.12,.415,.01,1.19) 0s}.lg-outer.lg-use-transition-for-zoom.lg-zoom-drag-transition .lg-item.lg-complete.lg-zoomable .lg-img-wrap{will-change:transform;-webkit-transition:-webkit-transform .8s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .8s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .8s cubic-bezier(0,0,.25,1) 0s;transition:transform .8s cubic-bezier(0,0,.25,1) 0s}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1);will-change:opacity,transform;-webkit-transition:-webkit-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;-moz-transition:-moz-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;-o-transition:-o-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;transition:transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-icon.lg-zoom-in:after{content:'\e311'}.lg-icon.lg-actual-size{font-size:20px}.lg-icon.lg-actual-size:after{content:'\e033'}.lg-icon.lg-zoom-out{opacity:.5;pointer-events:none}.lg-icon.lg-zoom-out:after{content:'\e312'}.lg-zoomed .lg-icon.lg-zoom-out{opacity:1;pointer-events:auto}.lg-outer.lg-first-slide-loading .lg-actual-size,.lg-outer.lg-first-slide-loading .lg-zoom-in,.lg-outer.lg-first-slide-loading .lg-zoom-out,.lg-outer[data-lg-slide-type=iframe] .lg-actual-size,.lg-outer[data-lg-slide-type=iframe] .lg-zoom-in,.lg-outer[data-lg-slide-type=iframe] .lg-zoom-out,.lg-outer[data-lg-slide-type=video] .lg-actual-size,.lg-outer[data-lg-slide-type=video] .lg-zoom-in,.lg-outer[data-lg-slide-type=video] .lg-zoom-out{opacity:.75;pointer-events:none}.lg-outer .lg-pager-outer{text-align:center;z-index:1080;height:10px;margin-bottom:10px}.lg-outer .lg-pager-outer.lg-pager-hover .lg-pager-cont{overflow:visible}.lg-outer.lg-single-item .lg-pager-outer{display:none}.lg-outer .lg-pager-cont{cursor:pointer;display:inline-block;overflow:hidden;position:relative;vertical-align:top;margin:0 5px}.lg-outer .lg-pager-cont:hover .lg-pager-thumb-cont{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.lg-outer .lg-pager-cont.lg-pager-active .lg-pager{box-shadow:0 0 0 2px #fff inset}.lg-outer .lg-pager-thumb-cont{background-color:#fff;color:#fff;bottom:100%;height:83px;left:0;margin-bottom:20px;margin-left:-60px;opacity:0;padding:5px;position:absolute;width:120px;border-radius:3px;will-change:transform,opacity;-webkit-transition:opacity .15s ease 0s,-webkit-transform .15s ease 0s;-moz-transition:opacity .15s ease 0s,-moz-transform .15s ease 0s;-o-transition:opacity .15s ease 0s,-o-transform .15s ease 0s;transition:opacity .15s ease 0s,transform .15s ease 0s;-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0)}.lg-outer .lg-pager-thumb-cont img{width:100%;height:100%}.lg-outer .lg-pager{background-color:rgba(255,255,255,.5);border-radius:50%;box-shadow:0 0 0 8px rgba(255,255,255,.7) inset;display:block;height:12px;-webkit-transition:box-shadow .3s ease 0s;-o-transition:box-shadow .3s ease 0s;transition:box-shadow .3s ease 0s;width:12px}.lg-outer .lg-pager:focus,.lg-outer .lg-pager:hover{box-shadow:0 0 0 8px #fff inset}.lg-outer .lg-caret{border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px dashed;bottom:-10px;display:inline-block;height:0;left:50%;margin-left:-5px;position:absolute;vertical-align:middle;width:0}.lg-fullscreen:after{content:"\e20c"}.lg-fullscreen-on .lg-fullscreen:after{content:"\e20d"}.lg-outer .lg-dropdown-overlay{background-color:rgba(0,0,0,.25);bottom:0;cursor:default;left:0;position:absolute;right:0;top:0;z-index:1081;opacity:0;visibility:hidden;will-change:visibility,opacity;-webkit-transition:visibility 0s linear .18s,opacity .18s linear 0s;-o-transition:visibility 0s linear .18s,opacity .18s linear 0s;transition:visibility 0s linear .18s,opacity .18s linear 0s}.lg-outer.lg-dropdown-active .lg-dropdown,.lg-outer.lg-dropdown-active .lg-dropdown-overlay{-webkit-transition-delay:0s;transition-delay:0s;-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;visibility:visible}.lg-outer.lg-dropdown-active .lg-share{color:#fff}.lg-outer .lg-dropdown{background-color:#fff;border-radius:2px;font-size:14px;list-style-type:none;margin:0;padding:10px 0;position:absolute;right:0;text-align:left;top:50px;opacity:0;visibility:hidden;-moz-transform:translate3d(0,5px,0);-o-transform:translate3d(0,5px,0);-ms-transform:translate3d(0,5px,0);-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0);will-change:visibility,opacity,transform;-webkit-transition:-webkit-transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s;-moz-transition:-moz-transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s;-o-transition:-o-transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s;transition:transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s}.lg-outer .lg-dropdown:after{content:'';display:block;height:0;width:0;position:absolute;border:8px solid transparent;border-bottom-color:#fff;right:16px;top:-16px}.lg-outer .lg-dropdown>li:last-child{margin-bottom:0}.lg-outer .lg-dropdown>li:hover a{color:#333}.lg-outer .lg-dropdown a{color:#333;display:block;white-space:pre;padding:4px 12px;font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:12px}.lg-outer .lg-dropdown a:hover{background-color:rgba(0,0,0,.07)}.lg-outer .lg-dropdown .lg-dropdown-text{display:inline-block;line-height:1;margin-top:-3px;vertical-align:middle}.lg-outer .lg-dropdown .lg-icon{color:#333;display:inline-block;float:none;font-size:20px;height:auto;line-height:1;margin-right:8px;padding:0;vertical-align:middle;width:auto}.lg-outer .lg-share{position:relative}.lg-outer .lg-share:after{content:'\e80d'}.lg-outer .lg-share-facebook .lg-icon{color:#3b5998}.lg-outer .lg-share-facebook .lg-icon:after{content:'\e904'}.lg-outer .lg-share-twitter .lg-icon{color:#00aced}.lg-outer .lg-share-twitter .lg-icon:after{content:'\e907'}.lg-outer .lg-share-pinterest .lg-icon{color:#cb2027}.lg-outer .lg-share-pinterest .lg-icon:after{content:'\e906'}.lg-comment-box{width:420px;max-width:100%;position:absolute;right:0;top:0;bottom:0;z-index:9999;background-color:#fff;will-change:transform;-moz-transform:translate3d(100%,0,0);-o-transform:translate3d(100%,0,0);-ms-transform:translate3d(100%,0,0);-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);-webkit-transition:-webkit-transform .4s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .4s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .4s cubic-bezier(0,0,.25,1) 0s;transition:transform .4s cubic-bezier(0,0,.25,1) 0s}.lg-comment-box .lg-comment-title{margin:0;color:#fff;font-size:18px}.lg-comment-box .lg-comment-header{background-color:#000;padding:12px 20px;position:absolute;left:0;right:0;top:0}.lg-comment-box .lg-comment-body{height:100%!important;padding-top:43px!important;width:100%!important}.lg-comment-box .fb-comments{height:100%;width:100%;background:url(../images/loading.gif) no-repeat scroll center center #fff;overflow-y:auto;display:inline-block}.lg-comment-box .fb-comments[fb-xfbml-state=rendered]{background-image:none}.lg-comment-box .fb-comments>span{max-width:100%}.lg-comment-box .lg-comment-close{position:absolute;right:5px;top:12px;cursor:pointer;font-size:20px;color:#999;will-change:color;-webkit-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear}.lg-comment-box .lg-comment-close:hover{color:#fff}.lg-comment-box .lg-comment-close:after{content:'\e070'}.lg-comment-box iframe{max-width:100%!important;width:100%!important}.lg-comment-box #disqus_thread{padding:0 20px}.lg-outer .lg-comment-overlay{background-color:rgba(0,0,0,.25);bottom:0;cursor:default;left:0;position:fixed;right:0;top:0;z-index:1081;opacity:0;visibility:hidden;will-change:visibility,opacity;-webkit-transition:visibility 0s linear .18s,opacity .18s linear 0s;-o-transition:visibility 0s linear .18s,opacity .18s linear 0s;transition:visibility 0s linear .18s,opacity .18s linear 0s}.lg-outer .lg-comment-toggle:after{content:'\e908'}.lg-outer.lg-comment-active .lg-comment-overlay{-webkit-transition-delay:0s;transition-delay:0s;-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;visibility:visible}.lg-outer.lg-comment-active .lg-comment-toggle{color:#fff}.lg-outer.lg-comment-active .lg-comment-box{-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.lg-outer .lg-img-rotate{position:absolute;left:0;right:0;top:0;bottom:0;-webkit-transition:-webkit-transform .4s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .4s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .4s cubic-bezier(0,0,.25,1) 0s;transition:transform .4s cubic-bezier(0,0,.25,1) 0s}.lg-outer[data-lg-slide-type=iframe] .lg-flip-hor,.lg-outer[data-lg-slide-type=iframe] .lg-flip-ver,.lg-outer[data-lg-slide-type=iframe] .lg-rotate-left,.lg-outer[data-lg-slide-type=iframe] .lg-rotate-right,.lg-outer[data-lg-slide-type=video] .lg-flip-hor,.lg-outer[data-lg-slide-type=video] .lg-flip-ver,.lg-outer[data-lg-slide-type=video] .lg-rotate-left,.lg-outer[data-lg-slide-type=video] .lg-rotate-right{opacity:.75;pointer-events:none}.lg-rotate-left:after{content:'\e900'}.lg-rotate-right:after{content:'\e901'}.lg-icon.lg-flip-hor,.lg-icon.lg-flip-ver{font-size:26px}.lg-flip-ver:after{content:'\e903'}.lg-flip-hor:after{content:'\e902'}.lg-medium-zoom-item{cursor:zoom-in}.lg-medium-zoom .lg-outer{cursor:zoom-out}.lg-medium-zoom .lg-outer.lg-grab img.lg-object{cursor:zoom-out}.lg-medium-zoom .lg-outer.lg-grabbing img.lg-object{cursor:zoom-out}.lg-relative-caption .lg-outer .lg-sub-html{white-space:normal;bottom:auto;padding:0;background-image:none}.lg-relative-caption .lg-outer .lg-relative-caption-item{opacity:0;padding:16px 0;transition:.5s opacity ease}.lg-relative-caption .lg-outer .lg-show-caption .lg-relative-caption-item{opacity:1}.lg-group:after{content:'';display:table;clear:both}.lg-container{display:none;outline:0}.lg-container.lg-show{display:block}.lg-on{scroll-behavior:unset}.lg-overlay-open{overflow:hidden}.lg-hide-sub-html .lg-sub-html,.lg-next,.lg-pager-outer,.lg-prev,.lg-toolbar{opacity:0;will-change:transform,opacity;-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;transition:transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s}.lg-show-in .lg-next,.lg-show-in .lg-pager-outer,.lg-show-in .lg-prev,.lg-show-in .lg-toolbar{opacity:1}.lg-show-in.lg-hide-sub-html .lg-sub-html{opacity:1}.lg-show-in .lg-hide-items .lg-prev{opacity:0;-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}.lg-show-in .lg-hide-items .lg-next{opacity:0;-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}.lg-show-in .lg-hide-items .lg-toolbar{opacity:0;-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}.lg-show-in .lg-hide-items.lg-hide-sub-html .lg-sub-html{opacity:0;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}.lg-outer{width:100%;height:100%;position:fixed;top:0;left:0;z-index:1050;text-align:left;opacity:.001;outline:0;will-change:auto;overflow:hidden;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-outer *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lg-outer.lg-zoom-from-image{opacity:1}.lg-outer.lg-visible{opacity:1}.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-current,.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-next-slide,.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-prev-slide{-webkit-transition-duration:inherit!important;transition-duration:inherit!important;-webkit-transition-timing-function:inherit!important;transition-timing-function:inherit!important}.lg-outer.lg-css3.lg-dragging .lg-item.lg-current,.lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide,.lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-outer.lg-grab img.lg-object{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer.lg-grabbing img.lg-object{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg-content{position:absolute;top:0;left:0;right:0;bottom:0}.lg-outer .lg-inner{width:100%;position:absolute;left:0;top:0;bottom:0;-webkit-transition:opacity 0s;-o-transition:opacity 0s;transition:opacity 0s;white-space:nowrap}.lg-outer .lg-item{display:none!important}.lg-outer .lg-item:not(.lg-start-end-progress){background:url(../images/loading.gif) no-repeat scroll center center transparent}.lg-outer.lg-css3 .lg-current,.lg-outer.lg-css3 .lg-next-slide,.lg-outer.lg-css3 .lg-prev-slide{display:inline-block!important}.lg-outer.lg-css .lg-current{display:inline-block!important}.lg-outer .lg-img-wrap,.lg-outer .lg-item{display:inline-block;text-align:center;position:absolute;width:100%;height:100%}.lg-outer .lg-img-wrap:before,.lg-outer .lg-item:before{content:'';display:inline-block;height:100%;vertical-align:middle}.lg-outer .lg-img-wrap{position:absolute;left:0;right:0;top:0;bottom:0;white-space:nowrap;font-size:0}.lg-outer .lg-item.lg-complete{background-image:none}.lg-outer .lg-item.lg-current{z-index:1060}.lg-outer .lg-object{display:inline-block;vertical-align:middle;max-width:100%;max-height:100%;width:auto;height:auto;position:relative}.lg-outer .lg-empty-html .lg-sub-html,.lg-outer .lg-empty-html.lg-sub-html{display:none}.lg-outer.lg-hide-download .lg-download{opacity:.75;pointer-events:none}.lg-outer .lg-first-slide .lg-dummy-img{position:absolute;top:50%;left:50%}.lg-outer.lg-components-open:not(.lg-zoomed) .lg-components{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.lg-outer.lg-components-open:not(.lg-zoomed) .lg-sub-html{opacity:1;transition:opacity .2s ease-out .15s}.lg-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1040;background-color:#000;opacity:0;will-change:auto;-webkit-transition:opacity 333ms ease-in 0s;-o-transition:opacity 333ms ease-in 0s;transition:opacity 333ms ease-in 0s}.lg-backdrop.in{opacity:1}.lg-css3.lg-no-trans .lg-current,.lg-css3.lg-no-trans .lg-next-slide,.lg-css3.lg-no-trans .lg-prev-slide{-webkit-transition:none 0s ease 0s!important;-moz-transition:none 0s ease 0s!important;-o-transition:none 0s ease 0s!important;transition:none 0s ease 0s!important}.lg-css3.lg-use-css3 .lg-item{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-css3.lg-fade .lg-item{opacity:0}.lg-css3.lg-fade .lg-item.lg-current{opacity:1}.lg-css3.lg-fade .lg-item.lg-current,.lg-css3.lg-fade .lg-item.lg-next-slide,.lg-css3.lg-fade .lg-item.lg-prev-slide{-webkit-transition:opacity .1s ease 0s;-moz-transition:opacity .1s ease 0s;-o-transition:opacity .1s ease 0s;transition:opacity .1s ease 0s}.lg-css3.lg-use-css3 .lg-item.lg-start-progress{-webkit-transition:-webkit-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;-moz-transition:-moz-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;-o-transition:-o-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;transition:transform 1s cubic-bezier(.175,.885,.32,1.275) 0s}.lg-css3.lg-use-css3 .lg-item.lg-start-end-progress{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s}.lg-css3.lg-slide.lg-use-css3 .lg-item{opacity:0}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s}.lg-container{display:none}.lg-container.lg-show{display:block}.lg-container.lg-dragging-vertical .lg-backdrop{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-container.lg-dragging-vertical .lg-css3 .lg-item.lg-current{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-inline .lg-backdrop,.lg-inline .lg-outer{position:absolute}.lg-inline .lg-backdrop{z-index:1}.lg-inline .lg-outer{z-index:2}.lg-inline .lg-maximize:after{content:'\e909'}.lg-components{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);will-change:transform;-webkit-transition:-webkit-transform .35s ease-out 0s;-moz-transition:-moz-transform .35s ease-out 0s;-o-transition:-o-transform .35s ease-out 0s;transition:transform .35s ease-out 0s;z-index:1080;position:absolute;bottom:0;right:0;left:0} \ No newline at end of file +@font-face{font-family:lg;src:url(../fonts/lg.woff2?io9a6k) format("woff2"),url(../fonts/lg.ttf?io9a6k) format("truetype"),url(../fonts/lg.woff?io9a6k) format("woff"),url(../fonts/lg.svg?io9a6k#lg) format("svg");font-weight:400;font-style:normal;font-display:block}.lg-icon{font-family:lg!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.lg-container{font-family:system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Sans','Liberation Sans',sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'}.lg-next,.lg-prev{background-color:rgba(0,0,0,.45);border-radius:2px;color:#999;cursor:pointer;display:block;font-size:22px;margin-top:-10px;padding:8px 10px 9px;position:absolute;top:50%;z-index:1080;outline:0;border:none}.lg-next.disabled,.lg-prev.disabled{opacity:0!important;cursor:default}.lg-next:hover:not(.disabled),.lg-prev:hover:not(.disabled){color:#fff}.lg-single-item .lg-next,.lg-single-item .lg-prev{display:none}.lg-next{right:20px}.lg-next:before{content:'\e095'}.lg-prev{left:20px}.lg-prev:after{content:'\e094'}@-webkit-keyframes lg-right-end{0%{left:0}50%{left:-30px}100%{left:0}}@-moz-keyframes lg-right-end{0%{left:0}50%{left:-30px}100%{left:0}}@-ms-keyframes lg-right-end{0%{left:0}50%{left:-30px}100%{left:0}}@keyframes lg-right-end{0%{left:0}50%{left:-30px}100%{left:0}}@-webkit-keyframes lg-left-end{0%{left:0}50%{left:30px}100%{left:0}}@-moz-keyframes lg-left-end{0%{left:0}50%{left:30px}100%{left:0}}@-ms-keyframes lg-left-end{0%{left:0}50%{left:30px}100%{left:0}}@keyframes lg-left-end{0%{left:0}50%{left:30px}100%{left:0}}.lg-outer.lg-right-end .lg-object{-webkit-animation:lg-right-end .3s;-o-animation:lg-right-end .3s;animation:lg-right-end .3s;position:relative}.lg-outer.lg-left-end .lg-object{-webkit-animation:lg-left-end .3s;-o-animation:lg-left-end .3s;animation:lg-left-end .3s;position:relative}.lg-toolbar{z-index:1082;left:0;position:absolute;top:0;width:100%}.lg-media-overlap .lg-toolbar{background-image:linear-gradient(0deg,rgba(0,0,0,0),rgba(0,0,0,.4))}.lg-toolbar .lg-icon{color:#999;cursor:pointer;float:right;font-size:24px;height:47px;line-height:27px;padding:10px 0;text-align:center;width:50px;text-decoration:none!important;outline:medium none;will-change:color;-webkit-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear;background:0 0;border:none;box-shadow:none}.lg-toolbar .lg-icon.lg-icon-18{font-size:18px}.lg-toolbar .lg-icon:hover{color:#fff}.lg-toolbar .lg-close:after{content:'\e070'}.lg-toolbar .lg-maximize{font-size:22px}.lg-toolbar .lg-maximize:after{content:'\e90a'}.lg-toolbar .lg-download:after{content:'\e0f2'}.lg-sub-html{color:#eee;font-size:16px;padding:10px 40px;text-align:center;z-index:1080;opacity:0;-webkit-transition:opacity .2s ease-out 0s;-o-transition:opacity .2s ease-out 0s;transition:opacity .2s ease-out 0s}.lg-sub-html h4{margin:0;font-size:13px;font-weight:700}.lg-sub-html p{font-size:12px;margin:5px 0 0}.lg-sub-html a{color:inherit}.lg-sub-html a:hover{text-decoration:underline}.lg-media-overlap .lg-sub-html{background-image:linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,.6))}.lg-item .lg-sub-html{position:absolute;bottom:0;right:0;left:0}.lg-error-msg{font-size:14px;color:#999}.lg-counter{color:#999;display:inline-block;font-size:16px;padding-left:20px;padding-top:12px;height:47px;vertical-align:middle}.lg-closing .lg-next,.lg-closing .lg-prev,.lg-closing .lg-sub-html,.lg-closing .lg-toolbar{opacity:0;-webkit-transition:-webkit-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;-moz-transition:-moz-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;-o-transition:-o-transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear;transition:transform .08 cubic-bezier(0,0,.25,1) 0s,opacity .08 cubic-bezier(0,0,.25,1) 0s,color .08 linear}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-img-wrap,body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable) .lg-video-cont{opacity:0;-moz-transform:scale3d(.5,.5,.5);-o-transform:scale3d(.5,.5,.5);-ms-transform:scale3d(.5,.5,.5);-webkit-transform:scale3d(.5,.5,.5);transform:scale3d(.5,.5,.5);will-change:transform,opacity;-webkit-transition:-webkit-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-moz-transition:-moz-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-o-transition:-o-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;transition:transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-img-wrap,body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item:not(.lg-zoomable).lg-complete .lg-video-cont{opacity:1;-moz-transform:scale3d(1,1,1);-o-transform:scale3d(1,1,1);-ms-transform:scale3d(1,1,1);-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}.lg-icon:focus-visible{color:#fff;border-radius:3px;outline:1px dashed rgba(255,255,255,.6)}.lg-toolbar .lg-icon:focus-visible{border-radius:8px;outline-offset:-5px}.lg-outer .lg-thumb-outer{background-color:#0d0a0a;width:100%;max-height:350px;overflow:hidden;float:left}.lg-outer .lg-thumb-outer.lg-grab .lg-thumb-item{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer .lg-thumb-outer.lg-grabbing .lg-thumb-item{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg-thumb-outer.lg-dragging .lg-thumb{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-outer .lg-thumb-outer.lg-rebuilding-thumbnails .lg-thumb{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-outer .lg-thumb-outer.lg-thumb-align-middle{text-align:center}.lg-outer .lg-thumb-outer.lg-thumb-align-left{text-align:left}.lg-outer .lg-thumb-outer.lg-thumb-align-right{text-align:right}.lg-outer.lg-single-item .lg-thumb-outer{display:none}.lg-outer .lg-thumb{padding:5px 0;height:100%;margin-bottom:-5px;display:inline-block;vertical-align:middle}@media (min-width:768px){.lg-outer .lg-thumb{padding:10px 0}}.lg-outer .lg-thumb-item{cursor:pointer;float:left;overflow:hidden;height:100%;border-radius:2px;margin-bottom:5px;will-change:border-color}@media (min-width:768px){.lg-outer .lg-thumb-item{border-radius:4px;border:2px solid #fff;-webkit-transition:border-color .25s ease;-o-transition:border-color .25s ease;transition:border-color .25s ease}}.lg-outer .lg-thumb-item.active,.lg-outer .lg-thumb-item:hover{border-color:#a90707}.lg-outer .lg-thumb-item img{width:100%;height:100%;object-fit:cover;display:block}.lg-outer.lg-can-toggle .lg-item{padding-bottom:0}.lg-outer .lg-toggle-thumb:after{content:'\e1ff'}.lg-outer.lg-animate-thumb .lg-thumb{-webkit-transition-timing-function:cubic-bezier(.215,.61,.355,1);transition-timing-function:cubic-bezier(.215,.61,.355,1)}.lg-outer .lg-video-cont{text-align:center;display:inline-block;vertical-align:middle;position:relative}.lg-outer .lg-video-cont .lg-object{width:100%!important;height:100%!important}.lg-outer .lg-has-iframe .lg-video-cont{-webkit-overflow-scrolling:touch;overflow:auto}.lg-outer .lg-video-object{position:absolute;left:0;right:0;width:100%;height:100%;top:0;bottom:0;z-index:3}.lg-outer .lg-video-poster{z-index:1}.lg-outer .lg-has-video .lg-video-object{opacity:0;will-change:opacity;-webkit-transition:opacity .3s ease-in;-o-transition:opacity .3s ease-in;transition:opacity .3s ease-in}.lg-outer .lg-has-video.lg-video-loaded .lg-video-play-button,.lg-outer .lg-has-video.lg-video-loaded .lg-video-poster{opacity:0!important}.lg-outer .lg-has-video.lg-video-loaded .lg-video-object{opacity:1}@keyframes lg-play-stroke{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes lg-play-rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.lg-video-play-button{width:18%;max-width:140px;position:absolute;top:50%;left:50%;z-index:2;cursor:pointer;transform:translate(-50%,-50%) scale(1);will-change:opacity,transform;-webkit-transition:-webkit-transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s;-moz-transition:-moz-transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s;-o-transition:-o-transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s;transition:transform .25s cubic-bezier(.17,.88,.32,1.28),opacity .1s}.lg-video-play-button:hover .lg-video-play-icon,.lg-video-play-button:hover .lg-video-play-icon-bg{opacity:1}.lg-video-play-icon-bg{fill:none;stroke-width:3%;stroke:#fcfcfc;opacity:.6;will-change:opacity;-webkit-transition:opacity .12s ease-in;-o-transition:opacity .12s ease-in;transition:opacity .12s ease-in}.lg-video-play-icon-circle{position:absolute;top:0;left:0;bottom:0;right:0;fill:none;stroke-width:3%;stroke:rgba(30,30,30,.9);stroke-opacity:1;stroke-linecap:round;stroke-dasharray:200;stroke-dashoffset:200}.lg-video-play-icon{position:absolute;width:25%;max-width:120px;left:50%;top:50%;transform:translate3d(-50%,-50%,0);opacity:.6;will-change:opacity;-webkit-transition:opacity .12s ease-in;-o-transition:opacity .12s ease-in;transition:opacity .12s ease-in}.lg-video-play-icon .lg-video-play-icon-inner{fill:#fcfcfc}.lg-video-loading .lg-video-play-icon-circle{animation:lg-play-rotate 2s linear .25s infinite,lg-play-stroke 1.5s ease-in-out .25s infinite}.lg-video-loaded .lg-video-play-button{opacity:0;transform:translate(-50%,-50%) scale(.7)}.lg-progress-bar{background-color:#333;height:5px;left:0;position:absolute;top:0;width:100%;z-index:1083;opacity:0;will-change:opacity;-webkit-transition:opacity 80ms ease 0s;-moz-transition:opacity 80ms ease 0s;-o-transition:opacity 80ms ease 0s;transition:opacity 80ms ease 0s}.lg-progress-bar .lg-progress{background-color:#a90707;height:5px;width:0}.lg-progress-bar.lg-start .lg-progress{width:100%}.lg-show-autoplay .lg-progress-bar{opacity:1}.lg-autoplay-button:after{content:'\e01d'}.lg-show-autoplay .lg-autoplay-button:after{content:'\e01a'}.lg-single-item .lg-autoplay-button{opacity:.75;pointer-events:none}.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-image,.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap{will-change:transform;-webkit-transition:-webkit-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s;-moz-transition:-moz-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s;-o-transition:-o-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s;transition:transform .5s cubic-bezier(.12,.415,.01,1.19) 0s}.lg-outer.lg-use-transition-for-zoom.lg-zoom-drag-transition .lg-item.lg-complete.lg-zoomable .lg-img-wrap{will-change:transform;-webkit-transition:-webkit-transform .8s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .8s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .8s cubic-bezier(0,0,.25,1) 0s;transition:transform .8s cubic-bezier(0,0,.25,1) 0s}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1);-webkit-transition:-webkit-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;-moz-transition:-moz-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;-o-transition:-o-transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;transition:transform .5s cubic-bezier(.12,.415,.01,1.19) 0s,opacity .15s!important;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.no-transition,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.no-transition{transition:none!important}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition{transform:scale3d(1,1,1) translate3d(-50%,-50%,0)!important;max-width:none!important;max-height:none!important;top:50%!important;left:50%!important}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition-x,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition-x{transform:scale3d(1,1,1) translate3d(-50%,0,0)!important;top:0!important;left:50%!important;max-width:none!important;max-height:none!important}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-dummy-img.reset-transition-y,.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image.reset-transition-y{transform:scale3d(1,1,1) translate3d(0,-50%,0)!important;top:50%!important;left:0!important;max-width:none!important;max-height:none!important}.lg-icon.lg-zoom-in:after{content:'\e311'}.lg-actual-size .lg-icon.lg-zoom-in{opacity:.5;pointer-events:none}.lg-icon.lg-actual-size{font-size:20px}.lg-icon.lg-actual-size:after{content:'\e033'}.lg-icon.lg-zoom-out{opacity:.5;pointer-events:none}.lg-icon.lg-zoom-out:after{content:'\e312'}.lg-zoomed .lg-icon.lg-zoom-out{opacity:1;pointer-events:auto}.lg-outer.lg-first-slide-loading .lg-actual-size,.lg-outer.lg-first-slide-loading .lg-zoom-in,.lg-outer.lg-first-slide-loading .lg-zoom-out,.lg-outer[data-lg-slide-type=iframe] .lg-actual-size,.lg-outer[data-lg-slide-type=iframe] .lg-zoom-in,.lg-outer[data-lg-slide-type=iframe] .lg-zoom-out,.lg-outer[data-lg-slide-type=video] .lg-actual-size,.lg-outer[data-lg-slide-type=video] .lg-zoom-in,.lg-outer[data-lg-slide-type=video] .lg-zoom-out{opacity:.75;pointer-events:none}.lg-outer .lg-pager-outer{text-align:center;z-index:1080;height:10px;margin-bottom:10px}.lg-outer .lg-pager-outer.lg-pager-hover .lg-pager-cont{overflow:visible}.lg-outer.lg-single-item .lg-pager-outer{display:none}.lg-outer .lg-pager-cont{cursor:pointer;display:inline-block;overflow:hidden;position:relative;vertical-align:top;margin:0 5px}.lg-outer .lg-pager-cont:hover .lg-pager-thumb-cont{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.lg-outer .lg-pager-cont.lg-pager-active .lg-pager{box-shadow:0 0 0 2px #fff inset}.lg-outer .lg-pager-thumb-cont{background-color:#fff;color:#fff;bottom:100%;height:83px;left:0;margin-bottom:20px;margin-left:-60px;opacity:0;padding:5px;position:absolute;width:120px;border-radius:3px;will-change:transform,opacity;-webkit-transition:opacity .15s ease 0s,-webkit-transform .15s ease 0s;-moz-transition:opacity .15s ease 0s,-moz-transform .15s ease 0s;-o-transition:opacity .15s ease 0s,-o-transform .15s ease 0s;transition:opacity .15s ease 0s,transform .15s ease 0s;-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0)}.lg-outer .lg-pager-thumb-cont img{width:100%;height:100%}.lg-outer .lg-pager{background-color:rgba(255,255,255,.5);border-radius:50%;box-shadow:0 0 0 8px rgba(255,255,255,.7) inset;display:block;height:12px;-webkit-transition:box-shadow .3s ease 0s;-o-transition:box-shadow .3s ease 0s;transition:box-shadow .3s ease 0s;width:12px}.lg-outer .lg-pager:focus,.lg-outer .lg-pager:hover{box-shadow:0 0 0 8px #fff inset}.lg-outer .lg-caret{border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px dashed;bottom:-10px;display:inline-block;height:0;left:50%;margin-left:-5px;position:absolute;vertical-align:middle;width:0}.lg-fullscreen:after{content:"\e20c"}.lg-fullscreen-on .lg-fullscreen:after{content:"\e20d"}.lg-outer .lg-dropdown-overlay{background-color:rgba(0,0,0,.25);bottom:0;cursor:default;left:0;position:absolute;right:0;top:0;z-index:1081;opacity:0;visibility:hidden;will-change:visibility,opacity;-webkit-transition:visibility 0s linear .18s,opacity .18s linear 0s;-o-transition:visibility 0s linear .18s,opacity .18s linear 0s;transition:visibility 0s linear .18s,opacity .18s linear 0s}.lg-outer.lg-dropdown-active .lg-dropdown,.lg-outer.lg-dropdown-active .lg-dropdown-overlay{-webkit-transition-delay:0s;transition-delay:0s;-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;visibility:visible}.lg-outer.lg-dropdown-active .lg-share{color:#fff}.lg-outer .lg-dropdown{background-color:#fff;border-radius:2px;font-size:14px;list-style-type:none;margin:0;padding:10px 0;position:absolute;right:0;text-align:left;top:50px;opacity:0;visibility:hidden;-moz-transform:translate3d(0,5px,0);-o-transform:translate3d(0,5px,0);-ms-transform:translate3d(0,5px,0);-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0);will-change:visibility,opacity,transform;-webkit-transition:-webkit-transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s;-moz-transition:-moz-transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s;-o-transition:-o-transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s;transition:transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s}.lg-outer .lg-dropdown:after{content:'';display:block;height:0;width:0;position:absolute;border:8px solid transparent;border-bottom-color:#fff;right:16px;top:-16px}.lg-outer .lg-dropdown>li:last-child{margin-bottom:0}.lg-outer .lg-dropdown>li:hover a{color:#333}.lg-outer .lg-dropdown a{color:#333;display:block;white-space:pre;padding:4px 12px;font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:12px}.lg-outer .lg-dropdown a:hover{background-color:rgba(0,0,0,.07)}.lg-outer .lg-dropdown .lg-dropdown-text{display:inline-block;line-height:1;margin-top:-3px;vertical-align:middle}.lg-outer .lg-dropdown .lg-icon{color:#333;display:inline-block;float:none;font-size:20px;height:auto;line-height:1;margin-right:8px;padding:0;vertical-align:middle;width:auto}.lg-outer .lg-share{position:relative}.lg-outer .lg-share:after{content:'\e80d'}.lg-outer .lg-share-facebook .lg-icon{color:#3b5998}.lg-outer .lg-share-facebook .lg-icon:after{content:'\e904'}.lg-outer .lg-share-twitter .lg-icon{color:#00aced}.lg-outer .lg-share-twitter .lg-icon:after{content:'\e907'}.lg-outer .lg-share-pinterest .lg-icon{color:#cb2027}.lg-outer .lg-share-pinterest .lg-icon:after{content:'\e906'}.lg-comment-box{width:420px;max-width:100%;position:absolute;right:0;top:0;bottom:0;z-index:9999;background-color:#fff;will-change:transform;-moz-transform:translate3d(100%,0,0);-o-transform:translate3d(100%,0,0);-ms-transform:translate3d(100%,0,0);-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);-webkit-transition:-webkit-transform .4s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .4s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .4s cubic-bezier(0,0,.25,1) 0s;transition:transform .4s cubic-bezier(0,0,.25,1) 0s}.lg-comment-box .lg-comment-title{margin:0;color:#fff;font-size:18px}.lg-comment-box .lg-comment-header{background-color:#000;padding:12px 20px;position:absolute;left:0;right:0;top:0}.lg-comment-box .lg-comment-body{height:100%!important;padding-top:43px!important;width:100%!important}.lg-comment-box .fb-comments{height:100%;width:100%;background:url(../images/loading.gif) no-repeat scroll center center #fff;overflow-y:auto;display:inline-block}.lg-comment-box .fb-comments[fb-xfbml-state=rendered]{background-image:none}.lg-comment-box .fb-comments>span{max-width:100%}.lg-comment-box .lg-comment-close{position:absolute;right:5px;top:12px;cursor:pointer;font-size:20px;color:#999;will-change:color;-webkit-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear}.lg-comment-box .lg-comment-close:hover{color:#fff}.lg-comment-box .lg-comment-close:after{content:'\e070'}.lg-comment-box iframe{max-width:100%!important;width:100%!important}.lg-comment-box #disqus_thread{padding:0 20px}.lg-outer .lg-comment-overlay{background-color:rgba(0,0,0,.25);bottom:0;cursor:default;left:0;position:fixed;right:0;top:0;z-index:1081;opacity:0;visibility:hidden;will-change:visibility,opacity;-webkit-transition:visibility 0s linear .18s,opacity .18s linear 0s;-o-transition:visibility 0s linear .18s,opacity .18s linear 0s;transition:visibility 0s linear .18s,opacity .18s linear 0s}.lg-outer .lg-comment-toggle:after{content:'\e908'}.lg-outer.lg-comment-active .lg-comment-overlay{-webkit-transition-delay:0s;transition-delay:0s;-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;visibility:visible}.lg-outer.lg-comment-active .lg-comment-toggle{color:#fff}.lg-outer.lg-comment-active .lg-comment-box{-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.lg-outer .lg-img-rotate{position:absolute;left:0;right:0;top:0;bottom:0;-webkit-transition:-webkit-transform .4s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .4s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .4s cubic-bezier(0,0,.25,1) 0s;transition:transform .4s cubic-bezier(0,0,.25,1) 0s}.lg-outer[data-lg-slide-type=iframe] .lg-flip-hor,.lg-outer[data-lg-slide-type=iframe] .lg-flip-ver,.lg-outer[data-lg-slide-type=iframe] .lg-rotate-left,.lg-outer[data-lg-slide-type=iframe] .lg-rotate-right,.lg-outer[data-lg-slide-type=video] .lg-flip-hor,.lg-outer[data-lg-slide-type=video] .lg-flip-ver,.lg-outer[data-lg-slide-type=video] .lg-rotate-left,.lg-outer[data-lg-slide-type=video] .lg-rotate-right{opacity:.75;pointer-events:none}.lg-outer .lg-img-rotate:before{content:'';display:inline-block;height:100%;vertical-align:middle}.lg-rotate-left:after{content:'\e900'}.lg-rotate-right:after{content:'\e901'}.lg-icon.lg-flip-hor,.lg-icon.lg-flip-ver{font-size:26px}.lg-flip-ver:after{content:'\e903'}.lg-flip-hor:after{content:'\e902'}.lg-medium-zoom-item{cursor:zoom-in}.lg-medium-zoom .lg-outer{cursor:zoom-out}.lg-medium-zoom .lg-outer.lg-grab img.lg-object{cursor:zoom-out}.lg-medium-zoom .lg-outer.lg-grabbing img.lg-object{cursor:zoom-out}.lg-relative-caption .lg-outer .lg-sub-html{white-space:normal;bottom:auto;padding:0;background-image:none}.lg-relative-caption .lg-outer .lg-relative-caption-item{opacity:0;padding:16px 0;transition:.5s opacity ease}.lg-relative-caption .lg-outer .lg-show-caption .lg-relative-caption-item{opacity:1}.lg-group:after{content:'';display:table;clear:both}.lg-container{display:none;outline:0}.lg-container.lg-show{display:block}.lg-on{scroll-behavior:unset}.lg-overlay-open{overflow:hidden}.lg-hide-sub-html .lg-sub-html,.lg-next,.lg-pager-outer,.lg-prev,.lg-toolbar{opacity:0;will-change:transform,opacity;-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s;transition:transform .25s cubic-bezier(0,0,.25,1) 0s,opacity .25s cubic-bezier(0,0,.25,1) 0s}.lg-show-in .lg-next,.lg-show-in .lg-pager-outer,.lg-show-in .lg-prev,.lg-show-in .lg-toolbar{opacity:1}.lg-show-in.lg-hide-sub-html .lg-sub-html{opacity:1}.lg-show-in .lg-hide-items .lg-prev{opacity:0;-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}.lg-show-in .lg-hide-items .lg-next{opacity:0;-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}.lg-show-in .lg-hide-items .lg-toolbar{opacity:0;-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}.lg-show-in .lg-hide-items.lg-hide-sub-html .lg-sub-html{opacity:0;-webkit-transform:translate3d(0,20px,0);transform:translate3d(0,20px,0)}.lg-outer{width:100%;height:100%;position:fixed;top:0;left:0;z-index:1050;text-align:left;opacity:.001;outline:0;will-change:auto;overflow:hidden;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-outer *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lg-outer.lg-zoom-from-image{opacity:1}.lg-outer.lg-visible{opacity:1}.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-current,.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-next-slide,.lg-outer.lg-css3 .lg-item:not(.lg-start-end-progress).lg-prev-slide{-webkit-transition-duration:inherit!important;transition-duration:inherit!important;-webkit-transition-timing-function:inherit!important;transition-timing-function:inherit!important}.lg-outer.lg-css3.lg-dragging .lg-item.lg-current,.lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide,.lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-outer.lg-grab img.lg-object{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer.lg-grabbing img.lg-object{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg-content{position:absolute;top:0;left:0;right:0;bottom:0}.lg-outer .lg-inner{width:100%;position:absolute;left:0;top:0;bottom:0;-webkit-transition:opacity 0s;-o-transition:opacity 0s;transition:opacity 0s;white-space:nowrap}.lg-outer .lg-item{display:none!important}.lg-outer .lg-item:not(.lg-start-end-progress){background:url(../images/loading.gif) no-repeat scroll center center transparent}.lg-outer.lg-css3 .lg-current,.lg-outer.lg-css3 .lg-next-slide,.lg-outer.lg-css3 .lg-prev-slide{display:inline-block!important}.lg-outer.lg-css .lg-current{display:inline-block!important}.lg-outer .lg-img-wrap,.lg-outer .lg-item{display:inline-block;text-align:center;position:absolute;width:100%;height:100%}.lg-outer .lg-img-wrap:before,.lg-outer .lg-item:before{content:'';display:inline-block;height:100%;vertical-align:middle}.lg-outer .lg-img-wrap{position:absolute;left:0;right:0;top:0;bottom:0;white-space:nowrap;font-size:0}.lg-outer .lg-item.lg-complete{background-image:none}.lg-outer .lg-item.lg-current{z-index:1060}.lg-outer .lg-object{display:inline-block;vertical-align:middle;max-width:100%;max-height:100%;width:auto;height:auto;position:relative}.lg-outer .lg-empty-html .lg-sub-html,.lg-outer .lg-empty-html.lg-sub-html{display:none}.lg-outer.lg-hide-download .lg-download{opacity:.75;pointer-events:none}.lg-outer .lg-first-slide .lg-dummy-img{position:absolute;top:50%;left:50%}.lg-outer.lg-components-open:not(.lg-zoomed) .lg-components{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.lg-outer.lg-components-open:not(.lg-zoomed) .lg-sub-html{opacity:1;transition:opacity .2s ease-out .15s}.lg-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1040;background-color:#000;opacity:0;will-change:auto;-webkit-transition:opacity 333ms ease-in 0s;-o-transition:opacity 333ms ease-in 0s;transition:opacity 333ms ease-in 0s}.lg-backdrop.in{opacity:1}.lg-css3.lg-no-trans .lg-current,.lg-css3.lg-no-trans .lg-next-slide,.lg-css3.lg-no-trans .lg-prev-slide{-webkit-transition:none 0s ease 0s!important;-moz-transition:none 0s ease 0s!important;-o-transition:none 0s ease 0s!important;transition:none 0s ease 0s!important}.lg-css3.lg-use-css3 .lg-item{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-css3.lg-fade .lg-item{opacity:0}.lg-css3.lg-fade .lg-item.lg-current{opacity:1}.lg-css3.lg-fade .lg-item.lg-current,.lg-css3.lg-fade .lg-item.lg-next-slide,.lg-css3.lg-fade .lg-item.lg-prev-slide{-webkit-transition:opacity .1s ease 0s;-moz-transition:opacity .1s ease 0s;-o-transition:opacity .1s ease 0s;transition:opacity .1s ease 0s}.lg-css3.lg-use-css3 .lg-item.lg-start-progress{-webkit-transition:-webkit-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;-moz-transition:-moz-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;-o-transition:-o-transform 1s cubic-bezier(.175,.885,.32,1.275) 0s;transition:transform 1s cubic-bezier(.175,.885,.32,1.275) 0s}.lg-css3.lg-use-css3 .lg-item.lg-start-end-progress{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s}.lg-css3.lg-slide.lg-use-css3 .lg-item{opacity:0}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s}.lg-container{display:none}.lg-container.lg-show{display:block}.lg-container.lg-dragging-vertical .lg-backdrop{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-container.lg-dragging-vertical .lg-css3 .lg-item.lg-current{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-inline .lg-backdrop,.lg-inline .lg-outer{position:absolute}.lg-inline .lg-backdrop{z-index:1}.lg-inline .lg-outer{z-index:2}.lg-inline .lg-maximize:after{content:'\e909'}.lg-components{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);will-change:transform;-webkit-transition:-webkit-transform .35s ease-out 0s;-moz-transition:-moz-transform .35s ease-out 0s;-o-transition:-o-transform .35s ease-out 0s;transition:transform .35s ease-out 0s;z-index:1080;position:absolute;bottom:0;right:0;left:0} \ No newline at end of file diff --git a/dist/lightgallery.es5.js b/dist/lightgallery.es5.js index bdc6b016a..b13353176 100644 --- a/dist/lightgallery.es5.js +++ b/dist/lightgallery.es5.js @@ -1,5 +1,5 @@ /*! - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 @@ -2146,23 +2146,23 @@ var LightGallery = /** @class */ (function () { $item.get().contains(e.target)) && !_this.outer.hasClass('lg-zoomed') && !_this.lgBusy && - e.targetTouches.length === 1) { + e.touches.length === 1) { isSwiping = true; _this.touchAction = 'swipe'; _this.manageSwipeClass(); startCoords = { - pageX: e.targetTouches[0].pageX, - pageY: e.targetTouches[0].pageY, + pageX: e.touches[0].pageX, + pageY: e.touches[0].pageY, }; } }); this.$inner.on('touchmove.lg', function (e) { if (isSwiping && _this.touchAction === 'swipe' && - e.targetTouches.length === 1) { + e.touches.length === 1) { endCoords = { - pageX: e.targetTouches[0].pageX, - pageY: e.targetTouches[0].pageY, + pageX: e.touches[0].pageX, + pageY: e.touches[0].pageY, }; _this.touchMove(startCoords, endCoords, e); isMoved = true; diff --git a/dist/lightgallery.min.js b/dist/lightgallery.min.js index d9d12d46b..9edb65814 100644 --- a/dist/lightgallery.min.js +++ b/dist/lightgallery.min.js @@ -1,8 +1,8 @@ /** - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lightGallery=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,s=arguments.length;ir){n=a;break}l===o.length-1&&(n=a)}var d=n.split("-"),g=parseInt(d[0],10),h=parseInt(d[1],10),c=e.width(),u=e.height()-i,m=Math.min(c,g),p=Math.min(u,h),f=Math.min(m/g,p/h);return{width:g*f,height:h*f}}},E=function(t,e,i,s,n){if(n){var o=x(t).find("img").first();if(o.get()){var r=e.get().getBoundingClientRect(),l=r.width,a=e.height()-(i+s),d=o.width(),g=o.height(),h=o.style(),c=(l-d)/2-o.offset().left+(parseFloat(h.paddingLeft)||0)+(parseFloat(h.borderLeft)||0)+x(window).scrollLeft()+r.left,u=(a-g)/2-o.offset().top+(parseFloat(h.paddingTop)||0)+(parseFloat(h.borderTop)||0)+x(window).scrollTop()+i;return"translate3d("+(c*=-1)+"px, "+(u*=-1)+"px, 0) scale3d("+d/n.width+", "+g/n.height+", 1)"}}},O=function(t,e,i,s,n,o){return'
\n \n
'},D=function(t,e,i,s,n,o){var r="',l="";o&&(l=("string"==typeof o?JSON.parse(o):o).map((function(t){var e="";return Object.keys(t).forEach((function(i){e+=" "+i+'="'+t[i]+'"'})),""})));return""+l+r},L=function(t){for(var e=[],i=[],s="",n=0;nr){s=i[l];break}return s},z=function(t){return!!t&&(!!t.complete&&0!==t.naturalWidth)},M=function(t,e,i,s,n){return'
\n
\n \n '+s+'\n \n \n \n \n \n \n \n
\n '+(e||"")+'\n \n
'},G=function(t){var e=t.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');return[].filter.call(e,(function(t){var e=window.getComputedStyle(t);return"none"!==e.display&&"hidden"!==e.visibility}))},k=function(t,e,i,s){var n=[],o=function(){for(var t=0,e=0,i=arguments.length;e-1&&(d=a),d&&(e[d]=l.value)}}var g=x(t),h=g.find("img").first().attr("alt"),c=g.attr("title"),u=s?g.attr(s):g.find("img").first().attr("src");e.thumb=u,i&&!e.subHtml&&(e.subHtml=c||h||""),e.alt=h||c||"",n.push(e)})),n},A=function(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)},P=function(t,e,i){if(!t)return e?{html5:!0}:void console.error("lightGallery :- data-src is not provided on slide item "+(i+1)+". Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/");var s=t.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)([\&|?][\S]*)*/i),n=t.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)(.*)?/i),o=t.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return s?{youtube:s}:n?{vimeo:n}:o?{wistia:o}:void 0},B=0,F=function(){function w(t,e){if(this.lgOpened=!1,this.index=0,this.plugins=[],this.lGalleryOn=!1,this.lgBusy=!1,this.currentItemsInDom=[],this.prevScrollTop=0,this.bodyPaddingRight=0,this.isDummyImageRemoved=!1,this.dragOrSwipeEnabled=!1,this.mediaContainerPosition={top:0,bottom:0},!t)return this;if(B++,this.lgId=B,this.el=t,this.LGel=x(t),this.generateSettings(e),this.buildModules(),this.settings.dynamic&&void 0!==this.settings.dynamicEl&&!Array.isArray(this.settings.dynamicEl))throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.galleryItems=this.getItems(),this.normalizeSettings(),this.init(),this.validateLicense(),this}return w.prototype.generateSettings=function(e){if(this.settings=t(t({},I),e),this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():A()){var i=t(t({},this.settings.mobileSettings),this.settings.mobileSettings);this.settings=t(t({},this.settings),i)}},w.prototype.normalizeSettings=function(){this.settings.slideEndAnimation&&(this.settings.hideControlOnEnd=!1),this.settings.closable||(this.settings.swipeToClose=!1),this.zoomFromOrigin=this.settings.zoomFromOrigin,this.settings.dynamic&&(this.zoomFromOrigin=!1),this.settings.container||(this.settings.container=document.body),this.settings.preload=Math.min(this.settings.preload,this.galleryItems.length)},w.prototype.init=function(){var t=this;this.addSlideVideoInfo(this.galleryItems),this.buildStructure(),this.LGel.trigger(i,{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout((function(){t.enableDrag(),t.enableSwipe(),t.triggerPosterClick()}),50),this.arrow(),this.settings.mousewheel&&this.mousewheel(),this.settings.dynamic||this.openGalleryOnItemClick()},w.prototype.openGalleryOnItemClick=function(){for(var t=this,e=function(e){var s=i.items[e],n=x(s),o=C.generateUUID();n.attr("data-lg-id",o).on("click.lgcustom-item-"+o,(function(i){i.preventDefault();var n=t.settings.index||e;t.openGallery(n,s)}))},i=this,s=0;s '+this.settings.prevHtml+' \n "),".lg-item"!==this.settings.appendSubHtmlTo&&(i='
');var s="";this.settings.allowMediaOverlap&&(s+="lg-media-overlap ");var n=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",o=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",r="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),l=this.settings.closable&&this.settings.showCloseIcon?'':"",a=this.settings.showMaximizeIcon?'':"",d='\n \n ";x(this.settings.container).append(d),document.body!==this.settings.container&&x(this.settings.container).css("position","relative"),this.outer=this.getElementById("lg-outer"),this.$lgComponents=this.getElementById("lg-components"),this.$backdrop=this.getElementById("lg-backdrop"),this.$container=this.getElementById("lg-container"),this.$inner=this.getElementById("lg-inner"),this.$content=this.getElementById("lg-content"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms");var g=this.settings.mode+" ";this.manageSingleSlideClassName(),this.settings.enableDrag&&(g+="lg-grab "),this.outer.addClass(g),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append(''),this.counter(),x(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,(function(){t.refreshOnResize()})),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.initModules()}},w.prototype.refreshOnResize=function(){if(this.lgOpened){var t=this.galleryItems[this.index].__slideVideoInfo;this.mediaContainerPosition=this.getMediaContainerPosition();var e=this.mediaContainerPosition,i=e.top,s=e.bottom;if(this.currentImageSize=T(this.items[this.index],this.outer,i+s,t&&this.settings.videoMaxSize),t&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved){var o=this.getDummyImgStyles(this.currentImageSize);this.outer.find(".lg-current .lg-dummy-img").first().attr("style",o)}this.LGel.trigger(n)}},w.prototype.resizeVideoSlide=function(t,e){var i=this.getVideoContStyle(e);this.getSlideItem(t).find(".lg-video-cont").attr("style",i)},w.prototype.updateSlides=function(t,e){if(this.index>t.length-1&&(this.index=t.length-1),1===t.length&&(this.index=0),t.length){var i=this.galleryItems[e].src;this.galleryItems=t,this.updateControls(),this.$inner.empty(),this.currentItemsInDom=[];var s=0;this.galleryItems.some((function(t,e){return t.src===i&&(s=e,!0)})),this.currentItemsInDom=this.organizeSlideItems(s,-1),this.loadContent(s,!0),this.getSlideItem(s).addClass("lg-current"),this.index=s,this.updateCurrentCounter(s),this.LGel.trigger(o)}else this.closeGallery()},w.prototype.getItems=function(){if(this.items=[],this.settings.dynamic)return this.settings.dynamicEl||[];if("this"===this.settings.selector)this.items.push(this.el);else if(this.settings.selector)if("string"==typeof this.settings.selector)if(this.settings.selectWithin){var t=x(this.settings.selectWithin);this.items=t.find(this.settings.selector).get()}else this.items=this.el.querySelectorAll(this.settings.selector);else this.items=this.settings.selector;else this.items=this.el.children;return k(this.items,this.settings.extraProps,this.settings.getCaptionFromTitleOrAlt,this.settings.exThumbImage)},w.prototype.shouldHideScrollbar=function(){return this.settings.hideScrollbar&&document.body===this.settings.container},w.prototype.hideScrollbar=function(){if(this.shouldHideScrollbar()){this.bodyPaddingRight=parseFloat(x("body").style().paddingRight);var t=document.documentElement.getBoundingClientRect(),e=window.innerWidth-t.width;x(document.body).css("padding-right",e+this.bodyPaddingRight+"px"),x(document.body).addClass("lg-overlay-open")}},w.prototype.resetScrollBar=function(){this.shouldHideScrollbar()&&(x(document.body).css("padding-right",this.bodyPaddingRight+"px"),x(document.body).removeClass("lg-overlay-open"))},w.prototype.openGallery=function(t,e){var i=this;if(void 0===t&&(t=this.settings.index),!this.lgOpened){this.lgOpened=!0,this.outer.removeClass("lg-hide-items"),this.hideScrollbar(),this.$container.addClass("lg-show");var s=this.getItemsToBeInsertedToDom(t,t);this.currentItemsInDom=s;var n="";s.forEach((function(t){n=n+'
'})),this.$inner.append(n),this.addHtml(t);var o="";this.mediaContainerPosition=this.getMediaContainerPosition();var r=this.mediaContainerPosition,d=r.top,g=r.bottom;this.settings.allowMediaOverlap||this.setMediaContainerPosition(d,g);var h=this.galleryItems[t].__slideVideoInfo;this.zoomFromOrigin&&e&&(this.currentImageSize=T(e,this.outer,d+g,h&&this.settings.videoMaxSize),o=E(e,this.outer,d,g,this.currentImageSize)),this.zoomFromOrigin&&o||(this.outer.addClass(this.settings.startClass),this.getSlideItem(t).removeClass("lg-complete"));var c=this.settings.zoomFromOrigin?100:this.settings.backdropDuration;setTimeout((function(){i.outer.addClass("lg-components-open")}),c),this.index=t,this.LGel.trigger(l),this.getSlideItem(t).addClass("lg-current"),this.lGalleryOn=!1,this.prevScrollTop=x(window).scrollTop(),setTimeout((function(){if(i.zoomFromOrigin&&o){var e=i.getSlideItem(t);e.css("transform",o),setTimeout((function(){e.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",i.settings.startAnimationDuration+"ms"),i.outer.addClass("lg-zoom-from-image")})),setTimeout((function(){e.css("transform","translate3d(0, 0, 0)")}),100)}setTimeout((function(){i.$backdrop.addClass("in"),i.$container.addClass("lg-show-in")}),10),setTimeout((function(){i.settings.trapFocus&&document.body===i.settings.container&&i.trapFocus()}),i.settings.backdropDuration+50),i.zoomFromOrigin&&o||setTimeout((function(){i.outer.addClass("lg-visible")}),i.settings.backdropDuration),i.slide(t,!1,!1,!1),i.LGel.trigger(a)})),document.body===this.settings.container&&x("html").addClass("lg-on")}},w.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var t=this.$toolbar.get().clientHeight||0,e=this.outer.find(".lg-components .lg-sub-html").get(),i=this.settings.defaultCaptionHeight||e&&e.clientHeight||0,s=this.outer.find(".lg-thumb-outer").get();return{top:t,bottom:(s?s.clientHeight:0)+i}},w.prototype.setMediaContainerPosition=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.$content.css("top",t+"px").css("bottom",e+"px")},w.prototype.hideBars=function(){var t=this;setTimeout((function(){t.outer.removeClass("lg-hide-items"),t.settings.hideBarsDelay>0&&(t.outer.on("mousemove.lg click.lg touchstart.lg",(function(){t.outer.removeClass("lg-hide-items"),clearTimeout(t.hideBarTimeout),t.hideBarTimeout=setTimeout((function(){t.outer.addClass("lg-hide-items")}),t.settings.hideBarsDelay)})),t.outer.trigger("mousemove.lg"))}),this.settings.showBarsAfter)},w.prototype.initPictureFill=function(t){if(this.settings.supportLegacyBrowser)try{picturefill({elements:[t.get()]})}catch(t){console.warn("lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.")}},w.prototype.counter=function(){if(this.settings.counter){var t='
\n '+(this.index+1)+' /\n '+this.galleryItems.length+"
";this.outer.find(this.settings.appendCounterTo).append(t)}},w.prototype.addHtml=function(t){var e,i;if(this.galleryItems[t].subHtmlUrl?i=this.galleryItems[t].subHtmlUrl:e=this.galleryItems[t].subHtml,!i)if(e){var s=e.substring(0,1);"."!==s&&"#"!==s||(e=this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?x(this.items).eq(t).find(e).first().html():x(e).first().html())}else e="";if(".lg-item"!==this.settings.appendSubHtmlTo)i?this.outer.find(".lg-sub-html").load(i):this.outer.find(".lg-sub-html").html(e);else{var n=x(this.getSlideItemId(t));i?n.load(i):n.append('
'+e+"
")}null!=e&&(""===e?this.outer.find(this.settings.appendSubHtmlTo).addClass("lg-empty-html"):this.outer.find(this.settings.appendSubHtmlTo).removeClass("lg-empty-html")),this.LGel.trigger(r,{index:t})},w.prototype.preload=function(t){for(var e=1;e<=this.settings.preload&&!(e>=this.galleryItems.length-t);e++)this.loadContent(t+e,!1);for(var i=1;i<=this.settings.preload&&!(t-i<0);i++)this.loadContent(t-i,!1)},w.prototype.getDummyImgStyles=function(t){return t?"width:"+t.width+"px;\n margin-left: -"+t.width/2+"px;\n margin-top: -"+t.height/2+"px;\n height:"+t.height+"px":""},w.prototype.getVideoContStyle=function(t){return t?"width:"+t.width+"px;\n height:"+t.height+"px":""},w.prototype.getDummyImageContent=function(t,e,i){var s;if(this.settings.dynamic||(s=x(this.items).eq(e)),s){var n=void 0;if(!(n=this.settings.exThumbImage?s.attr(this.settings.exThumbImage):s.find("img").first().attr("src")))return"";var o="';return t.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),o}return""},w.prototype.setImgMarkup=function(t,e,i){var s=this.galleryItems[i],n=s.alt,o=s.srcset,r=s.sizes,l=s.sources,a=n?'alt="'+n+'"':"",d=' '+(this.isFirstSlideWithZoomAnimation()?this.getDummyImageContent(e,i,a):D(i,t,a,o,r,l))+"";e.prepend(d)},w.prototype.onSlideObjectLoad=function(t,e,i,s){var n=t.find(".lg-object").first();z(n.get())||e?i():(n.on("load.lg error.lg",(function(){i&&i()})),n.on("error.lg",(function(){s&&s()})))},w.prototype.onLgObjectLoad=function(t,e,i,s,n,o){var r=this;this.onSlideObjectLoad(t,o,(function(){r.triggerSlideItemLoad(t,e,i,s,n)}),(function(){t.addClass("lg-complete lg-complete_"),t.html('Oops... Failed to load content...')}))},w.prototype.triggerSlideItemLoad=function(t,e,i,s,n){var o=this,r=this.galleryItems[e],l=n&&"video"===this.getSlideType(r)&&!r.poster?s:0;setTimeout((function(){t.addClass("lg-complete lg-complete_"),o.LGel.trigger(d,{index:e,delay:i||0,isFirstSlide:n})}),l)},w.prototype.isFirstSlideWithZoomAnimation=function(){return!(this.lGalleryOn||!this.zoomFromOrigin||!this.currentImageSize)},w.prototype.addSlideVideoInfo=function(t){var e=this;t.forEach((function(t,i){t.__slideVideoInfo=P(t.src,!!t.video,i),t.__slideVideoInfo&&e.settings.loadYouTubePoster&&!t.poster&&t.__slideVideoInfo.youtube&&(t.poster="//img.youtube.com/vi/"+t.__slideVideoInfo.youtube[1]+"/maxresdefault.jpg")}))},w.prototype.loadContent=function(t,i){var n=this,o=this.galleryItems[t],r=x(this.getSlideItemId(t)),l=o.poster,a=o.srcset,d=o.sizes,g=o.sources,h=o.src,c=o.video,u=c&&"string"==typeof c?JSON.parse(c):c;if(o.responsive){var m=o.responsive.split(",");h=L(m)||h}var p=o.__slideVideoInfo,f="",y=!!o.iframe,v=!this.lGalleryOn,b=0;if(v&&(b=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),!r.hasClass("lg-loaded")){if(p){var I=this.mediaContainerPosition,C=I.top,w=I.bottom,S=T(this.items[t],this.outer,C+w,p&&this.settings.videoMaxSize);f=this.getVideoContStyle(S)}if(y){var E=O(this.settings.iframeWidth,this.settings.iframeHeight,this.settings.iframeMaxWidth,this.settings.iframeMaxHeight,h,o.iframeTitle);r.prepend(E)}else if(l){var z="";v&&this.zoomFromOrigin&&this.currentImageSize&&(z=this.getDummyImageContent(r,t,""));E=M(l,z||"",f,this.settings.strings.playVideo,p);r.prepend(E)}else if(p){E='
';r.prepend(E)}else if(this.setImgMarkup(h,r,t),a||g){var G=r.find(".lg-object");this.initPictureFill(G)}(l||p)&&this.LGel.trigger(s,{index:t,src:h,html5Video:u,hasPoster:!!l}),this.LGel.trigger(e,{index:t}),this.lGalleryOn&&".lg-item"===this.settings.appendSubHtmlTo&&this.addHtml(t)}var k=0;b&&!x(document.body).hasClass("lg-from-hash")&&(k=b),this.isFirstSlideWithZoomAnimation()&&(setTimeout((function(){r.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")}),this.settings.startAnimationDuration+100),r.hasClass("lg-loaded")||setTimeout((function(){if("image"===n.getSlideType(o)){var e=o.alt,i=e?'alt="'+e+'"':"";if(r.find(".lg-img-wrap").append(D(t,h,i,a,d,o.sources)),a||g){var s=r.find(".lg-object");n.initPictureFill(s)}}("image"===n.getSlideType(o)||"video"===n.getSlideType(o)&&l)&&(n.onLgObjectLoad(r,t,b,k,!0,!1),n.onSlideObjectLoad(r,!(!p||!p.html5||l),(function(){n.loadContentOnFirstSlideLoad(t,r,k)}),(function(){n.loadContentOnFirstSlideLoad(t,r,k)})))}),this.settings.startAnimationDuration+100)),r.addClass("lg-loaded"),this.isFirstSlideWithZoomAnimation()&&("video"!==this.getSlideType(o)||l)||this.onLgObjectLoad(r,t,b,k,v,!(!p||!p.html5||l)),this.zoomFromOrigin&&this.currentImageSize||!r.hasClass("lg-complete_")||this.lGalleryOn||setTimeout((function(){r.addClass("lg-complete")}),this.settings.backdropDuration),this.lGalleryOn=!0,!0===i&&(r.hasClass("lg-complete_")?this.preload(t):r.find(".lg-object").first().on("load.lg error.lg",(function(){n.preload(t)})))},w.prototype.loadContentOnFirstSlideLoad=function(t,e,i){var s=this;setTimeout((function(){e.find(".lg-dummy-img").remove(),e.removeClass("lg-first-slide"),s.outer.removeClass("lg-first-slide-loading"),s.isDummyImageRemoved=!0,s.preload(t)}),i+300)},w.prototype.getItemsToBeInsertedToDom=function(t,e,i){var s=this;void 0===i&&(i=0);var n=[],o=Math.max(i,3);o=Math.min(o,this.galleryItems.length);var r="lg-item-"+this.lgId+"-"+e;if(this.galleryItems.length<=3)return this.galleryItems.forEach((function(t,e){n.push("lg-item-"+s.lgId+"-"+e)})),n;if(t<(this.galleryItems.length-1)/2){for(var l=t;l>t-o/2&&l>=0;l--)n.push("lg-item-"+this.lgId+"-"+l);var a=n.length;for(l=0;l')})),this.currentItemsInDom.forEach((function(t){-1===s.indexOf(t)&&x("#"+t).remove()})),s},w.prototype.getPreviousSlideIndex=function(){var t=0;try{var e=this.outer.find(".lg-current").first().attr("id");t=parseInt(e.split("-")[3])||0}catch(e){t=0}return t},w.prototype.setDownloadValue=function(t){if(this.settings.download){var e=this.galleryItems[t];if(!1===e.downloadUrl||"false"===e.downloadUrl)this.outer.addClass("lg-hide-download");else{var i=this.getElementById("lg-download");this.outer.removeClass("lg-hide-download"),i.attr("href",e.downloadUrl||e.src),e.download&&i.attr("download",e.download)}}},w.prototype.makeSlideAnimation=function(t,e,i){var s=this;this.lGalleryOn&&i.addClass("lg-slide-progress"),setTimeout((function(){s.outer.addClass("lg-no-trans"),s.outer.find(".lg-item").removeClass("lg-prev-slide lg-next-slide"),"prev"===t?(e.addClass("lg-prev-slide"),i.addClass("lg-next-slide")):(e.addClass("lg-next-slide"),i.addClass("lg-prev-slide")),setTimeout((function(){s.outer.find(".lg-item").removeClass("lg-current"),e.addClass("lg-current"),s.outer.removeClass("lg-no-trans")}),50)}),this.lGalleryOn?this.settings.slideDelay:0)},w.prototype.slide=function(t,e,i,s){var n=this,o=this.getPreviousSlideIndex();if(this.currentItemsInDom=this.organizeSlideItems(t,o),!this.lGalleryOn||o!==t){var r=this.galleryItems.length;if(!this.lgBusy){this.settings.counter&&this.updateCurrentCounter(t);var l=this.getSlideItem(t),a=this.getSlideItem(o),d=this.galleryItems[t],c=d.__slideVideoInfo;if(this.outer.attr("data-lg-slide-type",this.getSlideType(d)),this.setDownloadValue(t),c){var u=this.mediaContainerPosition,m=u.top,p=u.bottom,f=T(this.items[t],this.outer,m+p,c&&this.settings.videoMaxSize);this.resizeVideoSlide(t,f)}if(this.LGel.trigger(g,{prevIndex:o,index:t,fromTouch:!!e,fromThumb:!!i}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(t),s||(to&&(s="next")),e){this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide");var y=void 0,v=void 0;r>2?(y=t-1,v=t+1,(0===t&&o===r-1||t===r-1&&0===o)&&(v=0,y=r-1)):(y=0,v=1),"prev"===s?this.getSlideItem(v).addClass("lg-next-slide"):this.getSlideItem(y).addClass("lg-prev-slide"),l.addClass("lg-current")}else this.makeSlideAnimation(s,l,a);this.lGalleryOn?setTimeout((function(){n.loadContent(t,!0),".lg-item"!==n.settings.appendSubHtmlTo&&n.addHtml(t)}),this.settings.speed+50+(e?0:this.settings.slideDelay)):this.loadContent(t,!0),setTimeout((function(){n.lgBusy=!1,a.removeClass("lg-slide-progress"),n.LGel.trigger(h,{prevIndex:o,index:t,fromTouch:e,fromThumb:i})}),(this.lGalleryOn?this.settings.speed+100:100)+(e?0:this.settings.slideDelay))}this.index=t}},w.prototype.updateCurrentCounter=function(t){this.getElementById("lg-counter-current").html(t+1+"")},w.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},w.prototype.getSlideType=function(t){return t.__slideVideoInfo?"video":t.iframe?"iframe":"image"},w.prototype.touchMove=function(t,e,i){var s=e.pageX-t.pageX,n=e.pageY-t.pageY,o=!1;if(this.swipeDirection?o=!0:Math.abs(s)>15?(this.swipeDirection="horizontal",o=!0):Math.abs(n)>15&&(this.swipeDirection="vertical",o=!0),o){var r=this.getSlideItem(this.index);if("horizontal"===this.swipeDirection){null==i||i.preventDefault(),this.outer.addClass("lg-dragging"),this.setTranslate(r,s,0);var l=r.get().offsetWidth,a=15*l/100-Math.abs(10*s/100);this.setTranslate(this.outer.find(".lg-prev-slide").first(),-l+s-a,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),l+s+a,0)}else if("vertical"===this.swipeDirection&&this.settings.swipeToClose){null==i||i.preventDefault(),this.$container.addClass("lg-dragging-vertical");var d=1-Math.abs(n)/window.innerHeight;this.$backdrop.css("opacity",d);var g=1-Math.abs(n)/(2*window.innerWidth);this.setTranslate(r,0,n,g,g),Math.abs(n)>100&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")}}},w.prototype.touchEnd=function(t,e,i){var s,n=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout((function(){n.$container.removeClass("lg-dragging-vertical"),n.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var o=!0;if("horizontal"===n.swipeDirection){s=t.pageX-e.pageX;var r=Math.abs(t.pageX-e.pageX);s<0&&r>n.settings.swipeThreshold?(n.goToNextSlide(!0),o=!1):s>0&&r>n.settings.swipeThreshold&&(n.goToPrevSlide(!0),o=!1)}else if("vertical"===n.swipeDirection){if(s=Math.abs(t.pageY-e.pageY),n.settings.closable&&n.settings.swipeToClose&&s>100)return void n.closeGallery();n.$backdrop.css("opacity",1)}if(n.outer.find(".lg-item").removeAttr("style"),o&&Math.abs(t.pageX-e.pageX)<5){var l=x(i.target);n.isPosterElement(l)&&n.LGel.trigger(c)}n.swipeDirection=void 0})),setTimeout((function(){n.outer.hasClass("lg-dragging")||"lg-slide"===n.settings.mode||n.outer.removeClass("lg-slide")}),this.settings.speed+100)},w.prototype.enableSwipe=function(){var t=this,e={},i={},s=!1,n=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",(function(i){t.dragOrSwipeEnabled=!0;var s=t.getSlideItem(t.index);!x(i.target).hasClass("lg-item")&&!s.get().contains(i.target)||t.outer.hasClass("lg-zoomed")||t.lgBusy||1!==i.targetTouches.length||(n=!0,t.touchAction="swipe",t.manageSwipeClass(),e={pageX:i.targetTouches[0].pageX,pageY:i.targetTouches[0].pageY})})),this.$inner.on("touchmove.lg",(function(o){n&&"swipe"===t.touchAction&&1===o.targetTouches.length&&(i={pageX:o.targetTouches[0].pageX,pageY:o.targetTouches[0].pageY},t.touchMove(e,i,o),s=!0)})),this.$inner.on("touchend.lg",(function(o){if("swipe"===t.touchAction){if(s)s=!1,t.touchEnd(i,e,o);else if(n){var r=x(o.target);t.isPosterElement(r)&&t.LGel.trigger(c)}t.touchAction=void 0,n=!1}})))},w.prototype.enableDrag=function(){var t=this,e={},i={},s=!1,n=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",(function(i){t.dragOrSwipeEnabled=!0;var n=t.getSlideItem(t.index);(x(i.target).hasClass("lg-item")||n.get().contains(i.target))&&(t.outer.hasClass("lg-zoomed")||t.lgBusy||(i.preventDefault(),t.lgBusy||(t.manageSwipeClass(),e={pageX:i.pageX,pageY:i.pageY},s=!0,t.outer.get().scrollLeft+=1,t.outer.get().scrollLeft-=1,t.outer.removeClass("lg-grab").addClass("lg-grabbing"),t.LGel.trigger(u))))})),x(window).on("mousemove.lg.global"+this.lgId,(function(o){s&&t.lgOpened&&(n=!0,i={pageX:o.pageX,pageY:o.pageY},t.touchMove(e,i),t.LGel.trigger(m))})),x(window).on("mouseup.lg.global"+this.lgId,(function(o){if(t.lgOpened){var r=x(o.target);n?(n=!1,t.touchEnd(i,e,o),t.LGel.trigger(p)):t.isPosterElement(r)&&t.LGel.trigger(c),s&&(s=!1,t.outer.removeClass("lg-grabbing").addClass("lg-grab"))}})))},w.prototype.triggerPosterClick=function(){var t=this;this.$inner.on("click.lg",(function(e){!t.dragOrSwipeEnabled&&t.isPosterElement(x(e.target))&&t.LGel.trigger(c)}))},w.prototype.manageSwipeClass=function(){var t=this.index+1,e=this.index-1;this.settings.loop&&this.galleryItems.length>2&&(0===this.index?e=this.galleryItems.length-1:this.index===this.galleryItems.length-1&&(t=0)),this.outer.find(".lg-item").removeClass("lg-next-slide lg-prev-slide"),e>-1&&this.getSlideItem(e).addClass("lg-prev-slide"),this.getSlideItem(t).addClass("lg-next-slide")},w.prototype.goToNextSlide=function(t){var e=this,i=this.settings.loop;t&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(this.index+10?(this.index--,this.LGel.trigger(y,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):i?(this.index=this.galleryItems.length-1,this.LGel.trigger(y,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-left-end"),setTimeout((function(){e.outer.removeClass("lg-left-end")}),400)))},w.prototype.keyPress=function(){var t=this;x(window).on("keydown.lg.global"+this.lgId,(function(e){t.lgOpened&&!0===t.settings.escKey&&27===e.keyCode&&(e.preventDefault(),t.settings.allowMediaOverlap&&t.outer.hasClass("lg-can-toggle")&&t.outer.hasClass("lg-components-open")?t.outer.removeClass("lg-components-open"):t.closeGallery()),t.lgOpened&&t.galleryItems.length>1&&(37===e.keyCode&&(e.preventDefault(),t.goToPrevSlide()),39===e.keyCode&&(e.preventDefault(),t.goToNextSlide()))}))},w.prototype.arrow=function(){var t=this;this.getElementById("lg-prev").on("click.lg",(function(){t.goToPrevSlide()})),this.getElementById("lg-next").on("click.lg",(function(){t.goToNextSlide()}))},w.prototype.arrowDisable=function(t){if(!this.settings.loop&&this.settings.hideControlOnEnd){var e=this.getElementById("lg-prev"),i=this.getElementById("lg-next");t+1===this.galleryItems.length?i.attr("disabled","disabled").addClass("disabled"):i.removeAttr("disabled").removeClass("disabled"),0===t?e.attr("disabled","disabled").addClass("disabled"):e.removeAttr("disabled").removeClass("disabled")}},w.prototype.setTranslate=function(t,e,i,s,n){void 0===s&&(s=1),void 0===n&&(n=1),t.css("transform","translate3d("+e+"px, "+i+"px, 0px) scale3d("+s+", "+n+", 1)")},w.prototype.mousewheel=function(){var t=this,e=0;this.outer.on("wheel.lg",(function(i){if(i.deltaY&&!(t.galleryItems.length<2)){i.preventDefault();var s=(new Date).getTime();s-e<1e3||(e=s,i.deltaY>0?t.goToNextSlide():i.deltaY<0&&t.goToPrevSlide())}}))},w.prototype.isSlideElement=function(t){return t.hasClass("lg-outer")||t.hasClass("lg-item")||t.hasClass("lg-img-wrap")},w.prototype.isPosterElement=function(t){var e=this.getSlideItem(this.index).find(".lg-video-play-button").get();return t.hasClass("lg-video-poster")||t.hasClass("lg-video-play-button")||e&&e.contains(t.get())},w.prototype.toggleMaximize=function(){var t=this;this.getElementById("lg-maximize").on("click.lg",(function(){t.$container.toggleClass("lg-inline"),t.refreshOnResize()}))},w.prototype.invalidateItems=function(){for(var t=0;tr){n=a;break}l===o.length-1&&(n=a)}var d=n.split("-"),g=parseInt(d[0],10),h=parseInt(d[1],10),c=e.width(),u=e.height()-i,m=Math.min(c,g),p=Math.min(u,h),f=Math.min(m/g,p/h);return{width:g*f,height:h*f}}},E=function(t,e,i,s,n){if(n){var o=x(t).find("img").first();if(o.get()){var r=e.get().getBoundingClientRect(),l=r.width,a=e.height()-(i+s),d=o.width(),g=o.height(),h=o.style(),c=(l-d)/2-o.offset().left+(parseFloat(h.paddingLeft)||0)+(parseFloat(h.borderLeft)||0)+x(window).scrollLeft()+r.left,u=(a-g)/2-o.offset().top+(parseFloat(h.paddingTop)||0)+(parseFloat(h.borderTop)||0)+x(window).scrollTop()+i;return"translate3d("+(c*=-1)+"px, "+(u*=-1)+"px, 0) scale3d("+d/n.width+", "+g/n.height+", 1)"}}},O=function(t,e,i,s,n,o){return'
\n \n
'},D=function(t,e,i,s,n,o){var r="',l="";o&&(l=("string"==typeof o?JSON.parse(o):o).map((function(t){var e="";return Object.keys(t).forEach((function(i){e+=" "+i+'="'+t[i]+'"'})),""})));return""+l+r},L=function(t){for(var e=[],i=[],s="",n=0;nr){s=i[l];break}return s},z=function(t){return!!t&&(!!t.complete&&0!==t.naturalWidth)},M=function(t,e,i,s,n){return'
\n
\n \n '+s+'\n \n \n \n \n \n \n \n
\n '+(e||"")+'\n \n
'},G=function(t){var e=t.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])');return[].filter.call(e,(function(t){var e=window.getComputedStyle(t);return"none"!==e.display&&"hidden"!==e.visibility}))},k=function(t,e,i,s){var n=[],o=function(){for(var t=0,e=0,i=arguments.length;e-1&&(d=a),d&&(e[d]=l.value)}}var g=x(t),h=g.find("img").first().attr("alt"),c=g.attr("title"),u=s?g.attr(s):g.find("img").first().attr("src");e.thumb=u,i&&!e.subHtml&&(e.subHtml=c||h||""),e.alt=h||c||"",n.push(e)})),n},A=function(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)},P=function(t,e,i){if(!t)return e?{html5:!0}:void console.error("lightGallery :- data-src is not provided on slide item "+(i+1)+". Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/");var s=t.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)([\&|?][\S]*)*/i),n=t.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)(.*)?/i),o=t.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return s?{youtube:s}:n?{vimeo:n}:o?{wistia:o}:void 0},B=0,F=function(){function w(t,e){if(this.lgOpened=!1,this.index=0,this.plugins=[],this.lGalleryOn=!1,this.lgBusy=!1,this.currentItemsInDom=[],this.prevScrollTop=0,this.bodyPaddingRight=0,this.isDummyImageRemoved=!1,this.dragOrSwipeEnabled=!1,this.mediaContainerPosition={top:0,bottom:0},!t)return this;if(B++,this.lgId=B,this.el=t,this.LGel=x(t),this.generateSettings(e),this.buildModules(),this.settings.dynamic&&void 0!==this.settings.dynamicEl&&!Array.isArray(this.settings.dynamicEl))throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.galleryItems=this.getItems(),this.normalizeSettings(),this.init(),this.validateLicense(),this}return w.prototype.generateSettings=function(e){if(this.settings=t(t({},I),e),this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():A()){var i=t(t({},this.settings.mobileSettings),this.settings.mobileSettings);this.settings=t(t({},this.settings),i)}},w.prototype.normalizeSettings=function(){this.settings.slideEndAnimation&&(this.settings.hideControlOnEnd=!1),this.settings.closable||(this.settings.swipeToClose=!1),this.zoomFromOrigin=this.settings.zoomFromOrigin,this.settings.dynamic&&(this.zoomFromOrigin=!1),this.settings.container||(this.settings.container=document.body),this.settings.preload=Math.min(this.settings.preload,this.galleryItems.length)},w.prototype.init=function(){var t=this;this.addSlideVideoInfo(this.galleryItems),this.buildStructure(),this.LGel.trigger(i,{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout((function(){t.enableDrag(),t.enableSwipe(),t.triggerPosterClick()}),50),this.arrow(),this.settings.mousewheel&&this.mousewheel(),this.settings.dynamic||this.openGalleryOnItemClick()},w.prototype.openGalleryOnItemClick=function(){for(var t=this,e=function(e){var s=i.items[e],n=x(s),o=C.generateUUID();n.attr("data-lg-id",o).on("click.lgcustom-item-"+o,(function(i){i.preventDefault();var n=t.settings.index||e;t.openGallery(n,s)}))},i=this,s=0;s '+this.settings.prevHtml+' \n "),".lg-item"!==this.settings.appendSubHtmlTo&&(i='
');var s="";this.settings.allowMediaOverlap&&(s+="lg-media-overlap ");var n=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",o=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",r="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),l=this.settings.closable&&this.settings.showCloseIcon?'':"",a=this.settings.showMaximizeIcon?'':"",d='\n \n ";x(this.settings.container).append(d),document.body!==this.settings.container&&x(this.settings.container).css("position","relative"),this.outer=this.getElementById("lg-outer"),this.$lgComponents=this.getElementById("lg-components"),this.$backdrop=this.getElementById("lg-backdrop"),this.$container=this.getElementById("lg-container"),this.$inner=this.getElementById("lg-inner"),this.$content=this.getElementById("lg-content"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms");var g=this.settings.mode+" ";this.manageSingleSlideClassName(),this.settings.enableDrag&&(g+="lg-grab "),this.outer.addClass(g),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append(''),this.counter(),x(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,(function(){t.refreshOnResize()})),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.initModules()}},w.prototype.refreshOnResize=function(){if(this.lgOpened){var t=this.galleryItems[this.index].__slideVideoInfo;this.mediaContainerPosition=this.getMediaContainerPosition();var e=this.mediaContainerPosition,i=e.top,s=e.bottom;if(this.currentImageSize=T(this.items[this.index],this.outer,i+s,t&&this.settings.videoMaxSize),t&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved){var o=this.getDummyImgStyles(this.currentImageSize);this.outer.find(".lg-current .lg-dummy-img").first().attr("style",o)}this.LGel.trigger(n)}},w.prototype.resizeVideoSlide=function(t,e){var i=this.getVideoContStyle(e);this.getSlideItem(t).find(".lg-video-cont").attr("style",i)},w.prototype.updateSlides=function(t,e){if(this.index>t.length-1&&(this.index=t.length-1),1===t.length&&(this.index=0),t.length){var i=this.galleryItems[e].src;this.galleryItems=t,this.updateControls(),this.$inner.empty(),this.currentItemsInDom=[];var s=0;this.galleryItems.some((function(t,e){return t.src===i&&(s=e,!0)})),this.currentItemsInDom=this.organizeSlideItems(s,-1),this.loadContent(s,!0),this.getSlideItem(s).addClass("lg-current"),this.index=s,this.updateCurrentCounter(s),this.LGel.trigger(o)}else this.closeGallery()},w.prototype.getItems=function(){if(this.items=[],this.settings.dynamic)return this.settings.dynamicEl||[];if("this"===this.settings.selector)this.items.push(this.el);else if(this.settings.selector)if("string"==typeof this.settings.selector)if(this.settings.selectWithin){var t=x(this.settings.selectWithin);this.items=t.find(this.settings.selector).get()}else this.items=this.el.querySelectorAll(this.settings.selector);else this.items=this.settings.selector;else this.items=this.el.children;return k(this.items,this.settings.extraProps,this.settings.getCaptionFromTitleOrAlt,this.settings.exThumbImage)},w.prototype.shouldHideScrollbar=function(){return this.settings.hideScrollbar&&document.body===this.settings.container},w.prototype.hideScrollbar=function(){if(this.shouldHideScrollbar()){this.bodyPaddingRight=parseFloat(x("body").style().paddingRight);var t=document.documentElement.getBoundingClientRect(),e=window.innerWidth-t.width;x(document.body).css("padding-right",e+this.bodyPaddingRight+"px"),x(document.body).addClass("lg-overlay-open")}},w.prototype.resetScrollBar=function(){this.shouldHideScrollbar()&&(x(document.body).css("padding-right",this.bodyPaddingRight+"px"),x(document.body).removeClass("lg-overlay-open"))},w.prototype.openGallery=function(t,e){var i=this;if(void 0===t&&(t=this.settings.index),!this.lgOpened){this.lgOpened=!0,this.outer.removeClass("lg-hide-items"),this.hideScrollbar(),this.$container.addClass("lg-show");var s=this.getItemsToBeInsertedToDom(t,t);this.currentItemsInDom=s;var n="";s.forEach((function(t){n=n+'
'})),this.$inner.append(n),this.addHtml(t);var o="";this.mediaContainerPosition=this.getMediaContainerPosition();var r=this.mediaContainerPosition,d=r.top,g=r.bottom;this.settings.allowMediaOverlap||this.setMediaContainerPosition(d,g);var h=this.galleryItems[t].__slideVideoInfo;this.zoomFromOrigin&&e&&(this.currentImageSize=T(e,this.outer,d+g,h&&this.settings.videoMaxSize),o=E(e,this.outer,d,g,this.currentImageSize)),this.zoomFromOrigin&&o||(this.outer.addClass(this.settings.startClass),this.getSlideItem(t).removeClass("lg-complete"));var c=this.settings.zoomFromOrigin?100:this.settings.backdropDuration;setTimeout((function(){i.outer.addClass("lg-components-open")}),c),this.index=t,this.LGel.trigger(l),this.getSlideItem(t).addClass("lg-current"),this.lGalleryOn=!1,this.prevScrollTop=x(window).scrollTop(),setTimeout((function(){if(i.zoomFromOrigin&&o){var e=i.getSlideItem(t);e.css("transform",o),setTimeout((function(){e.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",i.settings.startAnimationDuration+"ms"),i.outer.addClass("lg-zoom-from-image")})),setTimeout((function(){e.css("transform","translate3d(0, 0, 0)")}),100)}setTimeout((function(){i.$backdrop.addClass("in"),i.$container.addClass("lg-show-in")}),10),setTimeout((function(){i.settings.trapFocus&&document.body===i.settings.container&&i.trapFocus()}),i.settings.backdropDuration+50),i.zoomFromOrigin&&o||setTimeout((function(){i.outer.addClass("lg-visible")}),i.settings.backdropDuration),i.slide(t,!1,!1,!1),i.LGel.trigger(a)})),document.body===this.settings.container&&x("html").addClass("lg-on")}},w.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var t=this.$toolbar.get().clientHeight||0,e=this.outer.find(".lg-components .lg-sub-html").get(),i=this.settings.defaultCaptionHeight||e&&e.clientHeight||0,s=this.outer.find(".lg-thumb-outer").get();return{top:t,bottom:(s?s.clientHeight:0)+i}},w.prototype.setMediaContainerPosition=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.$content.css("top",t+"px").css("bottom",e+"px")},w.prototype.hideBars=function(){var t=this;setTimeout((function(){t.outer.removeClass("lg-hide-items"),t.settings.hideBarsDelay>0&&(t.outer.on("mousemove.lg click.lg touchstart.lg",(function(){t.outer.removeClass("lg-hide-items"),clearTimeout(t.hideBarTimeout),t.hideBarTimeout=setTimeout((function(){t.outer.addClass("lg-hide-items")}),t.settings.hideBarsDelay)})),t.outer.trigger("mousemove.lg"))}),this.settings.showBarsAfter)},w.prototype.initPictureFill=function(t){if(this.settings.supportLegacyBrowser)try{picturefill({elements:[t.get()]})}catch(t){console.warn("lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.")}},w.prototype.counter=function(){if(this.settings.counter){var t='
\n '+(this.index+1)+' /\n '+this.galleryItems.length+"
";this.outer.find(this.settings.appendCounterTo).append(t)}},w.prototype.addHtml=function(t){var e,i;if(this.galleryItems[t].subHtmlUrl?i=this.galleryItems[t].subHtmlUrl:e=this.galleryItems[t].subHtml,!i)if(e){var s=e.substring(0,1);"."!==s&&"#"!==s||(e=this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?x(this.items).eq(t).find(e).first().html():x(e).first().html())}else e="";if(".lg-item"!==this.settings.appendSubHtmlTo)i?this.outer.find(".lg-sub-html").load(i):this.outer.find(".lg-sub-html").html(e);else{var n=x(this.getSlideItemId(t));i?n.load(i):n.append('
'+e+"
")}null!=e&&(""===e?this.outer.find(this.settings.appendSubHtmlTo).addClass("lg-empty-html"):this.outer.find(this.settings.appendSubHtmlTo).removeClass("lg-empty-html")),this.LGel.trigger(r,{index:t})},w.prototype.preload=function(t){for(var e=1;e<=this.settings.preload&&!(e>=this.galleryItems.length-t);e++)this.loadContent(t+e,!1);for(var i=1;i<=this.settings.preload&&!(t-i<0);i++)this.loadContent(t-i,!1)},w.prototype.getDummyImgStyles=function(t){return t?"width:"+t.width+"px;\n margin-left: -"+t.width/2+"px;\n margin-top: -"+t.height/2+"px;\n height:"+t.height+"px":""},w.prototype.getVideoContStyle=function(t){return t?"width:"+t.width+"px;\n height:"+t.height+"px":""},w.prototype.getDummyImageContent=function(t,e,i){var s;if(this.settings.dynamic||(s=x(this.items).eq(e)),s){var n=void 0;if(!(n=this.settings.exThumbImage?s.attr(this.settings.exThumbImage):s.find("img").first().attr("src")))return"";var o="';return t.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),o}return""},w.prototype.setImgMarkup=function(t,e,i){var s=this.galleryItems[i],n=s.alt,o=s.srcset,r=s.sizes,l=s.sources,a=n?'alt="'+n+'"':"",d=' '+(this.isFirstSlideWithZoomAnimation()?this.getDummyImageContent(e,i,a):D(i,t,a,o,r,l))+"";e.prepend(d)},w.prototype.onSlideObjectLoad=function(t,e,i,s){var n=t.find(".lg-object").first();z(n.get())||e?i():(n.on("load.lg error.lg",(function(){i&&i()})),n.on("error.lg",(function(){s&&s()})))},w.prototype.onLgObjectLoad=function(t,e,i,s,n,o){var r=this;this.onSlideObjectLoad(t,o,(function(){r.triggerSlideItemLoad(t,e,i,s,n)}),(function(){t.addClass("lg-complete lg-complete_"),t.html('Oops... Failed to load content...')}))},w.prototype.triggerSlideItemLoad=function(t,e,i,s,n){var o=this,r=this.galleryItems[e],l=n&&"video"===this.getSlideType(r)&&!r.poster?s:0;setTimeout((function(){t.addClass("lg-complete lg-complete_"),o.LGel.trigger(d,{index:e,delay:i||0,isFirstSlide:n})}),l)},w.prototype.isFirstSlideWithZoomAnimation=function(){return!(this.lGalleryOn||!this.zoomFromOrigin||!this.currentImageSize)},w.prototype.addSlideVideoInfo=function(t){var e=this;t.forEach((function(t,i){t.__slideVideoInfo=P(t.src,!!t.video,i),t.__slideVideoInfo&&e.settings.loadYouTubePoster&&!t.poster&&t.__slideVideoInfo.youtube&&(t.poster="//img.youtube.com/vi/"+t.__slideVideoInfo.youtube[1]+"/maxresdefault.jpg")}))},w.prototype.loadContent=function(t,i){var n=this,o=this.galleryItems[t],r=x(this.getSlideItemId(t)),l=o.poster,a=o.srcset,d=o.sizes,g=o.sources,h=o.src,c=o.video,u=c&&"string"==typeof c?JSON.parse(c):c;if(o.responsive){var m=o.responsive.split(",");h=L(m)||h}var p=o.__slideVideoInfo,f="",y=!!o.iframe,v=!this.lGalleryOn,b=0;if(v&&(b=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),!r.hasClass("lg-loaded")){if(p){var I=this.mediaContainerPosition,C=I.top,w=I.bottom,S=T(this.items[t],this.outer,C+w,p&&this.settings.videoMaxSize);f=this.getVideoContStyle(S)}if(y){var E=O(this.settings.iframeWidth,this.settings.iframeHeight,this.settings.iframeMaxWidth,this.settings.iframeMaxHeight,h,o.iframeTitle);r.prepend(E)}else if(l){var z="";v&&this.zoomFromOrigin&&this.currentImageSize&&(z=this.getDummyImageContent(r,t,""));E=M(l,z||"",f,this.settings.strings.playVideo,p);r.prepend(E)}else if(p){E='
';r.prepend(E)}else if(this.setImgMarkup(h,r,t),a||g){var G=r.find(".lg-object");this.initPictureFill(G)}(l||p)&&this.LGel.trigger(s,{index:t,src:h,html5Video:u,hasPoster:!!l}),this.LGel.trigger(e,{index:t}),this.lGalleryOn&&".lg-item"===this.settings.appendSubHtmlTo&&this.addHtml(t)}var k=0;b&&!x(document.body).hasClass("lg-from-hash")&&(k=b),this.isFirstSlideWithZoomAnimation()&&(setTimeout((function(){r.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")}),this.settings.startAnimationDuration+100),r.hasClass("lg-loaded")||setTimeout((function(){if("image"===n.getSlideType(o)){var e=o.alt,i=e?'alt="'+e+'"':"";if(r.find(".lg-img-wrap").append(D(t,h,i,a,d,o.sources)),a||g){var s=r.find(".lg-object");n.initPictureFill(s)}}("image"===n.getSlideType(o)||"video"===n.getSlideType(o)&&l)&&(n.onLgObjectLoad(r,t,b,k,!0,!1),n.onSlideObjectLoad(r,!(!p||!p.html5||l),(function(){n.loadContentOnFirstSlideLoad(t,r,k)}),(function(){n.loadContentOnFirstSlideLoad(t,r,k)})))}),this.settings.startAnimationDuration+100)),r.addClass("lg-loaded"),this.isFirstSlideWithZoomAnimation()&&("video"!==this.getSlideType(o)||l)||this.onLgObjectLoad(r,t,b,k,v,!(!p||!p.html5||l)),this.zoomFromOrigin&&this.currentImageSize||!r.hasClass("lg-complete_")||this.lGalleryOn||setTimeout((function(){r.addClass("lg-complete")}),this.settings.backdropDuration),this.lGalleryOn=!0,!0===i&&(r.hasClass("lg-complete_")?this.preload(t):r.find(".lg-object").first().on("load.lg error.lg",(function(){n.preload(t)})))},w.prototype.loadContentOnFirstSlideLoad=function(t,e,i){var s=this;setTimeout((function(){e.find(".lg-dummy-img").remove(),e.removeClass("lg-first-slide"),s.outer.removeClass("lg-first-slide-loading"),s.isDummyImageRemoved=!0,s.preload(t)}),i+300)},w.prototype.getItemsToBeInsertedToDom=function(t,e,i){var s=this;void 0===i&&(i=0);var n=[],o=Math.max(i,3);o=Math.min(o,this.galleryItems.length);var r="lg-item-"+this.lgId+"-"+e;if(this.galleryItems.length<=3)return this.galleryItems.forEach((function(t,e){n.push("lg-item-"+s.lgId+"-"+e)})),n;if(t<(this.galleryItems.length-1)/2){for(var l=t;l>t-o/2&&l>=0;l--)n.push("lg-item-"+this.lgId+"-"+l);var a=n.length;for(l=0;l')})),this.currentItemsInDom.forEach((function(t){-1===s.indexOf(t)&&x("#"+t).remove()})),s},w.prototype.getPreviousSlideIndex=function(){var t=0;try{var e=this.outer.find(".lg-current").first().attr("id");t=parseInt(e.split("-")[3])||0}catch(e){t=0}return t},w.prototype.setDownloadValue=function(t){if(this.settings.download){var e=this.galleryItems[t];if(!1===e.downloadUrl||"false"===e.downloadUrl)this.outer.addClass("lg-hide-download");else{var i=this.getElementById("lg-download");this.outer.removeClass("lg-hide-download"),i.attr("href",e.downloadUrl||e.src),e.download&&i.attr("download",e.download)}}},w.prototype.makeSlideAnimation=function(t,e,i){var s=this;this.lGalleryOn&&i.addClass("lg-slide-progress"),setTimeout((function(){s.outer.addClass("lg-no-trans"),s.outer.find(".lg-item").removeClass("lg-prev-slide lg-next-slide"),"prev"===t?(e.addClass("lg-prev-slide"),i.addClass("lg-next-slide")):(e.addClass("lg-next-slide"),i.addClass("lg-prev-slide")),setTimeout((function(){s.outer.find(".lg-item").removeClass("lg-current"),e.addClass("lg-current"),s.outer.removeClass("lg-no-trans")}),50)}),this.lGalleryOn?this.settings.slideDelay:0)},w.prototype.slide=function(t,e,i,s){var n=this,o=this.getPreviousSlideIndex();if(this.currentItemsInDom=this.organizeSlideItems(t,o),!this.lGalleryOn||o!==t){var r=this.galleryItems.length;if(!this.lgBusy){this.settings.counter&&this.updateCurrentCounter(t);var l=this.getSlideItem(t),a=this.getSlideItem(o),d=this.galleryItems[t],c=d.__slideVideoInfo;if(this.outer.attr("data-lg-slide-type",this.getSlideType(d)),this.setDownloadValue(t),c){var u=this.mediaContainerPosition,m=u.top,p=u.bottom,f=T(this.items[t],this.outer,m+p,c&&this.settings.videoMaxSize);this.resizeVideoSlide(t,f)}if(this.LGel.trigger(g,{prevIndex:o,index:t,fromTouch:!!e,fromThumb:!!i}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(t),s||(to&&(s="next")),e){this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide");var y=void 0,v=void 0;r>2?(y=t-1,v=t+1,(0===t&&o===r-1||t===r-1&&0===o)&&(v=0,y=r-1)):(y=0,v=1),"prev"===s?this.getSlideItem(v).addClass("lg-next-slide"):this.getSlideItem(y).addClass("lg-prev-slide"),l.addClass("lg-current")}else this.makeSlideAnimation(s,l,a);this.lGalleryOn?setTimeout((function(){n.loadContent(t,!0),".lg-item"!==n.settings.appendSubHtmlTo&&n.addHtml(t)}),this.settings.speed+50+(e?0:this.settings.slideDelay)):this.loadContent(t,!0),setTimeout((function(){n.lgBusy=!1,a.removeClass("lg-slide-progress"),n.LGel.trigger(h,{prevIndex:o,index:t,fromTouch:e,fromThumb:i})}),(this.lGalleryOn?this.settings.speed+100:100)+(e?0:this.settings.slideDelay))}this.index=t}},w.prototype.updateCurrentCounter=function(t){this.getElementById("lg-counter-current").html(t+1+"")},w.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},w.prototype.getSlideType=function(t){return t.__slideVideoInfo?"video":t.iframe?"iframe":"image"},w.prototype.touchMove=function(t,e,i){var s=e.pageX-t.pageX,n=e.pageY-t.pageY,o=!1;if(this.swipeDirection?o=!0:Math.abs(s)>15?(this.swipeDirection="horizontal",o=!0):Math.abs(n)>15&&(this.swipeDirection="vertical",o=!0),o){var r=this.getSlideItem(this.index);if("horizontal"===this.swipeDirection){null==i||i.preventDefault(),this.outer.addClass("lg-dragging"),this.setTranslate(r,s,0);var l=r.get().offsetWidth,a=15*l/100-Math.abs(10*s/100);this.setTranslate(this.outer.find(".lg-prev-slide").first(),-l+s-a,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),l+s+a,0)}else if("vertical"===this.swipeDirection&&this.settings.swipeToClose){null==i||i.preventDefault(),this.$container.addClass("lg-dragging-vertical");var d=1-Math.abs(n)/window.innerHeight;this.$backdrop.css("opacity",d);var g=1-Math.abs(n)/(2*window.innerWidth);this.setTranslate(r,0,n,g,g),Math.abs(n)>100&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")}}},w.prototype.touchEnd=function(t,e,i){var s,n=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout((function(){n.$container.removeClass("lg-dragging-vertical"),n.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var o=!0;if("horizontal"===n.swipeDirection){s=t.pageX-e.pageX;var r=Math.abs(t.pageX-e.pageX);s<0&&r>n.settings.swipeThreshold?(n.goToNextSlide(!0),o=!1):s>0&&r>n.settings.swipeThreshold&&(n.goToPrevSlide(!0),o=!1)}else if("vertical"===n.swipeDirection){if(s=Math.abs(t.pageY-e.pageY),n.settings.closable&&n.settings.swipeToClose&&s>100)return void n.closeGallery();n.$backdrop.css("opacity",1)}if(n.outer.find(".lg-item").removeAttr("style"),o&&Math.abs(t.pageX-e.pageX)<5){var l=x(i.target);n.isPosterElement(l)&&n.LGel.trigger(c)}n.swipeDirection=void 0})),setTimeout((function(){n.outer.hasClass("lg-dragging")||"lg-slide"===n.settings.mode||n.outer.removeClass("lg-slide")}),this.settings.speed+100)},w.prototype.enableSwipe=function(){var t=this,e={},i={},s=!1,n=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",(function(i){t.dragOrSwipeEnabled=!0;var s=t.getSlideItem(t.index);!x(i.target).hasClass("lg-item")&&!s.get().contains(i.target)||t.outer.hasClass("lg-zoomed")||t.lgBusy||1!==i.touches.length||(n=!0,t.touchAction="swipe",t.manageSwipeClass(),e={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY})})),this.$inner.on("touchmove.lg",(function(o){n&&"swipe"===t.touchAction&&1===o.touches.length&&(i={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},t.touchMove(e,i,o),s=!0)})),this.$inner.on("touchend.lg",(function(o){if("swipe"===t.touchAction){if(s)s=!1,t.touchEnd(i,e,o);else if(n){var r=x(o.target);t.isPosterElement(r)&&t.LGel.trigger(c)}t.touchAction=void 0,n=!1}})))},w.prototype.enableDrag=function(){var t=this,e={},i={},s=!1,n=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",(function(i){t.dragOrSwipeEnabled=!0;var n=t.getSlideItem(t.index);(x(i.target).hasClass("lg-item")||n.get().contains(i.target))&&(t.outer.hasClass("lg-zoomed")||t.lgBusy||(i.preventDefault(),t.lgBusy||(t.manageSwipeClass(),e={pageX:i.pageX,pageY:i.pageY},s=!0,t.outer.get().scrollLeft+=1,t.outer.get().scrollLeft-=1,t.outer.removeClass("lg-grab").addClass("lg-grabbing"),t.LGel.trigger(u))))})),x(window).on("mousemove.lg.global"+this.lgId,(function(o){s&&t.lgOpened&&(n=!0,i={pageX:o.pageX,pageY:o.pageY},t.touchMove(e,i),t.LGel.trigger(m))})),x(window).on("mouseup.lg.global"+this.lgId,(function(o){if(t.lgOpened){var r=x(o.target);n?(n=!1,t.touchEnd(i,e,o),t.LGel.trigger(p)):t.isPosterElement(r)&&t.LGel.trigger(c),s&&(s=!1,t.outer.removeClass("lg-grabbing").addClass("lg-grab"))}})))},w.prototype.triggerPosterClick=function(){var t=this;this.$inner.on("click.lg",(function(e){!t.dragOrSwipeEnabled&&t.isPosterElement(x(e.target))&&t.LGel.trigger(c)}))},w.prototype.manageSwipeClass=function(){var t=this.index+1,e=this.index-1;this.settings.loop&&this.galleryItems.length>2&&(0===this.index?e=this.galleryItems.length-1:this.index===this.galleryItems.length-1&&(t=0)),this.outer.find(".lg-item").removeClass("lg-next-slide lg-prev-slide"),e>-1&&this.getSlideItem(e).addClass("lg-prev-slide"),this.getSlideItem(t).addClass("lg-next-slide")},w.prototype.goToNextSlide=function(t){var e=this,i=this.settings.loop;t&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(this.index+10?(this.index--,this.LGel.trigger(y,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):i?(this.index=this.galleryItems.length-1,this.LGel.trigger(y,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-left-end"),setTimeout((function(){e.outer.removeClass("lg-left-end")}),400)))},w.prototype.keyPress=function(){var t=this;x(window).on("keydown.lg.global"+this.lgId,(function(e){t.lgOpened&&!0===t.settings.escKey&&27===e.keyCode&&(e.preventDefault(),t.settings.allowMediaOverlap&&t.outer.hasClass("lg-can-toggle")&&t.outer.hasClass("lg-components-open")?t.outer.removeClass("lg-components-open"):t.closeGallery()),t.lgOpened&&t.galleryItems.length>1&&(37===e.keyCode&&(e.preventDefault(),t.goToPrevSlide()),39===e.keyCode&&(e.preventDefault(),t.goToNextSlide()))}))},w.prototype.arrow=function(){var t=this;this.getElementById("lg-prev").on("click.lg",(function(){t.goToPrevSlide()})),this.getElementById("lg-next").on("click.lg",(function(){t.goToNextSlide()}))},w.prototype.arrowDisable=function(t){if(!this.settings.loop&&this.settings.hideControlOnEnd){var e=this.getElementById("lg-prev"),i=this.getElementById("lg-next");t+1===this.galleryItems.length?i.attr("disabled","disabled").addClass("disabled"):i.removeAttr("disabled").removeClass("disabled"),0===t?e.attr("disabled","disabled").addClass("disabled"):e.removeAttr("disabled").removeClass("disabled")}},w.prototype.setTranslate=function(t,e,i,s,n){void 0===s&&(s=1),void 0===n&&(n=1),t.css("transform","translate3d("+e+"px, "+i+"px, 0px) scale3d("+s+", "+n+", 1)")},w.prototype.mousewheel=function(){var t=this,e=0;this.outer.on("wheel.lg",(function(i){if(i.deltaY&&!(t.galleryItems.length<2)){i.preventDefault();var s=(new Date).getTime();s-e<1e3||(e=s,i.deltaY>0?t.goToNextSlide():i.deltaY<0&&t.goToPrevSlide())}}))},w.prototype.isSlideElement=function(t){return t.hasClass("lg-outer")||t.hasClass("lg-item")||t.hasClass("lg-img-wrap")},w.prototype.isPosterElement=function(t){var e=this.getSlideItem(this.index).find(".lg-video-play-button").get();return t.hasClass("lg-video-poster")||t.hasClass("lg-video-play-button")||e&&e.contains(t.get())},w.prototype.toggleMaximize=function(){var t=this;this.getElementById("lg-maximize").on("click.lg",(function(){t.$container.toggleClass("lg-inline"),t.refreshOnResize()}))},w.prototype.invalidateItems=function(){for(var t=0;t'),this.settings.flipHorizontal&&(t+=''),this.settings.rotateLeft&&(t+=''),this.settings.rotateRight&&(t+=''),this.core.$toolbar.append(t)},n.prototype.init=function(){var t=this;this.settings.rotate&&(this.buildTemplates(),this.rotateValuesList={},this.core.LGel.on(e+".rotate",(function(e){var i=e.detail.index;t.core.getSlideItem(i).find(".lg-img-wrap").first().wrap("lg-img-rotate"),t.core.getSlideItem(t.core.index).find(".lg-img-rotate").css("transition-duration",t.settings.rotateSpeed+"ms")})),this.core.outer.find("#lg-rotate-left").first().on("click.lg",this.rotateLeft.bind(this)),this.core.outer.find("#lg-rotate-right").first().on("click.lg",this.rotateRight.bind(this)),this.core.outer.find("#lg-flip-hor").first().on("click.lg",this.flipHorizontal.bind(this)),this.core.outer.find("#lg-flip-ver").first().on("click.lg",this.flipVertical.bind(this)),this.core.LGel.on(i+".rotate",(function(e){t.rotateValuesList[e.detail.index]||(t.rotateValuesList[e.detail.index]={rotate:0,flipHorizontal:1,flipVertical:1})})))},n.prototype.applyStyles=function(){this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().css("transform","rotate("+this.rotateValuesList[this.core.index].rotate+"deg) scale3d("+this.rotateValuesList[this.core.index].flipHorizontal+", "+this.rotateValuesList[this.core.index].flipVertical+", 1)")},n.prototype.rotateLeft=function(){this.rotateValuesList[this.core.index].rotate-=90,this.applyStyles(),this.triggerEvents(r,{rotate:this.rotateValuesList[this.core.index].rotate})},n.prototype.rotateRight=function(){this.rotateValuesList[this.core.index].rotate+=90,this.applyStyles(),this.triggerEvents(o,{rotate:this.rotateValuesList[this.core.index].rotate})},n.prototype.getCurrentRotation=function(t){if(!t)return 0;var e=this.$LG(t).style(),i=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform")||"none";if("none"!==i){var r=i.split("(")[1].split(")")[0].split(",");if(r){var o=Math.round(Math.atan2(r[1],r[0])*(180/Math.PI));return o<0?o+360:o}}return 0},n.prototype.flipHorizontal=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),e=this.getCurrentRotation(t),i="flipHorizontal";90!==e&&270!==e||(i="flipVertical"),this.rotateValuesList[this.core.index][i]*=-1,this.applyStyles(),this.triggerEvents(s,{flipHorizontal:this.rotateValuesList[this.core.index][i]})},n.prototype.flipVertical=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),e=this.getCurrentRotation(t),i="flipVertical";90!==e&&270!==e||(i="flipHorizontal"),this.rotateValuesList[this.core.index][i]*=-1,this.applyStyles(),this.triggerEvents(a,{flipVertical:this.rotateValuesList[this.core.index][i]})},n.prototype.triggerEvents=function(t,e){var i=this;setTimeout((function(){i.core.LGel.trigger(t,e)}),this.settings.rotateSpeed+10)},n.prototype.isImageOrientationChanged=function(){var t=this.rotateValuesList[this.core.index],e=Math.abs(t.rotate)%360!=0,i=t.flipHorizontal<0,r=t.flipVertical<0;return e||i||r},n.prototype.closeGallery=function(){this.isImageOrientationChanged()&&this.core.getSlideItem(this.core.index).css("opacity",0),this.rotateValuesList={}},n.prototype.destroy=function(){this.core.LGel.off(".lg.rotate"),this.core.LGel.off(".rotate")},n}()})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgRotate=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,o=arguments.length;i'),this.settings.flipHorizontal&&(t+=''),this.settings.rotateLeft&&(t+=''),this.settings.rotateRight&&(t+=''),this.core.$toolbar.append(t)},n.prototype.init=function(){var t=this;this.settings.rotate&&(this.buildTemplates(),this.rotateValuesList={},this.core.LGel.on(e+".rotate",(function(e){var i=e.detail.index;t.core.getSlideItem(i).find(".lg-img-rotate").get()||(t.core.getSlideItem(i).find(".lg-object").first().wrap("lg-img-rotate"),t.core.getSlideItem(t.core.index).find(".lg-img-rotate").css("transition-duration",t.settings.rotateSpeed+"ms"))})),this.core.outer.find("#lg-rotate-left").first().on("click.lg",this.rotateLeft.bind(this)),this.core.outer.find("#lg-rotate-right").first().on("click.lg",this.rotateRight.bind(this)),this.core.outer.find("#lg-flip-hor").first().on("click.lg",this.flipHorizontal.bind(this)),this.core.outer.find("#lg-flip-ver").first().on("click.lg",this.flipVertical.bind(this)),this.core.LGel.on(i+".rotate",(function(e){t.rotateValuesList[e.detail.index]||(t.rotateValuesList[e.detail.index]={rotate:0,flipHorizontal:1,flipVertical:1})})))},n.prototype.applyStyles=function(){this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().css("transform","rotate("+this.rotateValuesList[this.core.index].rotate+"deg) scale3d("+this.rotateValuesList[this.core.index].flipHorizontal+", "+this.rotateValuesList[this.core.index].flipVertical+", 1)")},n.prototype.rotateLeft=function(){this.rotateValuesList[this.core.index].rotate-=90,this.applyStyles(),this.triggerEvents(o,{rotate:this.rotateValuesList[this.core.index].rotate})},n.prototype.rotateRight=function(){this.rotateValuesList[this.core.index].rotate+=90,this.applyStyles(),this.triggerEvents(r,{rotate:this.rotateValuesList[this.core.index].rotate})},n.prototype.getCurrentRotation=function(t){if(!t)return 0;var e=this.$LG(t).style(),i=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform")||"none";if("none"!==i){var o=i.split("(")[1].split(")")[0].split(",");if(o){var r=Math.round(Math.atan2(o[1],o[0])*(180/Math.PI));return r<0?r+360:r}}return 0},n.prototype.flipHorizontal=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),e=this.getCurrentRotation(t),i="flipHorizontal";90!==e&&270!==e||(i="flipVertical"),this.rotateValuesList[this.core.index][i]*=-1,this.applyStyles(),this.triggerEvents(s,{flipHorizontal:this.rotateValuesList[this.core.index][i]})},n.prototype.flipVertical=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),e=this.getCurrentRotation(t),i="flipVertical";90!==e&&270!==e||(i="flipHorizontal"),this.rotateValuesList[this.core.index][i]*=-1,this.applyStyles(),this.triggerEvents(a,{flipVertical:this.rotateValuesList[this.core.index][i]})},n.prototype.triggerEvents=function(t,e){var i=this;setTimeout((function(){i.core.LGel.trigger(t,e)}),this.settings.rotateSpeed+10)},n.prototype.isImageOrientationChanged=function(){var t=this.rotateValuesList[this.core.index],e=Math.abs(t.rotate)%360!=0,i=t.flipHorizontal<0,o=t.flipVertical<0;return e||i||o},n.prototype.closeGallery=function(){this.isImageOrientationChanged()&&this.core.getSlideItem(this.core.index).css("opacity",0),this.rotateValuesList={}},n.prototype.destroy=function(){this.core.LGel.off(".lg.rotate"),this.core.LGel.off(".rotate")},n}()})); diff --git a/dist/plugins/rotate/lg-rotate.umd.js b/dist/plugins/rotate/lg-rotate.umd.js index 346c7152e..f66950ce4 100644 --- a/dist/plugins/rotate/lg-rotate.umd.js +++ b/dist/plugins/rotate/lg-rotate.umd.js @@ -1,5 +1,5 @@ /*! - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 @@ -121,17 +121,24 @@ // even after navigating to diferent slides this.rotateValuesList = {}; // event triggered after appending slide content - this.core.LGel.on(lGEvents.afterAppendSlide + ".rotate", function (event) { + this.core.LGel.on(lGEvents.slideItemLoad + ".rotate", function (event) { var index = event.detail.index; - var imageWrap = _this.core + var rotateEl = _this.core .getSlideItem(index) - .find('.lg-img-wrap') - .first(); - imageWrap.wrap('lg-img-rotate'); - _this.core - .getSlideItem(_this.core.index) .find('.lg-img-rotate') - .css('transition-duration', _this.settings.rotateSpeed + 'ms'); + .get(); + if (!rotateEl) { + var imageWrap = _this.core + .getSlideItem(index) + .find('.lg-object') + .first(); + imageWrap.wrap('lg-img-rotate'); + //this.rotateValuesList[this.core.index] + _this.core + .getSlideItem(_this.core.index) + .find('.lg-img-rotate') + .css('transition-duration', _this.settings.rotateSpeed + 'ms'); + } }); this.core.outer .find('#lg-rotate-left') diff --git a/dist/plugins/share/lg-share.es5.js b/dist/plugins/share/lg-share.es5.js index 49b8f1093..2d0335c3c 100644 --- a/dist/plugins/share/lg-share.es5.js +++ b/dist/plugins/share/lg-share.es5.js @@ -1,5 +1,5 @@ /*! - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 diff --git a/dist/plugins/share/lg-share.min.js b/dist/plugins/share/lg-share.min.js index 2595f6ad2..b7bfa4bfd 100644 --- a/dist/plugins/share/lg-share.min.js +++ b/dist/plugins/share/lg-share.min.js @@ -1,5 +1,5 @@ /** - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 diff --git a/dist/plugins/share/lg-share.umd.js b/dist/plugins/share/lg-share.umd.js index 45876ceaa..90f5331ce 100644 --- a/dist/plugins/share/lg-share.umd.js +++ b/dist/plugins/share/lg-share.umd.js @@ -1,5 +1,5 @@ /*! - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 diff --git a/dist/plugins/thumbnail/lg-thumbnail.es5.js b/dist/plugins/thumbnail/lg-thumbnail.es5.js index 15b46d824..18f31f285 100644 --- a/dist/plugins/thumbnail/lg-thumbnail.es5.js +++ b/dist/plugins/thumbnail/lg-thumbnail.es5.js @@ -1,5 +1,5 @@ /*! - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 diff --git a/dist/plugins/thumbnail/lg-thumbnail.min.js b/dist/plugins/thumbnail/lg-thumbnail.min.js index 6fd55498b..109ec5375 100644 --- a/dist/plugins/thumbnail/lg-thumbnail.min.js +++ b/dist/plugins/thumbnail/lg-thumbnail.min.js @@ -1,5 +1,5 @@ /** - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 diff --git a/dist/plugins/thumbnail/lg-thumbnail.umd.js b/dist/plugins/thumbnail/lg-thumbnail.umd.js index 5f5b095ce..d422ab1e5 100644 --- a/dist/plugins/thumbnail/lg-thumbnail.umd.js +++ b/dist/plugins/thumbnail/lg-thumbnail.umd.js @@ -1,5 +1,5 @@ /*! - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 diff --git a/dist/plugins/video/lg-video.es5.js b/dist/plugins/video/lg-video.es5.js index 31e8c6d6b..8c265145a 100644 --- a/dist/plugins/video/lg-video.es5.js +++ b/dist/plugins/video/lg-video.es5.js @@ -1,5 +1,5 @@ /*! - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 diff --git a/dist/plugins/video/lg-video.min.js b/dist/plugins/video/lg-video.min.js index 5bf973554..a4d835ae3 100644 --- a/dist/plugins/video/lg-video.min.js +++ b/dist/plugins/video/lg-video.min.js @@ -1,5 +1,5 @@ /** - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 diff --git a/dist/plugins/video/lg-video.umd.js b/dist/plugins/video/lg-video.umd.js index ad0da9a4b..529aa710c 100644 --- a/dist/plugins/video/lg-video.umd.js +++ b/dist/plugins/video/lg-video.umd.js @@ -1,5 +1,5 @@ /*! - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 diff --git a/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js b/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js index f5711c20c..c1bad1535 100644 --- a/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js +++ b/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.es5.js @@ -1,5 +1,5 @@ /*! - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 diff --git a/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js b/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js index 86f81692b..9f1e5ddac 100644 --- a/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js +++ b/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.min.js @@ -1,5 +1,5 @@ /** - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 diff --git a/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js b/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js index 441ef2a25..51b32becc 100644 --- a/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js +++ b/dist/plugins/vimeoThumbnail/lg-vimeo-thumbnail.umd.js @@ -1,5 +1,5 @@ /*! - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 diff --git a/dist/plugins/zoom/lg-zoom.es5.js b/dist/plugins/zoom/lg-zoom.es5.js index bfde7a931..c3d7ef3a6 100644 --- a/dist/plugins/zoom/lg-zoom.es5.js +++ b/dist/plugins/zoom/lg-zoom.es5.js @@ -1,5 +1,5 @@ /*! - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 @@ -135,158 +135,50 @@ var Zoom = /** @class */ (function () { // Add zoomable class this.core.LGel.on(lGEvents.slideItemLoad + ".zoom", this.enableZoom.bind(this)); }; - Zoom.prototype.getModifier = function (rotateValue, axis, el) { - var originalRotate = rotateValue; - rotateValue = Math.abs(rotateValue); - var transformValues = this.getCurrentTransform(el); - if (!transformValues) { - return 1; - } - var modifier = 1; - if (axis === 'X') { - var flipHorizontalValue = Math.sign(parseFloat(transformValues[0])); - if (rotateValue === 0 || rotateValue === 180) { - modifier = 1; - } - else if (rotateValue === 90) { - if ((originalRotate === -90 && flipHorizontalValue === 1) || - (originalRotate === 90 && flipHorizontalValue === -1)) { - modifier = -1; - } - else { - modifier = 1; - } - } - modifier = modifier * flipHorizontalValue; - } - else { - var flipVerticalValue = Math.sign(parseFloat(transformValues[3])); - if (rotateValue === 0 || rotateValue === 180) { - modifier = 1; - } - else if (rotateValue === 90) { - var sinX = parseFloat(transformValues[1]); - var sinMinusX = parseFloat(transformValues[2]); - modifier = Math.sign(sinX * sinMinusX * originalRotate * flipVerticalValue); - } - modifier = modifier * flipVerticalValue; - } - return modifier; - }; - Zoom.prototype.getImageSize = function ($image, rotateValue, axis) { - var imageSizes = { - y: 'offsetHeight', - x: 'offsetWidth', + Zoom.prototype.getDragCords = function (e) { + return { + x: e.pageX, + y: e.pageY, }; - if (Math.abs(rotateValue) === 90) { - // Swap axis - if (axis === 'x') { - axis = 'y'; - } - else { - axis = 'x'; - } - } - return $image[imageSizes[axis]]; - }; - Zoom.prototype.getDragCords = function (e, rotateValue) { - if (rotateValue === 90) { - return { - x: e.pageY, - y: e.pageX, - }; - } - else { - return { - x: e.pageX, - y: e.pageY, - }; - } - }; - Zoom.prototype.getSwipeCords = function (e, rotateValue) { - var x = e.targetTouches[0].pageX; - var y = e.targetTouches[0].pageY; - if (rotateValue === 90) { - return { - x: y, - y: x, - }; - } - else { - return { - x: x, - y: y, - }; - } - }; - Zoom.prototype.getDragAllowedAxises = function (rotateValue, scale) { - scale = scale || this.scale || 1; - var allowY = this.imageYSize * scale > this.containerRect.height; - var allowX = this.imageXSize * scale > this.containerRect.width; - if (rotateValue === 90) { - return { - allowX: allowY, - allowY: allowX, - }; - } - else { - return { - allowX: allowX, - allowY: allowY, - }; - } }; - /** - * - * @param {Element} el - * @return matrix(cos(X), sin(X), -sin(X), cos(X), 0, 0); - * Get the current transform value - */ - Zoom.prototype.getCurrentTransform = function (el) { - if (!el) { - return; - } - var st = window.getComputedStyle(el, null); - var tm = st.getPropertyValue('-webkit-transform') || - st.getPropertyValue('-moz-transform') || - st.getPropertyValue('-ms-transform') || - st.getPropertyValue('-o-transform') || - st.getPropertyValue('transform') || - 'none'; - if (tm !== 'none') { - return tm.split('(')[1].split(')')[0].split(','); - } - return; - }; - Zoom.prototype.getCurrentRotation = function (el) { - if (!el) { - return 0; - } - var values = this.getCurrentTransform(el); - if (values) { - return Math.round(Math.atan2(parseFloat(values[1]), parseFloat(values[0])) * - (180 / Math.PI)); - // If you want rotate in 360 - //return (angle < 0 ? angle + 360 : angle); - } - return 0; + Zoom.prototype.getSwipeCords = function (e) { + var x = e.touches[0].pageX; + var y = e.touches[0].pageY; + return { + x: x, + y: y, + }; }; - Zoom.prototype.setZoomEssentials = function () { + Zoom.prototype.getDragAllowedAxises = function (scale, scaleDiff) { var $image = this.core .getSlideItem(this.core.index) .find('.lg-image') - .first(); - var rotateEl = this.core - .getSlideItem(this.core.index) - .find('.lg-img-rotate') .first() .get(); - this.rotateValue = this.getCurrentRotation(rotateEl); - this.imageYSize = this.getImageSize($image.get(), this.rotateValue, 'y'); - this.imageXSize = this.getImageSize($image.get(), this.rotateValue, 'x'); - this.containerRect = this.core.outer.get().getBoundingClientRect(); - this.modifierX = this.getModifier(this.rotateValue, 'X', rotateEl); - this.modifierY = this.getModifier(this.rotateValue, 'Y', rotateEl); + var height = 0; + var width = 0; + var rect = $image.getBoundingClientRect(); + if (scale) { + height = $image.offsetHeight * scale; + width = $image.offsetWidth * scale; + } + else if (scaleDiff) { + height = rect.height + scaleDiff * rect.height; + width = rect.width + scaleDiff * rect.width; + } + else { + height = rect.height; + width = rect.width; + } + var allowY = height > this.containerRect.height; + var allowX = width > this.containerRect.width; + return { + allowX: allowX, + allowY: allowY, + }; + }; + Zoom.prototype.setZoomEssentials = function () { + this.containerRect = this.core.$content.get().getBoundingClientRect(); }; /** * @desc Image zoom @@ -294,86 +186,152 @@ var Zoom = /** @class */ (function () { * * @param {String} scale - Zoom decrement/increment value */ - Zoom.prototype.zoomImage = function (scale) { - // Find offset manually to avoid issue after zoom - var offsetX = (this.containerRect.width - this.imageXSize) / 2 + - this.containerRect.left; - var _a = this.core.mediaContainerPosition, top = _a.top, bottom = _a.bottom; - var topBottomSpacing = Math.abs(top - bottom) / 2; - var offsetY = (this.containerRect.height - - this.imageYSize - - topBottomSpacing * this.modifierX) / - 2 + - this.scrollTop + - this.containerRect.top; + Zoom.prototype.zoomImage = function (scale, scaleDiff, reposition, resetToMax) { + if (Math.abs(scaleDiff) <= 0) + return; + var offsetX = this.containerRect.width / 2 + this.containerRect.left; + var offsetY = this.containerRect.height / 2 + + this.containerRect.top + + this.scrollTop; var originalX; var originalY; if (scale === 1) { this.positionChanged = false; } - var dragAllowedAxises = this.getDragAllowedAxises(Math.abs(this.rotateValue), scale); + var dragAllowedAxises = this.getDragAllowedAxises(0, scaleDiff); var allowY = dragAllowedAxises.allowY, allowX = dragAllowedAxises.allowX; if (this.positionChanged) { - originalX = this.left / (this.scale - 1); - originalY = this.top / (this.scale - 1); - this.pageX = Math.abs(originalX) + offsetX; - this.pageY = Math.abs(originalY) + offsetY; + originalX = this.left / (this.scale - scaleDiff); + originalY = this.top / (this.scale - scaleDiff); + this.pageX = offsetX - originalX; + this.pageY = offsetY - originalY; this.positionChanged = false; } - var possibleSwipeCords = this.getPossibleSwipeDragCords(this.rotateValue, scale); + var possibleSwipeCords = this.getPossibleSwipeDragCords(scaleDiff); + var x; + var y; var _x = offsetX - this.pageX; var _y = offsetY - this.pageY; - var x = (scale - 1) * _x; - var y = (scale - 1) * _y; - if (allowX) { - if (this.isBeyondPossibleLeft(x, possibleSwipeCords.minX)) { - x = possibleSwipeCords.minX; - } - else if (this.isBeyondPossibleRight(x, possibleSwipeCords.maxX)) { - x = possibleSwipeCords.maxX; - } + if (scale - scaleDiff > 1) { + var scaleVal = (scale - scaleDiff) / Math.abs(scaleDiff); + _x = + (scaleDiff < 0 ? -_x : _x) + + this.left * (scaleVal + (scaleDiff < 0 ? -1 : 1)); + _y = + (scaleDiff < 0 ? -_y : _y) + + this.top * (scaleVal + (scaleDiff < 0 ? -1 : 1)); + x = _x / scaleVal; + y = _y / scaleVal; } else { - if (scale > 1) { - if (x < possibleSwipeCords.minX) { + var scaleVal = (scale - scaleDiff) * scaleDiff; + x = _x * scaleVal; + y = _y * scaleVal; + } + if (reposition) { + if (allowX) { + if (this.isBeyondPossibleLeft(x, possibleSwipeCords.minX)) { x = possibleSwipeCords.minX; } - else if (x > possibleSwipeCords.maxX) { + else if (this.isBeyondPossibleRight(x, possibleSwipeCords.maxX)) { x = possibleSwipeCords.maxX; } } - } - if (allowY) { - if (this.isBeyondPossibleTop(y, possibleSwipeCords.minY)) { - y = possibleSwipeCords.minY; - } - else if (this.isBeyondPossibleBottom(y, possibleSwipeCords.maxY)) { - y = possibleSwipeCords.maxY; + else { + if (scale > 1) { + if (x < possibleSwipeCords.minX) { + x = possibleSwipeCords.minX; + } + else if (x > possibleSwipeCords.maxX) { + x = possibleSwipeCords.maxX; + } + } } - } - else { - // If the translate value based on index of beyond the viewport, utilize the available space to prevent image being cut out - if (scale > 1) { - //If image goes beyond viewport top, use the minim possible translate value - if (y < possibleSwipeCords.minY) { + // @todo fix this + if (allowY) { + if (this.isBeyondPossibleTop(y, possibleSwipeCords.minY)) { y = possibleSwipeCords.minY; } - else if (y > possibleSwipeCords.maxY) { + else if (this.isBeyondPossibleBottom(y, possibleSwipeCords.maxY)) { y = possibleSwipeCords.maxY; } } + else { + // If the translate value based on index of beyond the viewport, utilize the available space to prevent image being cut out + if (scale > 1) { + //If image goes beyond viewport top, use the minim possible translate value + if (y < possibleSwipeCords.minY) { + y = possibleSwipeCords.minY; + } + else if (y > possibleSwipeCords.maxY) { + y = possibleSwipeCords.maxY; + } + } + } } this.setZoomStyles({ x: x, y: y, scale: scale, }); + this.left = x; + this.top = y; + if (resetToMax) { + var actualSizeScale = this.getCurrentImageActualSizeScale(); + if (scale >= actualSizeScale) { + this.setZoomImageSize(); + } + } + }; + Zoom.prototype.resetImageTranslate = function () { + var $image = this.core + .getSlideItem(this.core.index) + .find('.lg-image') + .first(); + this.imageReset = false; + $image.removeClass('reset-transition reset-transition-y reset-transition-x'); + this.core.outer.removeClass('lg-actual-size'); + $image.css('width', 'auto').css('height', 'auto'); + setTimeout(function () { + $image.removeClass('no-transition'); + }, 10); + }; + Zoom.prototype.setZoomImageSize = function () { + var _this = this; + var $image = this.core + .getSlideItem(this.core.index) + .find('.lg-image') + .first(); + setTimeout(function () { + $image.addClass('no-transition'); + _this.imageReset = true; + }, 500); + setTimeout(function () { + var dragAllowedAxises = _this.getDragAllowedAxises(_this.scale); + $image + .css('width', $image.get().naturalWidth + 'px') + .css('height', $image.get().naturalHeight + 'px'); + _this.core.outer.addClass('lg-actual-size'); + if (dragAllowedAxises.allowX && dragAllowedAxises.allowY) { + $image.addClass('reset-transition'); + } + else if (dragAllowedAxises.allowX && !dragAllowedAxises.allowY) { + $image.addClass('reset-transition-x'); + } + else if (!dragAllowedAxises.allowX && dragAllowedAxises.allowY) { + $image.addClass('reset-transition-y'); + } + }, 550); }; /** * @desc apply scale3d to image and translate to image wrap * @param {style} X,Y and scale */ Zoom.prototype.setZoomStyles = function (style) { + var $imageWrap = this.core + .getSlideItem(this.core.index) + .find('.lg-img-wrap') + .first(); var $image = this.core .getSlideItem(this.core.index) .find('.lg-image') @@ -381,14 +339,11 @@ var Zoom = /** @class */ (function () { var $dummyImage = this.core.outer .find('.lg-current .lg-dummy-img') .first(); - var $imageWrap = $image.parent(); this.scale = style.scale; $image.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)'); $dummyImage.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)'); var transform = 'translate3d(' + style.x + 'px, ' + style.y + 'px, 0)'; $imageWrap.css('transform', transform); - this.left = style.x; - this.top = style.y; }; /** * @param index - Index of the current slide @@ -396,24 +351,29 @@ var Zoom = /** @class */ (function () { */ Zoom.prototype.setActualSize = function (index, event) { var _this = this; - // Allow zoom only on image - if (!this.isImageSlide() || - this.core.outer.hasClass('lg-first-slide-loading')) { - return; - } - var scale = this.getCurrentImageActualSizeScale(); - if (this.core.outer.hasClass('lg-zoomed')) { - this.scale = 1; - } - else { - this.scale = this.getScale(scale); - } - this.setPageCords(event); - this.beginZoom(this.scale); - this.zoomImage(this.scale); + var currentItem = this.core.galleryItems[this.core.index]; + this.resetImageTranslate(); setTimeout(function () { - _this.core.outer.removeClass('lg-grabbing').addClass('lg-grab'); - }, 10); + // Allow zoom only on image + if (!currentItem.src || + _this.core.outer.hasClass('lg-first-slide-loading')) { + return; + } + var scale = _this.getCurrentImageActualSizeScale(); + var prevScale = _this.scale; + if (_this.core.outer.hasClass('lg-zoomed')) { + _this.scale = 1; + } + else { + _this.scale = _this.getScale(scale); + } + _this.setPageCords(event); + _this.beginZoom(_this.scale); + _this.zoomImage(_this.scale, _this.scale - prevScale, true, true); + setTimeout(function () { + _this.core.outer.removeClass('lg-grabbing').addClass('lg-grab'); + }, 10); + }, 50); }; Zoom.prototype.getNaturalWidth = function (index) { var $image = this.core.getSlideItem(index).find('.lg-image').first(); @@ -425,7 +385,7 @@ var Zoom = /** @class */ (function () { Zoom.prototype.getActualSizeScale = function (naturalWidth, width) { var _scale; var scale; - if (naturalWidth > width) { + if (naturalWidth >= width) { _scale = naturalWidth / width; scale = _scale || 2; } @@ -446,11 +406,13 @@ var Zoom = /** @class */ (function () { Zoom.prototype.getPageCords = function (event) { var cords = {}; if (event) { - cords.x = event.pageX || event.targetTouches[0].pageX; - cords.y = event.pageY || event.targetTouches[0].pageY; + cords.x = event.pageX || event.touches[0].pageX; + cords.y = event.pageY || event.touches[0].pageY; } else { - var containerRect = this.core.outer.get().getBoundingClientRect(); + var containerRect = this.core.$content + .get() + .getBoundingClientRect(); cords.x = containerRect.width / 2 + containerRect.left; cords.y = containerRect.height / 2 + this.scrollTop + containerRect.top; @@ -462,15 +424,18 @@ var Zoom = /** @class */ (function () { this.pageX = pageCords.x; this.pageY = pageCords.y; }; + Zoom.prototype.manageActualPixelClassNames = function () { + var $actualSize = this.core.getElementById('lg-actual-size'); + $actualSize + .removeClass(this.settings.actualSizeIcons.zoomIn) + .addClass(this.settings.actualSizeIcons.zoomOut); + }; // If true, zoomed - in else zoomed out Zoom.prototype.beginZoom = function (scale) { this.core.outer.removeClass('lg-zoom-drag-transition lg-zoom-dragging'); if (scale > 1) { this.core.outer.addClass('lg-zoomed'); - var $actualSize = this.core.getElementById('lg-actual-size'); - $actualSize - .removeClass(this.settings.actualSizeIcons.zoomIn) - .addClass(this.settings.actualSizeIcons.zoomOut); + this.manageActualPixelClassNames(); } else { this.resetZoom(); @@ -503,8 +468,7 @@ var Zoom = /** @class */ (function () { }); this.core.outer.on('touchstart.lg', function (event) { var $target = _this.$LG(event.target); - if (event.targetTouches.length === 1 && - $target.hasClass('lg-image')) { + if (event.touches.length === 1 && $target.hasClass('lg-image')) { if (!tapped) { tapped = setTimeout(function () { tapped = null; @@ -518,13 +482,21 @@ var Zoom = /** @class */ (function () { } } }); - // Update zoom on resize and orientationchange this.core.LGel.on(lGEvents.containerResize + ".zoom " + lGEvents.rotateRight + ".zoom " + lGEvents.rotateLeft + ".zoom " + lGEvents.flipHorizontal + ".zoom " + lGEvents.flipVertical + ".zoom", function () { - if (!_this.core.lgOpened || !_this.isImageSlide()) + if (!_this.core.lgOpened || + !_this.isImageSlide() || + _this.core.touchAction) { return; - _this.setPageCords(); + } + var _LGel = _this.core + .getSlideItem(_this.core.index) + .find('.lg-img-wrap') + .first(); + _this.top = 0; + _this.left = 0; _this.setZoomEssentials(); - _this.zoomImage(_this.scale); + _this.setZoomSwipeStyles(_LGel, { x: 0, y: 0 }); + _this.positionChanged = true; }); // Update zoom on resize and orientationchange this.$LG(window).on("scroll.lg.zoom.global" + this.core.lgId, function () { @@ -533,12 +505,23 @@ var Zoom = /** @class */ (function () { _this.scrollTop = _this.$LG(window).scrollTop(); }); this.core.getElementById('lg-zoom-out').on('click.lg', function () { - if (_this.core.outer.find('.lg-current .lg-image').get()) { - _this.scale -= _this.settings.scale; - _this.scale = _this.getScale(_this.scale); - _this.beginZoom(_this.scale); - _this.zoomImage(_this.scale); + // Allow zoom only on image + if (!_this.isImageSlide()) { + return; } + var timeout = 0; + if (_this.imageReset) { + _this.resetImageTranslate(); + timeout = 50; + } + setTimeout(function () { + var scale = _this.scale - _this.settings.scale; + if (scale < 1) { + scale = 1; + } + _this.beginZoom(scale); + _this.zoomImage(scale, -_this.settings.scale, true, true); + }, timeout); }); this.core.getElementById('lg-zoom-in').on('click.lg', function () { _this.zoomIn(); @@ -574,20 +557,15 @@ var Zoom = /** @class */ (function () { this.zoomableTimeout = false; this.positionChanged = false; }; - Zoom.prototype.zoomIn = function (scale) { + Zoom.prototype.zoomIn = function () { // Allow zoom only on image if (!this.isImageSlide()) { return; } - if (scale) { - this.scale = scale; - } - else { - this.scale += this.settings.scale; - } - this.scale = this.getScale(this.scale); - this.beginZoom(this.scale); - this.zoomImage(this.scale); + var scale = this.scale + this.settings.scale; + scale = this.getScale(scale); + this.beginZoom(scale); + this.zoomImage(scale, this.settings.scale, true, true); }; // Reset zoom effect Zoom.prototype.resetZoom = function (index) { @@ -606,34 +584,38 @@ var Zoom = /** @class */ (function () { this.setPageCords(); }; Zoom.prototype.getTouchDistance = function (e) { - return Math.sqrt((e.targetTouches[0].pageX - e.targetTouches[1].pageX) * - (e.targetTouches[0].pageX - e.targetTouches[1].pageX) + - (e.targetTouches[0].pageY - e.targetTouches[1].pageY) * - (e.targetTouches[0].pageY - e.targetTouches[1].pageY)); + return Math.sqrt((e.touches[0].pageX - e.touches[1].pageX) * + (e.touches[0].pageX - e.touches[1].pageX) + + (e.touches[0].pageY - e.touches[1].pageY) * + (e.touches[0].pageY - e.touches[1].pageY)); }; Zoom.prototype.pinchZoom = function () { var _this = this; var startDist = 0; var pinchStarted = false; var initScale = 1; + var prevScale = 0; var $item = this.core.getSlideItem(this.core.index); - this.core.$inner.on('touchstart.lg', function (e) { + this.core.outer.on('touchstart.lg', function (e) { $item = _this.core.getSlideItem(_this.core.index); if (!_this.isImageSlide()) { return; } - if (e.targetTouches.length === 2 && - !_this.core.outer.hasClass('lg-first-slide-loading') && - (_this.$LG(e.target).hasClass('lg-item') || - $item.get().contains(e.target))) { + if (e.touches.length === 2) { + e.preventDefault(); + if (_this.core.outer.hasClass('lg-first-slide-loading')) { + return; + } initScale = _this.scale || 1; _this.core.outer.removeClass('lg-zoom-drag-transition lg-zoom-dragging'); + _this.setPageCords(e); + _this.resetImageTranslate(); _this.core.touchAction = 'pinch'; startDist = _this.getTouchDistance(e); } }); this.core.$inner.on('touchmove.lg', function (e) { - if (e.targetTouches.length === 2 && + if (e.touches.length === 2 && _this.core.touchAction === 'pinch' && (_this.$LG(e.target).hasClass('lg-item') || $item.get().contains(e.target))) { @@ -644,8 +626,12 @@ var Zoom = /** @class */ (function () { pinchStarted = true; } if (pinchStarted) { - _this.scale = Math.max(1, initScale + -distance * 0.008); - _this.zoomImage(_this.scale); + prevScale = _this.scale; + var _scale = Math.max(1, initScale + -distance * 0.02); + _this.scale = + Math.round((_scale + Number.EPSILON) * 100) / 100; + var diff = _this.scale - prevScale; + _this.zoomImage(_this.scale, Math.round((diff + Number.EPSILON) * 100) / 100, false, false); } } }); @@ -659,15 +645,22 @@ var Zoom = /** @class */ (function () { _this.resetZoom(); } else { - _this.scale = _this.getScale(_this.scale); - _this.zoomImage(_this.scale); + var actualSizeScale = _this.getCurrentImageActualSizeScale(); + if (_this.scale >= actualSizeScale) { + var scaleDiff = actualSizeScale - _this.scale; + if (scaleDiff === 0) { + scaleDiff = 0.01; + } + _this.zoomImage(actualSizeScale, scaleDiff, false, true); + } + _this.manageActualPixelClassNames(); _this.core.outer.addClass('lg-zoomed'); } _this.core.touchAction = undefined; } }); }; - Zoom.prototype.touchendZoom = function (startCoords, endCoords, allowX, allowY, touchDuration, rotateValue) { + Zoom.prototype.touchendZoom = function (startCoords, endCoords, allowX, allowY, touchDuration) { var distanceXnew = endCoords.x - startCoords.x; var distanceYnew = endCoords.y - startCoords.y; var speedX = Math.abs(distanceXnew) / touchDuration + 1; @@ -685,9 +678,9 @@ var Zoom = /** @class */ (function () { .find('.lg-img-wrap') .first(); var distance = {}; - distance.x = this.left + distanceXnew * this.modifierX; - distance.y = this.top + distanceYnew * this.modifierY; - var possibleSwipeCords = this.getPossibleSwipeDragCords(rotateValue); + distance.x = this.left + distanceXnew; + distance.y = this.top + distanceYnew; + var possibleSwipeCords = this.getPossibleSwipeDragCords(); if (Math.abs(distanceXnew) > 15 || Math.abs(distanceYnew) > 15) { if (allowY) { if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) { @@ -724,8 +717,7 @@ var Zoom = /** @class */ (function () { Zoom.prototype.getZoomSwipeCords = function (startCoords, endCoords, allowX, allowY, possibleSwipeCords) { var distance = {}; if (allowY) { - distance.y = - this.top + (endCoords.y - startCoords.y) * this.modifierY; + distance.y = this.top + (endCoords.y - startCoords.y); if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) { var diffMinY = possibleSwipeCords.minY - distance.y; distance.y = possibleSwipeCords.minY - diffMinY / 6; @@ -739,8 +731,7 @@ var Zoom = /** @class */ (function () { distance.y = this.top; } if (allowX) { - distance.x = - this.left + (endCoords.x - startCoords.x) * this.modifierX; + distance.x = this.left + (endCoords.x - startCoords.x); if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) { var diffMinX = possibleSwipeCords.minX - distance.x; distance.x = possibleSwipeCords.minX - diffMinX / 6; @@ -771,30 +762,29 @@ var Zoom = /** @class */ (function () { var currentItem = this.core.galleryItems[this.core.index]; return this.core.getSlideType(currentItem) === 'image'; }; - Zoom.prototype.getPossibleSwipeDragCords = function (rotateValue, scale) { - var dataScale = scale || this.scale || 1; - var elDataScale = Math.abs(dataScale); - var _a = this.core.mediaContainerPosition, top = _a.top, bottom = _a.bottom; - var topBottomSpacing = Math.abs(top - bottom) / 2; - var minY = (this.imageYSize - this.containerRect.height) / 2 + - topBottomSpacing * this.modifierX; - var maxY = this.containerRect.height - this.imageYSize * elDataScale + minY; - var minX = (this.imageXSize - this.containerRect.width) / 2; - var maxX = this.containerRect.width - this.imageXSize * elDataScale + minX; + Zoom.prototype.getPossibleSwipeDragCords = function (scale) { + var $image = this.core + .getSlideItem(this.core.index) + .find('.lg-image') + .first(); + var bottom = this.core.mediaContainerPosition.bottom; + var imgRect = $image.get().getBoundingClientRect(); + var imageHeight = imgRect.height; + var imageWidth = imgRect.width; + if (scale) { + imageHeight = imageHeight + scale * imageHeight; + imageWidth = imageWidth + scale * imageWidth; + } + var minY = (imageHeight - this.containerRect.height) / 2; + var maxY = (this.containerRect.height - imageHeight) / 2 + bottom; + var minX = (imageWidth - this.containerRect.width) / 2; + var maxX = (this.containerRect.width - imageWidth) / 2; var possibleSwipeCords = { minY: minY, maxY: maxY, minX: minX, maxX: maxX, }; - if (Math.abs(rotateValue) === 90) { - possibleSwipeCords = { - minY: minX, - maxY: maxX, - minX: minY, - maxX: maxY, - }; - } return possibleSwipeCords; }; Zoom.prototype.setZoomSwipeStyles = function (LGel, distance) { @@ -822,7 +812,7 @@ var Zoom = /** @class */ (function () { $item = _this.core.getSlideItem(_this.core.index); if ((_this.$LG(e.target).hasClass('lg-item') || $item.get().contains(e.target)) && - e.targetTouches.length === 1 && + e.touches.length === 1 && _this.core.outer.hasClass('lg-zoomed')) { e.preventDefault(); startTime = new Date(); @@ -831,25 +821,25 @@ var Zoom = /** @class */ (function () { .getSlideItem(_this.core.index) .find('.lg-img-wrap') .first(); - var dragAllowedAxises = _this.getDragAllowedAxises(Math.abs(_this.rotateValue)); + var dragAllowedAxises = _this.getDragAllowedAxises(0); allowY = dragAllowedAxises.allowY; allowX = dragAllowedAxises.allowX; if (allowX || allowY) { - startCoords = _this.getSwipeCords(e, Math.abs(_this.rotateValue)); + startCoords = _this.getSwipeCords(e); } - possibleSwipeCords = _this.getPossibleSwipeDragCords(_this.rotateValue); + possibleSwipeCords = _this.getPossibleSwipeDragCords(); // reset opacity and transition duration _this.core.outer.addClass('lg-zoom-dragging lg-zoom-drag-transition'); } }); this.core.$inner.on('touchmove.lg', function (e) { - if (e.targetTouches.length === 1 && + if (e.touches.length === 1 && _this.core.touchAction === 'zoomSwipe' && (_this.$LG(e.target).hasClass('lg-item') || $item.get().contains(e.target))) { e.preventDefault(); _this.core.touchAction = 'zoomSwipe'; - endCoords = _this.getSwipeCords(e, Math.abs(_this.rotateValue)); + endCoords = _this.getSwipeCords(e); var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords); if (Math.abs(endCoords.x - startCoords.x) > 15 || Math.abs(endCoords.y - startCoords.y) > 15) { @@ -862,6 +852,7 @@ var Zoom = /** @class */ (function () { if (_this.core.touchAction === 'zoomSwipe' && (_this.$LG(e.target).hasClass('lg-item') || $item.get().contains(e.target))) { + e.preventDefault(); _this.core.touchAction = undefined; _this.core.outer.removeClass('lg-zoom-dragging'); if (!isMoved) { @@ -870,7 +861,7 @@ var Zoom = /** @class */ (function () { isMoved = false; endTime = new Date(); var touchDuration = endTime.valueOf() - startTime.valueOf(); - _this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, _this.rotateValue); + _this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration); } }); }; @@ -901,19 +892,16 @@ var Zoom = /** @class */ (function () { .getSlideItem(_this.core.index) .find('.lg-img-wrap') .first(); - var dragAllowedAxises = _this.getDragAllowedAxises(Math.abs(_this.rotateValue)); + var dragAllowedAxises = _this.getDragAllowedAxises(0); allowY = dragAllowedAxises.allowY; allowX = dragAllowedAxises.allowX; if (_this.core.outer.hasClass('lg-zoomed')) { if (_this.$LG(e.target).hasClass('lg-object') && (allowX || allowY)) { e.preventDefault(); - startCoords = _this.getDragCords(e, Math.abs(_this.rotateValue)); - possibleSwipeCords = _this.getPossibleSwipeDragCords(_this.rotateValue); + startCoords = _this.getDragCords(e); + possibleSwipeCords = _this.getPossibleSwipeDragCords(); isDragging = true; - // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 - _this.core.outer.get().scrollLeft += 1; - _this.core.outer.get().scrollLeft -= 1; _this.core.outer .removeClass('lg-grab') .addClass('lg-grabbing lg-zoom-drag-transition lg-zoom-dragging'); @@ -925,7 +913,7 @@ var Zoom = /** @class */ (function () { this.$LG(window).on("mousemove.lg.zoom.global" + this.core.lgId, function (e) { if (isDragging) { isMoved = true; - endCoords = _this.getDragCords(e, Math.abs(_this.rotateValue)); + endCoords = _this.getDragCords(e); var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords); _this.setZoomSwipeStyles(_LGel, distance); } @@ -939,9 +927,9 @@ var Zoom = /** @class */ (function () { if (isMoved && (startCoords.x !== endCoords.x || startCoords.y !== endCoords.y)) { - endCoords = _this.getDragCords(e, Math.abs(_this.rotateValue)); + endCoords = _this.getDragCords(e); var touchDuration = endTime.valueOf() - startTime.valueOf(); - _this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, _this.rotateValue); + _this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration); } isMoved = false; } diff --git a/dist/plugins/zoom/lg-zoom.min.js b/dist/plugins/zoom/lg-zoom.min.js index 440011431..517bc028c 100644 --- a/dist/plugins/zoom/lg-zoom.min.js +++ b/dist/plugins/zoom/lg-zoom.min.js @@ -1,8 +1,8 @@ /** - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgZoom=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,o=1,i=arguments.length;o':"";this.settings.actualSize&&(t+=''),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(t)},h.prototype.enableZoom=function(t){var e=this,o=this.settings.enableZoomAfter+t.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&t.detail.delay?o=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout((function(){e.isImageSlide()&&(e.core.getSlideItem(t.detail.index).addClass("lg-zoomable"),t.detail.index===e.core.index&&e.setZoomEssentials())}),o+30)},h.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(a+".zoom",this.enableZoom.bind(this))},h.prototype.getModifier=function(t,e,o){var i=t;t=Math.abs(t);var s=this.getCurrentTransform(o);if(!s)return 1;var a=1;if("X"===e){var r=Math.sign(parseFloat(s[0]));0===t||180===t?a=1:90===t&&(a=-90===i&&1===r||90===i&&-1===r?-1:1),a*=r}else{var n=Math.sign(parseFloat(s[3]));if(0===t||180===t)a=1;else if(90===t){var l=parseFloat(s[1]),g=parseFloat(s[2]);a=Math.sign(l*g*i*n)}a*=n}return a},h.prototype.getImageSize=function(t,e,o){return 90===Math.abs(e)&&(o="x"===o?"y":"x"),t[{y:"offsetHeight",x:"offsetWidth"}[o]]},h.prototype.getDragCords=function(t,e){return 90===e?{x:t.pageY,y:t.pageX}:{x:t.pageX,y:t.pageY}},h.prototype.getSwipeCords=function(t,e){var o=t.targetTouches[0].pageX,i=t.targetTouches[0].pageY;return 90===e?{x:i,y:o}:{x:o,y:i}},h.prototype.getDragAllowedAxises=function(t,e){e=e||this.scale||1;var o=this.imageYSize*e>this.containerRect.height,i=this.imageXSize*e>this.containerRect.width;return 90===t?{allowX:o,allowY:i}:{allowX:i,allowY:o}},h.prototype.getCurrentTransform=function(t){if(t){var e=window.getComputedStyle(t,null),o=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform")||"none";return"none"!==o?o.split("(")[1].split(")")[0].split(","):void 0}},h.prototype.getCurrentRotation=function(t){if(!t)return 0;var e=this.getCurrentTransform(t);return e?Math.round(Math.atan2(parseFloat(e[1]),parseFloat(e[0]))*(180/Math.PI)):0},h.prototype.setZoomEssentials=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first(),e=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get();this.rotateValue=this.getCurrentRotation(e),this.imageYSize=this.getImageSize(t.get(),this.rotateValue,"y"),this.imageXSize=this.getImageSize(t.get(),this.rotateValue,"x"),this.containerRect=this.core.outer.get().getBoundingClientRect(),this.modifierX=this.getModifier(this.rotateValue,"X",e),this.modifierY=this.getModifier(this.rotateValue,"Y",e)},h.prototype.zoomImage=function(t){var e,o,i=(this.containerRect.width-this.imageXSize)/2+this.containerRect.left,s=this.core.mediaContainerPosition,a=s.top,r=s.bottom,n=Math.abs(a-r)/2,l=(this.containerRect.height-this.imageYSize-n*this.modifierX)/2+this.scrollTop+this.containerRect.top;1===t&&(this.positionChanged=!1);var g=this.getDragAllowedAxises(Math.abs(this.rotateValue),t),c=g.allowY,h=g.allowX;this.positionChanged&&(e=this.left/(this.scale-1),o=this.top/(this.scale-1),this.pageX=Math.abs(e)+i,this.pageY=Math.abs(o)+l,this.positionChanged=!1);var m=this.getPossibleSwipeDragCords(this.rotateValue,t),u=(t-1)*(i-this.pageX),d=(t-1)*(l-this.pageY);h?this.isBeyondPossibleLeft(u,m.minX)?u=m.minX:this.isBeyondPossibleRight(u,m.maxX)&&(u=m.maxX):t>1&&(um.maxX&&(u=m.maxX)),c?this.isBeyondPossibleTop(d,m.minY)?d=m.minY:this.isBeyondPossibleBottom(d,m.maxY)&&(d=m.maxY):t>1&&(dm.maxY&&(d=m.maxY)),this.setZoomStyles({x:u,y:d,scale:t})},h.prototype.setZoomStyles=function(t){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),o=this.core.outer.find(".lg-current .lg-dummy-img").first(),i=e.parent();this.scale=t.scale,e.css("transform","scale3d("+t.scale+", "+t.scale+", 1)"),o.css("transform","scale3d("+t.scale+", "+t.scale+", 1)");var s="translate3d("+t.x+"px, "+t.y+"px, 0)";i.css("transform",s),this.left=t.x,this.top=t.y},h.prototype.setActualSize=function(t,e){var o=this;if(this.isImageSlide()&&!this.core.outer.hasClass("lg-first-slide-loading")){var i=this.getCurrentImageActualSizeScale();this.core.outer.hasClass("lg-zoomed")?this.scale=1:this.scale=this.getScale(i),this.setPageCords(e),this.beginZoom(this.scale),this.zoomImage(this.scale),setTimeout((function(){o.core.outer.removeClass("lg-grabbing").addClass("lg-grab")}),10)}},h.prototype.getNaturalWidth=function(t){var e=this.core.getSlideItem(t).find(".lg-image").first(),o=this.core.galleryItems[t].width;return o?parseFloat(o):e.get().naturalWidth},h.prototype.getActualSizeScale=function(t,e){return t>e?t/e||2:1},h.prototype.getCurrentImageActualSizeScale=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first().get().offsetWidth,e=this.getNaturalWidth(this.core.index)||t;return this.getActualSizeScale(e,t)},h.prototype.getPageCords=function(t){var e={};if(t)e.x=t.pageX||t.targetTouches[0].pageX,e.y=t.pageY||t.targetTouches[0].pageY;else{var o=this.core.outer.get().getBoundingClientRect();e.x=o.width/2+o.left,e.y=o.height/2+this.scrollTop+o.top}return e},h.prototype.setPageCords=function(t){var e=this.getPageCords(t);this.pageX=e.x,this.pageY=e.y},h.prototype.beginZoom=function(t){(this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t>1)?(this.core.outer.addClass("lg-zoomed"),this.core.getElementById("lg-actual-size").removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)):this.resetZoom();return t>1},h.prototype.getScale=function(t){var e=this.getCurrentImageActualSizeScale();return t<1?t=1:t>e&&(t=e),t},h.prototype.init=function(){var t=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var e=null;this.core.outer.on("dblclick.lg",(function(e){t.$LG(e.target).hasClass("lg-image")&&t.setActualSize(t.core.index,e)})),this.core.outer.on("touchstart.lg",(function(o){var i=t.$LG(o.target);1===o.targetTouches.length&&i.hasClass("lg-image")&&(e?(clearTimeout(e),e=null,o.preventDefault(),t.setActualSize(t.core.index,o)):e=setTimeout((function(){e=null}),300))})),this.core.LGel.on(o+".zoom "+l+".zoom "+n+".zoom "+g+".zoom "+c+".zoom",(function(){t.core.lgOpened&&t.isImageSlide()&&(t.setPageCords(),t.setZoomEssentials(),t.zoomImage(t.scale))})),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,(function(){t.core.lgOpened&&(t.scrollTop=t.$LG(window).scrollTop())})),this.core.getElementById("lg-zoom-out").on("click.lg",(function(){t.core.outer.find(".lg-current .lg-image").get()&&(t.scale-=t.settings.scale,t.scale=t.getScale(t.scale),t.beginZoom(t.scale),t.zoomImage(t.scale))})),this.core.getElementById("lg-zoom-in").on("click.lg",(function(){t.zoomIn()})),this.core.getElementById("lg-actual-size").on("click.lg",(function(){t.setActualSize(t.core.index)})),this.core.LGel.on(i+".zoom",(function(){t.core.outer.find(".lg-item").removeClass("lg-zoomable")})),this.core.LGel.on(s+".zoom",(function(){t.scrollTop=t.$LG(window).scrollTop(),t.pageX=t.core.outer.width()/2,t.pageY=t.core.outer.height()/2+t.scrollTop,t.scale=1})),this.core.LGel.on(r+".zoom",(function(e){var o=e.detail.prevIndex;t.scale=1,t.positionChanged=!1,t.resetZoom(o),t.isImageSlide()&&t.setZoomEssentials()})),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1}},h.prototype.zoomIn=function(t){this.isImageSlide()&&(t?this.scale=t:this.scale+=this.settings.scale,this.scale=this.getScale(this.scale),this.beginZoom(this.scale),this.zoomImage(this.scale))},h.prototype.resetZoom=function(t){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var e=this.core.getElementById("lg-actual-size"),o=this.core.getSlideItem(void 0!==t?t:this.core.index);e.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),o.find(".lg-img-wrap").first().removeAttr("style"),o.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},h.prototype.getTouchDistance=function(t){return Math.sqrt((t.targetTouches[0].pageX-t.targetTouches[1].pageX)*(t.targetTouches[0].pageX-t.targetTouches[1].pageX)+(t.targetTouches[0].pageY-t.targetTouches[1].pageY)*(t.targetTouches[0].pageY-t.targetTouches[1].pageY))},h.prototype.pinchZoom=function(){var t=this,e=0,o=!1,i=1,s=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",(function(o){s=t.core.getSlideItem(t.core.index),t.isImageSlide()&&(2!==o.targetTouches.length||t.core.outer.hasClass("lg-first-slide-loading")||!t.$LG(o.target).hasClass("lg-item")&&!s.get().contains(o.target)||(i=t.scale||1,t.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t.core.touchAction="pinch",e=t.getTouchDistance(o)))})),this.core.$inner.on("touchmove.lg",(function(a){if(2===a.targetTouches.length&&"pinch"===t.core.touchAction&&(t.$LG(a.target).hasClass("lg-item")||s.get().contains(a.target))){a.preventDefault();var r=t.getTouchDistance(a),n=e-r;!o&&Math.abs(n)>5&&(o=!0),o&&(t.scale=Math.max(1,i+.008*-n),t.zoomImage(t.scale))}})),this.core.$inner.on("touchend.lg",(function(i){"pinch"===t.core.touchAction&&(t.$LG(i.target).hasClass("lg-item")||s.get().contains(i.target))&&(o=!1,e=0,t.scale<=1?t.resetZoom():(t.scale=t.getScale(t.scale),t.zoomImage(t.scale),t.core.outer.addClass("lg-zoomed")),t.core.touchAction=void 0)}))},h.prototype.touchendZoom=function(t,e,o,i,s,a){var r=e.x-t.x,n=e.y-t.y,l=Math.abs(r)/s+1,g=Math.abs(n)/s+1;l>2&&(l+=1),g>2&&(g+=1),r*=l,n*=g;var c=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),h={};h.x=this.left+r*this.modifierX,h.y=this.top+n*this.modifierY;var m=this.getPossibleSwipeDragCords(a);(Math.abs(r)>15||Math.abs(n)>15)&&(i&&(this.isBeyondPossibleTop(h.y,m.minY)?h.y=m.minY:this.isBeyondPossibleBottom(h.y,m.maxY)&&(h.y=m.maxY)),o&&(this.isBeyondPossibleLeft(h.x,m.minX)?h.x=m.minX:this.isBeyondPossibleRight(h.x,m.maxX)&&(h.x=m.maxX)),i?this.top=h.y:h.y=this.top,o?this.left=h.x:h.x=this.left,this.setZoomSwipeStyles(c,h),this.positionChanged=!0)},h.prototype.getZoomSwipeCords=function(t,e,o,i,s){var a={};if(i){if(a.y=this.top+(e.y-t.y)*this.modifierY,this.isBeyondPossibleTop(a.y,s.minY)){var r=s.minY-a.y;a.y=s.minY-r/6}else if(this.isBeyondPossibleBottom(a.y,s.maxY)){var n=a.y-s.maxY;a.y=s.maxY+n/6}}else a.y=this.top;if(o){if(a.x=this.left+(e.x-t.x)*this.modifierX,this.isBeyondPossibleLeft(a.x,s.minX)){var l=s.minX-a.x;a.x=s.minX-l/6}else if(this.isBeyondPossibleRight(a.x,s.maxX)){var g=a.x-s.maxX;a.x=s.maxX+g/6}}else a.x=this.left;return a},h.prototype.isBeyondPossibleLeft=function(t,e){return t>=e},h.prototype.isBeyondPossibleRight=function(t,e){return t<=e},h.prototype.isBeyondPossibleTop=function(t,e){return t>=e},h.prototype.isBeyondPossibleBottom=function(t,e){return t<=e},h.prototype.isImageSlide=function(){var t=this.core.galleryItems[this.core.index];return"image"===this.core.getSlideType(t)},h.prototype.getPossibleSwipeDragCords=function(t,e){var o=e||this.scale||1,i=Math.abs(o),s=this.core.mediaContainerPosition,a=s.top,r=s.bottom,n=Math.abs(a-r)/2,l=(this.imageYSize-this.containerRect.height)/2+n*this.modifierX,g=this.containerRect.height-this.imageYSize*i+l,c=(this.imageXSize-this.containerRect.width)/2,h=this.containerRect.width-this.imageXSize*i+c,m={minY:l,maxY:g,minX:c,maxX:h};return 90===Math.abs(t)&&(m={minY:c,maxY:h,minX:l,maxX:g}),m},h.prototype.setZoomSwipeStyles=function(t,e){t.css("transform","translate3d("+e.x+"px, "+e.y+"px, 0)")},h.prototype.zoomSwipe=function(){var t,e,o=this,i={},s={},a=!1,r=!1,n=!1,l=new Date,g=(new Date,this.core.getSlideItem(this.core.index));this.core.$inner.on("touchstart.lg",(function(s){if(o.isImageSlide()&&(g=o.core.getSlideItem(o.core.index),(o.$LG(s.target).hasClass("lg-item")||g.get().contains(s.target))&&1===s.targetTouches.length&&o.core.outer.hasClass("lg-zoomed"))){s.preventDefault(),l=new Date,o.core.touchAction="zoomSwipe",e=o.core.getSlideItem(o.core.index).find(".lg-img-wrap").first();var a=o.getDragAllowedAxises(Math.abs(o.rotateValue));n=a.allowY,((r=a.allowX)||n)&&(i=o.getSwipeCords(s,Math.abs(o.rotateValue))),t=o.getPossibleSwipeDragCords(o.rotateValue),o.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}})),this.core.$inner.on("touchmove.lg",(function(l){if(1===l.targetTouches.length&&"zoomSwipe"===o.core.touchAction&&(o.$LG(l.target).hasClass("lg-item")||g.get().contains(l.target))){l.preventDefault(),o.core.touchAction="zoomSwipe",s=o.getSwipeCords(l,Math.abs(o.rotateValue));var c=o.getZoomSwipeCords(i,s,r,n,t);(Math.abs(s.x-i.x)>15||Math.abs(s.y-i.y)>15)&&(a=!0,o.setZoomSwipeStyles(e,c))}})),this.core.$inner.on("touchend.lg",(function(t){if("zoomSwipe"===o.core.touchAction&&(o.$LG(t.target).hasClass("lg-item")||g.get().contains(t.target))){if(o.core.touchAction=void 0,o.core.outer.removeClass("lg-zoom-dragging"),!a)return;a=!1;var e=(new Date).valueOf()-l.valueOf();o.touchendZoom(i,s,r,n,e,o.rotateValue)}}))},h.prototype.zoomDrag=function(){var t,e,o,i,s=this,a={},r={},n=!1,l=!1,g=!1,c=!1;this.core.outer.on("mousedown.lg.zoom",(function(e){if(s.isImageSlide()){var r=s.core.getSlideItem(s.core.index);if(s.$LG(e.target).hasClass("lg-item")||r.get().contains(e.target)){t=new Date,i=s.core.getSlideItem(s.core.index).find(".lg-img-wrap").first();var l=s.getDragAllowedAxises(Math.abs(s.rotateValue));c=l.allowY,g=l.allowX,s.core.outer.hasClass("lg-zoomed")&&s.$LG(e.target).hasClass("lg-object")&&(g||c)&&(e.preventDefault(),a=s.getDragCords(e,Math.abs(s.rotateValue)),o=s.getPossibleSwipeDragCords(s.rotateValue),n=!0,s.core.outer.get().scrollLeft+=1,s.core.outer.get().scrollLeft-=1,s.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}})),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,(function(t){if(n){l=!0,r=s.getDragCords(t,Math.abs(s.rotateValue));var e=s.getZoomSwipeCords(a,r,g,c,o);s.setZoomSwipeStyles(i,e)}})),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,(function(o){if(n){if(e=new Date,n=!1,s.core.outer.removeClass("lg-zoom-dragging"),l&&(a.x!==r.x||a.y!==r.y)){r=s.getDragCords(o,Math.abs(s.rotateValue));var i=e.valueOf()-t.valueOf();s.touchendZoom(a,r,g,c,i,s.rotateValue)}l=!1}s.core.outer.removeClass("lg-grabbing").addClass("lg-grab")}))},h.prototype.closeGallery=function(){this.resetZoom()},h.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},h}()})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).lgZoom=t()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,o=1,i=arguments.length;o':"";this.settings.actualSize&&(e+=''),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},h.prototype.enableZoom=function(e){var t=this,o=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?o=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout((function(){t.isImageSlide()&&(t.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===t.core.index&&t.setZoomEssentials())}),o+30)},h.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(a+".zoom",this.enableZoom.bind(this))},h.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},h.prototype.getSwipeCords=function(e){return{x:e.touches[0].pageX,y:e.touches[0].pageY}},h.prototype.getDragAllowedAxises=function(e,t){var o=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),i=0,s=0,a=o.getBoundingClientRect();e?(i=o.offsetHeight*e,s=o.offsetWidth*e):t?(i=a.height+t*a.height,s=a.width+t*a.width):(i=a.height,s=a.width);var n=i>this.containerRect.height;return{allowX:s>this.containerRect.width,allowY:n}},h.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},h.prototype.zoomImage=function(e,t,o,i){if(!(Math.abs(t)<=0)){var s,a,n=this.containerRect.width/2+this.containerRect.left,r=this.containerRect.height/2+this.containerRect.top+this.scrollTop;1===e&&(this.positionChanged=!1);var l=this.getDragAllowedAxises(0,t),g=l.allowY,c=l.allowX;this.positionChanged&&(s=this.left/(this.scale-t),a=this.top/(this.scale-t),this.pageX=n-s,this.pageY=r-a,this.positionChanged=!1);var h,m,u=this.getPossibleSwipeDragCords(t),d=n-this.pageX,p=r-this.pageY;if(e-t>1){var f=(e-t)/Math.abs(t);h=(d=(t<0?-d:d)+this.left*(f+(t<0?-1:1)))/f,m=(p=(t<0?-p:p)+this.top*(f+(t<0?-1:1)))/f}else{h=d*(f=(e-t)*t),m=p*f}if(o&&(c?this.isBeyondPossibleLeft(h,u.minX)?h=u.minX:this.isBeyondPossibleRight(h,u.maxX)&&(h=u.maxX):e>1&&(hu.maxX&&(h=u.maxX)),g?this.isBeyondPossibleTop(m,u.minY)?m=u.minY:this.isBeyondPossibleBottom(m,u.maxY)&&(m=u.maxY):e>1&&(mu.maxY&&(m=u.maxY))),this.setZoomStyles({x:h,y:m,scale:e}),this.left=h,this.top=m,i)e>=this.getCurrentImageActualSizeScale()&&this.setZoomImageSize()}},h.prototype.resetImageTranslate=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first();this.imageReset=!1,e.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),e.css("width","auto").css("height","auto"),setTimeout((function(){e.removeClass("no-transition")}),10)},h.prototype.setZoomImageSize=function(){var e=this,t=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout((function(){t.addClass("no-transition"),e.imageReset=!0}),500),setTimeout((function(){var o=e.getDragAllowedAxises(e.scale);t.css("width",t.get().naturalWidth+"px").css("height",t.get().naturalHeight+"px"),e.core.outer.addClass("lg-actual-size"),o.allowX&&o.allowY?t.addClass("reset-transition"):o.allowX&&!o.allowY?t.addClass("reset-transition-x"):!o.allowX&&o.allowY&&t.addClass("reset-transition-y")}),550)},h.prototype.setZoomStyles=function(e){var t=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),o=this.core.getSlideItem(this.core.index).find(".lg-image").first(),i=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=e.scale,o.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),i.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var s="translate3d("+e.x+"px, "+e.y+"px, 0)";t.css("transform",s)},h.prototype.setActualSize=function(e,t){var o=this,i=this.core.galleryItems[this.core.index];this.resetImageTranslate(),setTimeout((function(){if(i.src&&!o.core.outer.hasClass("lg-first-slide-loading")){var e=o.getCurrentImageActualSizeScale(),s=o.scale;o.core.outer.hasClass("lg-zoomed")?o.scale=1:o.scale=o.getScale(e),o.setPageCords(t),o.beginZoom(o.scale),o.zoomImage(o.scale,o.scale-s,!0,!0),setTimeout((function(){o.core.outer.removeClass("lg-grabbing").addClass("lg-grab")}),10)}}),50)},h.prototype.getNaturalWidth=function(e){var t=this.core.getSlideItem(e).find(".lg-image").first(),o=this.core.galleryItems[e].width;return o?parseFloat(o):t.get().naturalWidth},h.prototype.getActualSizeScale=function(e,t){return e>=t?e/t||2:1},h.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first().get().offsetWidth,t=this.getNaturalWidth(this.core.index)||e;return this.getActualSizeScale(t,e)},h.prototype.getPageCords=function(e){var t={};if(e)t.x=e.pageX||e.touches[0].pageX,t.y=e.pageY||e.touches[0].pageY;else{var o=this.core.$content.get().getBoundingClientRect();t.x=o.width/2+o.left,t.y=o.height/2+this.scrollTop+o.top}return t},h.prototype.setPageCords=function(e){var t=this.getPageCords(e);this.pageX=t.x,this.pageY=t.y},h.prototype.manageActualPixelClassNames=function(){this.core.getElementById("lg-actual-size").removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},h.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},h.prototype.getScale=function(e){var t=this.getCurrentImageActualSizeScale();return e<1?e=1:e>t&&(e=t),e},h.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var t=null;this.core.outer.on("dblclick.lg",(function(t){e.$LG(t.target).hasClass("lg-image")&&e.setActualSize(e.core.index,t)})),this.core.outer.on("touchstart.lg",(function(o){var i=e.$LG(o.target);1===o.touches.length&&i.hasClass("lg-image")&&(t?(clearTimeout(t),t=null,o.preventDefault(),e.setActualSize(e.core.index,o)):t=setTimeout((function(){t=null}),300))})),this.core.LGel.on(o+".zoom "+l+".zoom "+r+".zoom "+g+".zoom "+c+".zoom",(function(){if(e.core.lgOpened&&e.isImageSlide()&&!e.core.touchAction){var t=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(t,{x:0,y:0}),e.positionChanged=!0}})),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,(function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())})),this.core.getElementById("lg-zoom-out").on("click.lg",(function(){if(e.isImageSlide()){var t=0;e.imageReset&&(e.resetImageTranslate(),t=50),setTimeout((function(){var t=e.scale-e.settings.scale;t<1&&(t=1),e.beginZoom(t),e.zoomImage(t,-e.settings.scale,!0,!0)}),t)}})),this.core.getElementById("lg-zoom-in").on("click.lg",(function(){e.zoomIn()})),this.core.getElementById("lg-actual-size").on("click.lg",(function(){e.setActualSize(e.core.index)})),this.core.LGel.on(i+".zoom",(function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")})),this.core.LGel.on(s+".zoom",(function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1})),this.core.LGel.on(n+".zoom",(function(t){var o=t.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.resetZoom(o),e.isImageSlide()&&e.setZoomEssentials()})),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1}},h.prototype.zoomIn=function(){if(this.isImageSlide()){var e=this.scale+this.settings.scale;e=this.getScale(e),this.beginZoom(e),this.zoomImage(e,this.settings.scale,!0,!0)}},h.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var t=this.core.getElementById("lg-actual-size"),o=this.core.getSlideItem(void 0!==e?e:this.core.index);t.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),o.find(".lg-img-wrap").first().removeAttr("style"),o.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},h.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},h.prototype.pinchZoom=function(){var e=this,t=0,o=!1,i=1,s=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",(function(o){if(a=e.core.getSlideItem(e.core.index),e.isImageSlide()&&2===o.touches.length){if(o.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;i=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(o),e.resetImageTranslate(),e.core.touchAction="pinch",t=e.getTouchDistance(o)}})),this.core.$inner.on("touchmove.lg",(function(n){if(2===n.touches.length&&"pinch"===e.core.touchAction&&(e.$LG(n.target).hasClass("lg-item")||a.get().contains(n.target))){n.preventDefault();var r=e.getTouchDistance(n),l=t-r;if(!o&&Math.abs(l)>5&&(o=!0),o){s=e.scale;var g=Math.max(1,i+.02*-l);e.scale=Math.round(100*(g+Number.EPSILON))/100;var c=e.scale-s;e.zoomImage(e.scale,Math.round(100*(c+Number.EPSILON))/100,!1,!1)}}})),this.core.$inner.on("touchend.lg",(function(i){if("pinch"===e.core.touchAction&&(e.$LG(i.target).hasClass("lg-item")||a.get().contains(i.target))){if(o=!1,t=0,e.scale<=1)e.resetZoom();else{var s=e.getCurrentImageActualSizeScale();if(e.scale>=s){var n=s-e.scale;0===n&&(n=.01),e.zoomImage(s,n,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}}))},h.prototype.touchendZoom=function(e,t,o,i,s){var a=t.x-e.x,n=t.y-e.y,r=Math.abs(a)/s+1,l=Math.abs(n)/s+1;r>2&&(r+=1),l>2&&(l+=1),a*=r,n*=l;var g=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),c={};c.x=this.left+a,c.y=this.top+n;var h=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(n)>15)&&(i&&(this.isBeyondPossibleTop(c.y,h.minY)?c.y=h.minY:this.isBeyondPossibleBottom(c.y,h.maxY)&&(c.y=h.maxY)),o&&(this.isBeyondPossibleLeft(c.x,h.minX)?c.x=h.minX:this.isBeyondPossibleRight(c.x,h.maxX)&&(c.x=h.maxX)),i?this.top=c.y:c.y=this.top,o?this.left=c.x:c.x=this.left,this.setZoomSwipeStyles(g,c),this.positionChanged=!0)},h.prototype.getZoomSwipeCords=function(e,t,o,i,s){var a={};if(i){if(a.y=this.top+(t.y-e.y),this.isBeyondPossibleTop(a.y,s.minY)){var n=s.minY-a.y;a.y=s.minY-n/6}else if(this.isBeyondPossibleBottom(a.y,s.maxY)){var r=a.y-s.maxY;a.y=s.maxY+r/6}}else a.y=this.top;if(o){if(a.x=this.left+(t.x-e.x),this.isBeyondPossibleLeft(a.x,s.minX)){var l=s.minX-a.x;a.x=s.minX-l/6}else if(this.isBeyondPossibleRight(a.x,s.maxX)){var g=a.x-s.maxX;a.x=s.maxX+g/6}}else a.x=this.left;return a},h.prototype.isBeyondPossibleLeft=function(e,t){return e>=t},h.prototype.isBeyondPossibleRight=function(e,t){return e<=t},h.prototype.isBeyondPossibleTop=function(e,t){return e>=t},h.prototype.isBeyondPossibleBottom=function(e,t){return e<=t},h.prototype.isImageSlide=function(){var e=this.core.galleryItems[this.core.index];return"image"===this.core.getSlideType(e)},h.prototype.getPossibleSwipeDragCords=function(e){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first(),o=this.core.mediaContainerPosition.bottom,i=t.get().getBoundingClientRect(),s=i.height,a=i.width;return e&&(s+=e*s,a+=e*a),{minY:(s-this.containerRect.height)/2,maxY:(this.containerRect.height-s)/2+o,minX:(a-this.containerRect.width)/2,maxX:(this.containerRect.width-a)/2}},h.prototype.setZoomSwipeStyles=function(e,t){e.css("transform","translate3d("+t.x+"px, "+t.y+"px, 0)")},h.prototype.zoomSwipe=function(){var e,t,o=this,i={},s={},a=!1,n=!1,r=!1,l=new Date,g=(new Date,this.core.getSlideItem(this.core.index));this.core.$inner.on("touchstart.lg",(function(s){if(o.isImageSlide()&&(g=o.core.getSlideItem(o.core.index),(o.$LG(s.target).hasClass("lg-item")||g.get().contains(s.target))&&1===s.touches.length&&o.core.outer.hasClass("lg-zoomed"))){s.preventDefault(),l=new Date,o.core.touchAction="zoomSwipe",t=o.core.getSlideItem(o.core.index).find(".lg-img-wrap").first();var a=o.getDragAllowedAxises(0);r=a.allowY,((n=a.allowX)||r)&&(i=o.getSwipeCords(s)),e=o.getPossibleSwipeDragCords(),o.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}})),this.core.$inner.on("touchmove.lg",(function(l){if(1===l.touches.length&&"zoomSwipe"===o.core.touchAction&&(o.$LG(l.target).hasClass("lg-item")||g.get().contains(l.target))){l.preventDefault(),o.core.touchAction="zoomSwipe",s=o.getSwipeCords(l);var c=o.getZoomSwipeCords(i,s,n,r,e);(Math.abs(s.x-i.x)>15||Math.abs(s.y-i.y)>15)&&(a=!0,o.setZoomSwipeStyles(t,c))}})),this.core.$inner.on("touchend.lg",(function(e){if("zoomSwipe"===o.core.touchAction&&(o.$LG(e.target).hasClass("lg-item")||g.get().contains(e.target))){if(e.preventDefault(),o.core.touchAction=void 0,o.core.outer.removeClass("lg-zoom-dragging"),!a)return;a=!1;var t=(new Date).valueOf()-l.valueOf();o.touchendZoom(i,s,n,r,t)}}))},h.prototype.zoomDrag=function(){var e,t,o,i,s=this,a={},n={},r=!1,l=!1,g=!1,c=!1;this.core.outer.on("mousedown.lg.zoom",(function(t){if(s.isImageSlide()){var n=s.core.getSlideItem(s.core.index);if(s.$LG(t.target).hasClass("lg-item")||n.get().contains(t.target)){e=new Date,i=s.core.getSlideItem(s.core.index).find(".lg-img-wrap").first();var l=s.getDragAllowedAxises(0);c=l.allowY,g=l.allowX,s.core.outer.hasClass("lg-zoomed")&&s.$LG(t.target).hasClass("lg-object")&&(g||c)&&(t.preventDefault(),a=s.getDragCords(t),o=s.getPossibleSwipeDragCords(),r=!0,s.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}})),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,(function(e){if(r){l=!0,n=s.getDragCords(e);var t=s.getZoomSwipeCords(a,n,g,c,o);s.setZoomSwipeStyles(i,t)}})),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,(function(o){if(r){if(t=new Date,r=!1,s.core.outer.removeClass("lg-zoom-dragging"),l&&(a.x!==n.x||a.y!==n.y)){n=s.getDragCords(o);var i=t.valueOf()-e.valueOf();s.touchendZoom(a,n,g,c,i)}l=!1}s.core.outer.removeClass("lg-grabbing").addClass("lg-grab")}))},h.prototype.closeGallery=function(){this.resetZoom()},h.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},h}()})); diff --git a/dist/plugins/zoom/lg-zoom.umd.js b/dist/plugins/zoom/lg-zoom.umd.js index 120615cf7..47c059c08 100644 --- a/dist/plugins/zoom/lg-zoom.umd.js +++ b/dist/plugins/zoom/lg-zoom.umd.js @@ -1,5 +1,5 @@ /*! - * lightgallery | 2.5.0 | June 13th 2022 + * lightgallery | 2.6.0-beta.1 | July 13th 2022 * http://www.lightgalleryjs.com/ * Copyright (c) 2020 Sachin Neravath; * @license GPLv3 @@ -141,158 +141,50 @@ // Add zoomable class this.core.LGel.on(lGEvents.slideItemLoad + ".zoom", this.enableZoom.bind(this)); }; - Zoom.prototype.getModifier = function (rotateValue, axis, el) { - var originalRotate = rotateValue; - rotateValue = Math.abs(rotateValue); - var transformValues = this.getCurrentTransform(el); - if (!transformValues) { - return 1; - } - var modifier = 1; - if (axis === 'X') { - var flipHorizontalValue = Math.sign(parseFloat(transformValues[0])); - if (rotateValue === 0 || rotateValue === 180) { - modifier = 1; - } - else if (rotateValue === 90) { - if ((originalRotate === -90 && flipHorizontalValue === 1) || - (originalRotate === 90 && flipHorizontalValue === -1)) { - modifier = -1; - } - else { - modifier = 1; - } - } - modifier = modifier * flipHorizontalValue; - } - else { - var flipVerticalValue = Math.sign(parseFloat(transformValues[3])); - if (rotateValue === 0 || rotateValue === 180) { - modifier = 1; - } - else if (rotateValue === 90) { - var sinX = parseFloat(transformValues[1]); - var sinMinusX = parseFloat(transformValues[2]); - modifier = Math.sign(sinX * sinMinusX * originalRotate * flipVerticalValue); - } - modifier = modifier * flipVerticalValue; - } - return modifier; - }; - Zoom.prototype.getImageSize = function ($image, rotateValue, axis) { - var imageSizes = { - y: 'offsetHeight', - x: 'offsetWidth', + Zoom.prototype.getDragCords = function (e) { + return { + x: e.pageX, + y: e.pageY, }; - if (Math.abs(rotateValue) === 90) { - // Swap axis - if (axis === 'x') { - axis = 'y'; - } - else { - axis = 'x'; - } - } - return $image[imageSizes[axis]]; - }; - Zoom.prototype.getDragCords = function (e, rotateValue) { - if (rotateValue === 90) { - return { - x: e.pageY, - y: e.pageX, - }; - } - else { - return { - x: e.pageX, - y: e.pageY, - }; - } - }; - Zoom.prototype.getSwipeCords = function (e, rotateValue) { - var x = e.targetTouches[0].pageX; - var y = e.targetTouches[0].pageY; - if (rotateValue === 90) { - return { - x: y, - y: x, - }; - } - else { - return { - x: x, - y: y, - }; - } - }; - Zoom.prototype.getDragAllowedAxises = function (rotateValue, scale) { - scale = scale || this.scale || 1; - var allowY = this.imageYSize * scale > this.containerRect.height; - var allowX = this.imageXSize * scale > this.containerRect.width; - if (rotateValue === 90) { - return { - allowX: allowY, - allowY: allowX, - }; - } - else { - return { - allowX: allowX, - allowY: allowY, - }; - } }; - /** - * - * @param {Element} el - * @return matrix(cos(X), sin(X), -sin(X), cos(X), 0, 0); - * Get the current transform value - */ - Zoom.prototype.getCurrentTransform = function (el) { - if (!el) { - return; - } - var st = window.getComputedStyle(el, null); - var tm = st.getPropertyValue('-webkit-transform') || - st.getPropertyValue('-moz-transform') || - st.getPropertyValue('-ms-transform') || - st.getPropertyValue('-o-transform') || - st.getPropertyValue('transform') || - 'none'; - if (tm !== 'none') { - return tm.split('(')[1].split(')')[0].split(','); - } - return; - }; - Zoom.prototype.getCurrentRotation = function (el) { - if (!el) { - return 0; - } - var values = this.getCurrentTransform(el); - if (values) { - return Math.round(Math.atan2(parseFloat(values[1]), parseFloat(values[0])) * - (180 / Math.PI)); - // If you want rotate in 360 - //return (angle < 0 ? angle + 360 : angle); - } - return 0; + Zoom.prototype.getSwipeCords = function (e) { + var x = e.touches[0].pageX; + var y = e.touches[0].pageY; + return { + x: x, + y: y, + }; }; - Zoom.prototype.setZoomEssentials = function () { + Zoom.prototype.getDragAllowedAxises = function (scale, scaleDiff) { var $image = this.core .getSlideItem(this.core.index) .find('.lg-image') - .first(); - var rotateEl = this.core - .getSlideItem(this.core.index) - .find('.lg-img-rotate') .first() .get(); - this.rotateValue = this.getCurrentRotation(rotateEl); - this.imageYSize = this.getImageSize($image.get(), this.rotateValue, 'y'); - this.imageXSize = this.getImageSize($image.get(), this.rotateValue, 'x'); - this.containerRect = this.core.outer.get().getBoundingClientRect(); - this.modifierX = this.getModifier(this.rotateValue, 'X', rotateEl); - this.modifierY = this.getModifier(this.rotateValue, 'Y', rotateEl); + var height = 0; + var width = 0; + var rect = $image.getBoundingClientRect(); + if (scale) { + height = $image.offsetHeight * scale; + width = $image.offsetWidth * scale; + } + else if (scaleDiff) { + height = rect.height + scaleDiff * rect.height; + width = rect.width + scaleDiff * rect.width; + } + else { + height = rect.height; + width = rect.width; + } + var allowY = height > this.containerRect.height; + var allowX = width > this.containerRect.width; + return { + allowX: allowX, + allowY: allowY, + }; + }; + Zoom.prototype.setZoomEssentials = function () { + this.containerRect = this.core.$content.get().getBoundingClientRect(); }; /** * @desc Image zoom @@ -300,86 +192,152 @@ * * @param {String} scale - Zoom decrement/increment value */ - Zoom.prototype.zoomImage = function (scale) { - // Find offset manually to avoid issue after zoom - var offsetX = (this.containerRect.width - this.imageXSize) / 2 + - this.containerRect.left; - var _a = this.core.mediaContainerPosition, top = _a.top, bottom = _a.bottom; - var topBottomSpacing = Math.abs(top - bottom) / 2; - var offsetY = (this.containerRect.height - - this.imageYSize - - topBottomSpacing * this.modifierX) / - 2 + - this.scrollTop + - this.containerRect.top; + Zoom.prototype.zoomImage = function (scale, scaleDiff, reposition, resetToMax) { + if (Math.abs(scaleDiff) <= 0) + return; + var offsetX = this.containerRect.width / 2 + this.containerRect.left; + var offsetY = this.containerRect.height / 2 + + this.containerRect.top + + this.scrollTop; var originalX; var originalY; if (scale === 1) { this.positionChanged = false; } - var dragAllowedAxises = this.getDragAllowedAxises(Math.abs(this.rotateValue), scale); + var dragAllowedAxises = this.getDragAllowedAxises(0, scaleDiff); var allowY = dragAllowedAxises.allowY, allowX = dragAllowedAxises.allowX; if (this.positionChanged) { - originalX = this.left / (this.scale - 1); - originalY = this.top / (this.scale - 1); - this.pageX = Math.abs(originalX) + offsetX; - this.pageY = Math.abs(originalY) + offsetY; + originalX = this.left / (this.scale - scaleDiff); + originalY = this.top / (this.scale - scaleDiff); + this.pageX = offsetX - originalX; + this.pageY = offsetY - originalY; this.positionChanged = false; } - var possibleSwipeCords = this.getPossibleSwipeDragCords(this.rotateValue, scale); + var possibleSwipeCords = this.getPossibleSwipeDragCords(scaleDiff); + var x; + var y; var _x = offsetX - this.pageX; var _y = offsetY - this.pageY; - var x = (scale - 1) * _x; - var y = (scale - 1) * _y; - if (allowX) { - if (this.isBeyondPossibleLeft(x, possibleSwipeCords.minX)) { - x = possibleSwipeCords.minX; - } - else if (this.isBeyondPossibleRight(x, possibleSwipeCords.maxX)) { - x = possibleSwipeCords.maxX; - } + if (scale - scaleDiff > 1) { + var scaleVal = (scale - scaleDiff) / Math.abs(scaleDiff); + _x = + (scaleDiff < 0 ? -_x : _x) + + this.left * (scaleVal + (scaleDiff < 0 ? -1 : 1)); + _y = + (scaleDiff < 0 ? -_y : _y) + + this.top * (scaleVal + (scaleDiff < 0 ? -1 : 1)); + x = _x / scaleVal; + y = _y / scaleVal; } else { - if (scale > 1) { - if (x < possibleSwipeCords.minX) { + var scaleVal = (scale - scaleDiff) * scaleDiff; + x = _x * scaleVal; + y = _y * scaleVal; + } + if (reposition) { + if (allowX) { + if (this.isBeyondPossibleLeft(x, possibleSwipeCords.minX)) { x = possibleSwipeCords.minX; } - else if (x > possibleSwipeCords.maxX) { + else if (this.isBeyondPossibleRight(x, possibleSwipeCords.maxX)) { x = possibleSwipeCords.maxX; } } - } - if (allowY) { - if (this.isBeyondPossibleTop(y, possibleSwipeCords.minY)) { - y = possibleSwipeCords.minY; - } - else if (this.isBeyondPossibleBottom(y, possibleSwipeCords.maxY)) { - y = possibleSwipeCords.maxY; + else { + if (scale > 1) { + if (x < possibleSwipeCords.minX) { + x = possibleSwipeCords.minX; + } + else if (x > possibleSwipeCords.maxX) { + x = possibleSwipeCords.maxX; + } + } } - } - else { - // If the translate value based on index of beyond the viewport, utilize the available space to prevent image being cut out - if (scale > 1) { - //If image goes beyond viewport top, use the minim possible translate value - if (y < possibleSwipeCords.minY) { + // @todo fix this + if (allowY) { + if (this.isBeyondPossibleTop(y, possibleSwipeCords.minY)) { y = possibleSwipeCords.minY; } - else if (y > possibleSwipeCords.maxY) { + else if (this.isBeyondPossibleBottom(y, possibleSwipeCords.maxY)) { y = possibleSwipeCords.maxY; } } + else { + // If the translate value based on index of beyond the viewport, utilize the available space to prevent image being cut out + if (scale > 1) { + //If image goes beyond viewport top, use the minim possible translate value + if (y < possibleSwipeCords.minY) { + y = possibleSwipeCords.minY; + } + else if (y > possibleSwipeCords.maxY) { + y = possibleSwipeCords.maxY; + } + } + } } this.setZoomStyles({ x: x, y: y, scale: scale, }); + this.left = x; + this.top = y; + if (resetToMax) { + var actualSizeScale = this.getCurrentImageActualSizeScale(); + if (scale >= actualSizeScale) { + this.setZoomImageSize(); + } + } + }; + Zoom.prototype.resetImageTranslate = function () { + var $image = this.core + .getSlideItem(this.core.index) + .find('.lg-image') + .first(); + this.imageReset = false; + $image.removeClass('reset-transition reset-transition-y reset-transition-x'); + this.core.outer.removeClass('lg-actual-size'); + $image.css('width', 'auto').css('height', 'auto'); + setTimeout(function () { + $image.removeClass('no-transition'); + }, 10); + }; + Zoom.prototype.setZoomImageSize = function () { + var _this = this; + var $image = this.core + .getSlideItem(this.core.index) + .find('.lg-image') + .first(); + setTimeout(function () { + $image.addClass('no-transition'); + _this.imageReset = true; + }, 500); + setTimeout(function () { + var dragAllowedAxises = _this.getDragAllowedAxises(_this.scale); + $image + .css('width', $image.get().naturalWidth + 'px') + .css('height', $image.get().naturalHeight + 'px'); + _this.core.outer.addClass('lg-actual-size'); + if (dragAllowedAxises.allowX && dragAllowedAxises.allowY) { + $image.addClass('reset-transition'); + } + else if (dragAllowedAxises.allowX && !dragAllowedAxises.allowY) { + $image.addClass('reset-transition-x'); + } + else if (!dragAllowedAxises.allowX && dragAllowedAxises.allowY) { + $image.addClass('reset-transition-y'); + } + }, 550); }; /** * @desc apply scale3d to image and translate to image wrap * @param {style} X,Y and scale */ Zoom.prototype.setZoomStyles = function (style) { + var $imageWrap = this.core + .getSlideItem(this.core.index) + .find('.lg-img-wrap') + .first(); var $image = this.core .getSlideItem(this.core.index) .find('.lg-image') @@ -387,14 +345,11 @@ var $dummyImage = this.core.outer .find('.lg-current .lg-dummy-img') .first(); - var $imageWrap = $image.parent(); this.scale = style.scale; $image.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)'); $dummyImage.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)'); var transform = 'translate3d(' + style.x + 'px, ' + style.y + 'px, 0)'; $imageWrap.css('transform', transform); - this.left = style.x; - this.top = style.y; }; /** * @param index - Index of the current slide @@ -402,24 +357,29 @@ */ Zoom.prototype.setActualSize = function (index, event) { var _this = this; - // Allow zoom only on image - if (!this.isImageSlide() || - this.core.outer.hasClass('lg-first-slide-loading')) { - return; - } - var scale = this.getCurrentImageActualSizeScale(); - if (this.core.outer.hasClass('lg-zoomed')) { - this.scale = 1; - } - else { - this.scale = this.getScale(scale); - } - this.setPageCords(event); - this.beginZoom(this.scale); - this.zoomImage(this.scale); + var currentItem = this.core.galleryItems[this.core.index]; + this.resetImageTranslate(); setTimeout(function () { - _this.core.outer.removeClass('lg-grabbing').addClass('lg-grab'); - }, 10); + // Allow zoom only on image + if (!currentItem.src || + _this.core.outer.hasClass('lg-first-slide-loading')) { + return; + } + var scale = _this.getCurrentImageActualSizeScale(); + var prevScale = _this.scale; + if (_this.core.outer.hasClass('lg-zoomed')) { + _this.scale = 1; + } + else { + _this.scale = _this.getScale(scale); + } + _this.setPageCords(event); + _this.beginZoom(_this.scale); + _this.zoomImage(_this.scale, _this.scale - prevScale, true, true); + setTimeout(function () { + _this.core.outer.removeClass('lg-grabbing').addClass('lg-grab'); + }, 10); + }, 50); }; Zoom.prototype.getNaturalWidth = function (index) { var $image = this.core.getSlideItem(index).find('.lg-image').first(); @@ -431,7 +391,7 @@ Zoom.prototype.getActualSizeScale = function (naturalWidth, width) { var _scale; var scale; - if (naturalWidth > width) { + if (naturalWidth >= width) { _scale = naturalWidth / width; scale = _scale || 2; } @@ -452,11 +412,13 @@ Zoom.prototype.getPageCords = function (event) { var cords = {}; if (event) { - cords.x = event.pageX || event.targetTouches[0].pageX; - cords.y = event.pageY || event.targetTouches[0].pageY; + cords.x = event.pageX || event.touches[0].pageX; + cords.y = event.pageY || event.touches[0].pageY; } else { - var containerRect = this.core.outer.get().getBoundingClientRect(); + var containerRect = this.core.$content + .get() + .getBoundingClientRect(); cords.x = containerRect.width / 2 + containerRect.left; cords.y = containerRect.height / 2 + this.scrollTop + containerRect.top; @@ -468,15 +430,18 @@ this.pageX = pageCords.x; this.pageY = pageCords.y; }; + Zoom.prototype.manageActualPixelClassNames = function () { + var $actualSize = this.core.getElementById('lg-actual-size'); + $actualSize + .removeClass(this.settings.actualSizeIcons.zoomIn) + .addClass(this.settings.actualSizeIcons.zoomOut); + }; // If true, zoomed - in else zoomed out Zoom.prototype.beginZoom = function (scale) { this.core.outer.removeClass('lg-zoom-drag-transition lg-zoom-dragging'); if (scale > 1) { this.core.outer.addClass('lg-zoomed'); - var $actualSize = this.core.getElementById('lg-actual-size'); - $actualSize - .removeClass(this.settings.actualSizeIcons.zoomIn) - .addClass(this.settings.actualSizeIcons.zoomOut); + this.manageActualPixelClassNames(); } else { this.resetZoom(); @@ -509,8 +474,7 @@ }); this.core.outer.on('touchstart.lg', function (event) { var $target = _this.$LG(event.target); - if (event.targetTouches.length === 1 && - $target.hasClass('lg-image')) { + if (event.touches.length === 1 && $target.hasClass('lg-image')) { if (!tapped) { tapped = setTimeout(function () { tapped = null; @@ -524,13 +488,21 @@ } } }); - // Update zoom on resize and orientationchange this.core.LGel.on(lGEvents.containerResize + ".zoom " + lGEvents.rotateRight + ".zoom " + lGEvents.rotateLeft + ".zoom " + lGEvents.flipHorizontal + ".zoom " + lGEvents.flipVertical + ".zoom", function () { - if (!_this.core.lgOpened || !_this.isImageSlide()) + if (!_this.core.lgOpened || + !_this.isImageSlide() || + _this.core.touchAction) { return; - _this.setPageCords(); + } + var _LGel = _this.core + .getSlideItem(_this.core.index) + .find('.lg-img-wrap') + .first(); + _this.top = 0; + _this.left = 0; _this.setZoomEssentials(); - _this.zoomImage(_this.scale); + _this.setZoomSwipeStyles(_LGel, { x: 0, y: 0 }); + _this.positionChanged = true; }); // Update zoom on resize and orientationchange this.$LG(window).on("scroll.lg.zoom.global" + this.core.lgId, function () { @@ -539,12 +511,23 @@ _this.scrollTop = _this.$LG(window).scrollTop(); }); this.core.getElementById('lg-zoom-out').on('click.lg', function () { - if (_this.core.outer.find('.lg-current .lg-image').get()) { - _this.scale -= _this.settings.scale; - _this.scale = _this.getScale(_this.scale); - _this.beginZoom(_this.scale); - _this.zoomImage(_this.scale); + // Allow zoom only on image + if (!_this.isImageSlide()) { + return; } + var timeout = 0; + if (_this.imageReset) { + _this.resetImageTranslate(); + timeout = 50; + } + setTimeout(function () { + var scale = _this.scale - _this.settings.scale; + if (scale < 1) { + scale = 1; + } + _this.beginZoom(scale); + _this.zoomImage(scale, -_this.settings.scale, true, true); + }, timeout); }); this.core.getElementById('lg-zoom-in').on('click.lg', function () { _this.zoomIn(); @@ -580,20 +563,15 @@ this.zoomableTimeout = false; this.positionChanged = false; }; - Zoom.prototype.zoomIn = function (scale) { + Zoom.prototype.zoomIn = function () { // Allow zoom only on image if (!this.isImageSlide()) { return; } - if (scale) { - this.scale = scale; - } - else { - this.scale += this.settings.scale; - } - this.scale = this.getScale(this.scale); - this.beginZoom(this.scale); - this.zoomImage(this.scale); + var scale = this.scale + this.settings.scale; + scale = this.getScale(scale); + this.beginZoom(scale); + this.zoomImage(scale, this.settings.scale, true, true); }; // Reset zoom effect Zoom.prototype.resetZoom = function (index) { @@ -612,34 +590,38 @@ this.setPageCords(); }; Zoom.prototype.getTouchDistance = function (e) { - return Math.sqrt((e.targetTouches[0].pageX - e.targetTouches[1].pageX) * - (e.targetTouches[0].pageX - e.targetTouches[1].pageX) + - (e.targetTouches[0].pageY - e.targetTouches[1].pageY) * - (e.targetTouches[0].pageY - e.targetTouches[1].pageY)); + return Math.sqrt((e.touches[0].pageX - e.touches[1].pageX) * + (e.touches[0].pageX - e.touches[1].pageX) + + (e.touches[0].pageY - e.touches[1].pageY) * + (e.touches[0].pageY - e.touches[1].pageY)); }; Zoom.prototype.pinchZoom = function () { var _this = this; var startDist = 0; var pinchStarted = false; var initScale = 1; + var prevScale = 0; var $item = this.core.getSlideItem(this.core.index); - this.core.$inner.on('touchstart.lg', function (e) { + this.core.outer.on('touchstart.lg', function (e) { $item = _this.core.getSlideItem(_this.core.index); if (!_this.isImageSlide()) { return; } - if (e.targetTouches.length === 2 && - !_this.core.outer.hasClass('lg-first-slide-loading') && - (_this.$LG(e.target).hasClass('lg-item') || - $item.get().contains(e.target))) { + if (e.touches.length === 2) { + e.preventDefault(); + if (_this.core.outer.hasClass('lg-first-slide-loading')) { + return; + } initScale = _this.scale || 1; _this.core.outer.removeClass('lg-zoom-drag-transition lg-zoom-dragging'); + _this.setPageCords(e); + _this.resetImageTranslate(); _this.core.touchAction = 'pinch'; startDist = _this.getTouchDistance(e); } }); this.core.$inner.on('touchmove.lg', function (e) { - if (e.targetTouches.length === 2 && + if (e.touches.length === 2 && _this.core.touchAction === 'pinch' && (_this.$LG(e.target).hasClass('lg-item') || $item.get().contains(e.target))) { @@ -650,8 +632,12 @@ pinchStarted = true; } if (pinchStarted) { - _this.scale = Math.max(1, initScale + -distance * 0.008); - _this.zoomImage(_this.scale); + prevScale = _this.scale; + var _scale = Math.max(1, initScale + -distance * 0.02); + _this.scale = + Math.round((_scale + Number.EPSILON) * 100) / 100; + var diff = _this.scale - prevScale; + _this.zoomImage(_this.scale, Math.round((diff + Number.EPSILON) * 100) / 100, false, false); } } }); @@ -665,15 +651,22 @@ _this.resetZoom(); } else { - _this.scale = _this.getScale(_this.scale); - _this.zoomImage(_this.scale); + var actualSizeScale = _this.getCurrentImageActualSizeScale(); + if (_this.scale >= actualSizeScale) { + var scaleDiff = actualSizeScale - _this.scale; + if (scaleDiff === 0) { + scaleDiff = 0.01; + } + _this.zoomImage(actualSizeScale, scaleDiff, false, true); + } + _this.manageActualPixelClassNames(); _this.core.outer.addClass('lg-zoomed'); } _this.core.touchAction = undefined; } }); }; - Zoom.prototype.touchendZoom = function (startCoords, endCoords, allowX, allowY, touchDuration, rotateValue) { + Zoom.prototype.touchendZoom = function (startCoords, endCoords, allowX, allowY, touchDuration) { var distanceXnew = endCoords.x - startCoords.x; var distanceYnew = endCoords.y - startCoords.y; var speedX = Math.abs(distanceXnew) / touchDuration + 1; @@ -691,9 +684,9 @@ .find('.lg-img-wrap') .first(); var distance = {}; - distance.x = this.left + distanceXnew * this.modifierX; - distance.y = this.top + distanceYnew * this.modifierY; - var possibleSwipeCords = this.getPossibleSwipeDragCords(rotateValue); + distance.x = this.left + distanceXnew; + distance.y = this.top + distanceYnew; + var possibleSwipeCords = this.getPossibleSwipeDragCords(); if (Math.abs(distanceXnew) > 15 || Math.abs(distanceYnew) > 15) { if (allowY) { if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) { @@ -730,8 +723,7 @@ Zoom.prototype.getZoomSwipeCords = function (startCoords, endCoords, allowX, allowY, possibleSwipeCords) { var distance = {}; if (allowY) { - distance.y = - this.top + (endCoords.y - startCoords.y) * this.modifierY; + distance.y = this.top + (endCoords.y - startCoords.y); if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) { var diffMinY = possibleSwipeCords.minY - distance.y; distance.y = possibleSwipeCords.minY - diffMinY / 6; @@ -745,8 +737,7 @@ distance.y = this.top; } if (allowX) { - distance.x = - this.left + (endCoords.x - startCoords.x) * this.modifierX; + distance.x = this.left + (endCoords.x - startCoords.x); if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) { var diffMinX = possibleSwipeCords.minX - distance.x; distance.x = possibleSwipeCords.minX - diffMinX / 6; @@ -777,30 +768,29 @@ var currentItem = this.core.galleryItems[this.core.index]; return this.core.getSlideType(currentItem) === 'image'; }; - Zoom.prototype.getPossibleSwipeDragCords = function (rotateValue, scale) { - var dataScale = scale || this.scale || 1; - var elDataScale = Math.abs(dataScale); - var _a = this.core.mediaContainerPosition, top = _a.top, bottom = _a.bottom; - var topBottomSpacing = Math.abs(top - bottom) / 2; - var minY = (this.imageYSize - this.containerRect.height) / 2 + - topBottomSpacing * this.modifierX; - var maxY = this.containerRect.height - this.imageYSize * elDataScale + minY; - var minX = (this.imageXSize - this.containerRect.width) / 2; - var maxX = this.containerRect.width - this.imageXSize * elDataScale + minX; + Zoom.prototype.getPossibleSwipeDragCords = function (scale) { + var $image = this.core + .getSlideItem(this.core.index) + .find('.lg-image') + .first(); + var bottom = this.core.mediaContainerPosition.bottom; + var imgRect = $image.get().getBoundingClientRect(); + var imageHeight = imgRect.height; + var imageWidth = imgRect.width; + if (scale) { + imageHeight = imageHeight + scale * imageHeight; + imageWidth = imageWidth + scale * imageWidth; + } + var minY = (imageHeight - this.containerRect.height) / 2; + var maxY = (this.containerRect.height - imageHeight) / 2 + bottom; + var minX = (imageWidth - this.containerRect.width) / 2; + var maxX = (this.containerRect.width - imageWidth) / 2; var possibleSwipeCords = { minY: minY, maxY: maxY, minX: minX, maxX: maxX, }; - if (Math.abs(rotateValue) === 90) { - possibleSwipeCords = { - minY: minX, - maxY: maxX, - minX: minY, - maxX: maxY, - }; - } return possibleSwipeCords; }; Zoom.prototype.setZoomSwipeStyles = function (LGel, distance) { @@ -828,7 +818,7 @@ $item = _this.core.getSlideItem(_this.core.index); if ((_this.$LG(e.target).hasClass('lg-item') || $item.get().contains(e.target)) && - e.targetTouches.length === 1 && + e.touches.length === 1 && _this.core.outer.hasClass('lg-zoomed')) { e.preventDefault(); startTime = new Date(); @@ -837,25 +827,25 @@ .getSlideItem(_this.core.index) .find('.lg-img-wrap') .first(); - var dragAllowedAxises = _this.getDragAllowedAxises(Math.abs(_this.rotateValue)); + var dragAllowedAxises = _this.getDragAllowedAxises(0); allowY = dragAllowedAxises.allowY; allowX = dragAllowedAxises.allowX; if (allowX || allowY) { - startCoords = _this.getSwipeCords(e, Math.abs(_this.rotateValue)); + startCoords = _this.getSwipeCords(e); } - possibleSwipeCords = _this.getPossibleSwipeDragCords(_this.rotateValue); + possibleSwipeCords = _this.getPossibleSwipeDragCords(); // reset opacity and transition duration _this.core.outer.addClass('lg-zoom-dragging lg-zoom-drag-transition'); } }); this.core.$inner.on('touchmove.lg', function (e) { - if (e.targetTouches.length === 1 && + if (e.touches.length === 1 && _this.core.touchAction === 'zoomSwipe' && (_this.$LG(e.target).hasClass('lg-item') || $item.get().contains(e.target))) { e.preventDefault(); _this.core.touchAction = 'zoomSwipe'; - endCoords = _this.getSwipeCords(e, Math.abs(_this.rotateValue)); + endCoords = _this.getSwipeCords(e); var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords); if (Math.abs(endCoords.x - startCoords.x) > 15 || Math.abs(endCoords.y - startCoords.y) > 15) { @@ -868,6 +858,7 @@ if (_this.core.touchAction === 'zoomSwipe' && (_this.$LG(e.target).hasClass('lg-item') || $item.get().contains(e.target))) { + e.preventDefault(); _this.core.touchAction = undefined; _this.core.outer.removeClass('lg-zoom-dragging'); if (!isMoved) { @@ -876,7 +867,7 @@ isMoved = false; endTime = new Date(); var touchDuration = endTime.valueOf() - startTime.valueOf(); - _this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, _this.rotateValue); + _this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration); } }); }; @@ -907,19 +898,16 @@ .getSlideItem(_this.core.index) .find('.lg-img-wrap') .first(); - var dragAllowedAxises = _this.getDragAllowedAxises(Math.abs(_this.rotateValue)); + var dragAllowedAxises = _this.getDragAllowedAxises(0); allowY = dragAllowedAxises.allowY; allowX = dragAllowedAxises.allowX; if (_this.core.outer.hasClass('lg-zoomed')) { if (_this.$LG(e.target).hasClass('lg-object') && (allowX || allowY)) { e.preventDefault(); - startCoords = _this.getDragCords(e, Math.abs(_this.rotateValue)); - possibleSwipeCords = _this.getPossibleSwipeDragCords(_this.rotateValue); + startCoords = _this.getDragCords(e); + possibleSwipeCords = _this.getPossibleSwipeDragCords(); isDragging = true; - // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 - _this.core.outer.get().scrollLeft += 1; - _this.core.outer.get().scrollLeft -= 1; _this.core.outer .removeClass('lg-grab') .addClass('lg-grabbing lg-zoom-drag-transition lg-zoom-dragging'); @@ -931,7 +919,7 @@ this.$LG(window).on("mousemove.lg.zoom.global" + this.core.lgId, function (e) { if (isDragging) { isMoved = true; - endCoords = _this.getDragCords(e, Math.abs(_this.rotateValue)); + endCoords = _this.getDragCords(e); var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords); _this.setZoomSwipeStyles(_LGel, distance); } @@ -945,9 +933,9 @@ if (isMoved && (startCoords.x !== endCoords.x || startCoords.y !== endCoords.y)) { - endCoords = _this.getDragCords(e, Math.abs(_this.rotateValue)); + endCoords = _this.getDragCords(e); var touchDuration = endTime.valueOf() - startTime.valueOf(); - _this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, _this.rotateValue); + _this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration); } isMoved = false; } diff --git a/package.json b/package.json index ad13bcb67..196a3e050 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lightgallery", - "version": "2.5.0", + "version": "2.6.0-beta.1", "description": "lightGallery is a feature-rich, modular JavaScript gallery plugin for building beautiful image and video galleries for the web and the mobile", "keywords": [ "JavaScript",