summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Häggqvist <[email protected]>2016-01-16 22:59:26 +0100
committerVictor Häggqvist <[email protected]>2016-01-16 22:59:26 +0100
commit9d2f198f1da0fc04134e47b45b706136fd9f7e7f (patch)
tree24621b231ec803ae14091498f5ac9227f22146a0
parent2f76cfcf3c3aaaef8b09847951e8c42ef21e835c (diff)
build dist
-rw-r--r--demo/LightBox.Core.js12
-rw-r--r--demo/touch-imagelightbox.css1
-rw-r--r--dist/LightBox.ActivityIndicator.min.js1
-rw-r--r--dist/LightBox.Captions.min.js1
-rw-r--r--dist/LightBox.CloseButton.min.js1
-rw-r--r--dist/LightBox.Core.min.js8
-rw-r--r--dist/LightBox.Navigation.min.js1
-rw-r--r--dist/LightBox.Overlay.min.js1
-rw-r--r--dist/LightBox.Plugins.min.js13
-rw-r--r--dist/touch-imagelightbox.css1
-rw-r--r--dist/touch-imagelightbox.min.css2
11 files changed, 31 insertions, 11 deletions
diff --git a/demo/LightBox.Core.js b/demo/LightBox.Core.js
index e5b8e25..cd7898b 100644
--- a/demo/LightBox.Core.js
+++ b/demo/LightBox.Core.js
@@ -64,7 +64,7 @@ var LightBox = LightBox || {}; LightBox["Core"] =
var log = __webpack_require__(3);
- log.setDefaultLevel(log.levels.DEBUG);
+ //log.setDefaultLevel(log.levels.DEBUG);
var LightBox = function () {
function LightBox(targetSelector) {
@@ -86,8 +86,7 @@ var LightBox = LightBox || {}; LightBox["Core"] =
enableKeyboard: true,
quitOnEnd: false,
quitOnImgClick: false,
- quitOnDocClick: true,
- requestFullscreenOnMobile: true
+ quitOnDocClick: true
};
this.options = Object.assign(options, defaultOptions);
@@ -168,7 +167,7 @@ var LightBox = LightBox || {}; LightBox["Core"] =
var _this2 = this;
log.debug('quitLightbox');
- if (this.image === null) return false;
+ if (this.image === null) return;
_CSSUtil.CSSUtil.setTransitionProperty(this.image, 'opacity ' + this.options.animationSpeed / 1000 + 's linear');
setTimeout(function () {
@@ -194,11 +193,6 @@ var LightBox = LightBox || {}; LightBox["Core"] =
event.preventDefault();
- //if (LightBox.HAS_TOUCH) {
- // log.debug('requesting fullscreen');
- // document.body.webkitRequestFullscreen()
- //}
-
if (this.inProgress) return;
this.inProgress = false;
diff --git a/demo/touch-imagelightbox.css b/demo/touch-imagelightbox.css
new file mode 100644
index 0000000..f1911e9
--- /dev/null
+++ b/demo/touch-imagelightbox.css
@@ -0,0 +1 @@
+#imagelightbox-loading,#imagelightbox-loading div{border-radius:50%}#imagelightbox-loading{box-shadow:rgba(0,0,0,0.75) 0 0 40px;background:rgba(0,0,0,0.5);height:20px;left:50%;margin:-20px 0 0 -20px;padding:10px;position:fixed;top:50%;width:20px;z-index:10003;animation:fade-in .25s linear}#imagelightbox-loading div{animation:imagelightbox-loading .5s ease infinite;background-color:#fff;height:20px;width:20px}@keyframes imagelightbox-loading{0%{opacity:.5;transform:scale(0.75)}50%{opacity:1;transform:scale(1)}100%{opacity:.5;transform:scale(0.75)}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}#imagelightbox-overlay{background:rgba(255,255,255,0.9);bottom:0;left:0;position:fixed;right:0;top:0;z-index:9998;animation:fade-in .25s linear}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}#imagelightbox-close{border-radius:50%;background-color:#666;height:40px;position:fixed;right:40px;text-align:left;text-indent:-9999px;top:40px;transition:color .3s ease;width:40px;z-index:10002;cursor:pointer;animation:fade-in .25s linear}#imagelightbox-close:hover{background-color:#111}#imagelightbox-close:before,#imagelightbox-close:after{background-color:#fff;bottom:20%;content:'';left:50%;margin-left:-1px;position:absolute;top:20%;width:2px}#imagelightbox-close:before{rotate:45deg}#imagelightbox-close:after{rotate:-45deg}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}@media only screen and (max-width: 660px){#imagelightbox-close{right:20px;top:20px}}#imagelightbox-nav-sink{display:flex;justify-content:center}#imagelightbox-nav{border-radius:20px;animation:fade-in .25s linear;background-color:rgba(0,0,0,0.5);bottom:60px;padding:5px 2px 1px;position:fixed;z-index:10001}#imagelightbox-nav a{border-radius:50%;border:1px solid #fff;display:inline-block;height:20px;margin:0 5px;width:20px}#imagelightbox-nav .active{background-color:#fff}@media only screen and (max-width: 660px){#imagelightbox-nav{bottom:20px}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}#imagelightbox-caption{background-color:#666;bottom:0;color:#fff;left:0;padding:10px;position:fixed;right:0;text-align:center;z-index:10001;animation:fade-in .25s linear}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}html{-ms-touch-action:manipulation;touch-action:manipulation}#imagelightbox{-ms-touch-action:none;touch-action:none;box-shadow:rgba(0,0,0,0.75) 0 0 50px;cursor:pointer;position:fixed;z-index:10000}
diff --git a/dist/LightBox.ActivityIndicator.min.js b/dist/LightBox.ActivityIndicator.min.js
new file mode 100644
index 0000000..35a0129
--- /dev/null
+++ b/dist/LightBox.ActivityIndicator.min.js
@@ -0,0 +1 @@
+var LightBox=LightBox||{};LightBox.ActivityIndicator=function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){n(this,t),this.element=document.createElement("div"),this.element.id="imagelightbox-loading",this.element.appendChild(document.createElement("div"))}return i(t,[{key:"register",value:function(t){t.addOnLoadStartListener(this.activityIndicatorOn.bind(this)),t.addOnLoadEndListener(this.activityIndicatorOff.bind(this)),t.addOnEndListener(this.activityIndicatorOff.bind(this))}},{key:"activityIndicatorOn",value:function(){document.body.appendChild(this.element)}},{key:"activityIndicatorOff",value:function(){try{document.body.removeChild(this.element)}catch(t){}}}]),t}();e["default"]=r,t.exports=e["default"]}]); \ No newline at end of file
diff --git a/dist/LightBox.Captions.min.js b/dist/LightBox.Captions.min.js
new file mode 100644
index 0000000..a98da4c
--- /dev/null
+++ b/dist/LightBox.Captions.min.js
@@ -0,0 +1 @@
+var LightBox=LightBox||{};LightBox.Captions=function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){n(this,t),this.element=document.createElement("div"),this.element.id="imagelightbox-caption"}return i(t,[{key:"register",value:function(t){this.lightbox=t,t.addOnLoadStartListener(this.hideCaption.bind(this)),t.addOnLoadEndListener(this.showCaption.bind(this)),t.addOnEndListener(this.hideCaption.bind(this))}},{key:"showCaption",value:function(){var t=this.lightbox.target.querySelector("img");if(null!==t){var e=t.getAttribute("alt");null!==e&&e.length>0&&(this.element.innerHTML=t.alt,document.body.appendChild(this.element))}}},{key:"hideCaption",value:function(){try{document.body.removeChild(this.element)}catch(t){}}}]),t}();e["default"]=o,t.exports=e["default"]}]); \ No newline at end of file
diff --git a/dist/LightBox.CloseButton.min.js b/dist/LightBox.CloseButton.min.js
new file mode 100644
index 0000000..e98e22c
--- /dev/null
+++ b/dist/LightBox.CloseButton.min.js
@@ -0,0 +1 @@
+var LightBox=LightBox||{};LightBox.CloseButton=function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];n(this,t),this.closeOnDocumentClick=e,this.element=document.createElement("a"),this.element.id="imagelightbox-close",this.element.innerHTML="Close"}return i(t,[{key:"register",value:function(t){this.lightbox=t,t.addOnStartListener(this.showButton.bind(this)),t.addOnEndListener(this.hideButton.bind(this))}},{key:"showButton",value:function(){var t=this;this.lightbox.options.quitOnDocClick=this.closeOnDocumentClick,["click","touchend"].forEach(function(e){t.element.addEventListener(e,t.exitLightbox.bind(t))}),document.body.appendChild(this.element)}},{key:"hideButton",value:function(){document.body.removeChild(this.element)}},{key:"exitLightbox",value:function(){this.lightbox.quitLightbox()}}]),t}();e["default"]=o,t.exports=e["default"]}]); \ No newline at end of file
diff --git a/dist/LightBox.Core.min.js b/dist/LightBox.Core.min.js
new file mode 100644
index 0000000..2e084e4
--- /dev/null
+++ b/dist/LightBox.Core.min.js
@@ -0,0 +1,8 @@
+/**
+ * Image LightBox - A touch-friendly image lightbox, without bells and whistles.
+ * @version v0.2.0
+ * @link https://victorhaggqvist.github.io/touch-imagelightbox
+ * @license MIT
+ * @author Victor Häggqvist <[email protected]> (https://victorhaggqvist.com/)
+ */
+var LightBox=LightBox||{};LightBox.Core=function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}();Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),s=i(2),a=i(3),u=function(){function t(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];n(this,t),a.info("LightBox"),this.targets=document.querySelectorAll(e),a.debug(this.targets),a.debug("HAS_TOUCH "+t.HAS_TOUCH);var o={allowedTypes:"png|jpg|jpeg|gif",restrictTypes:!1,selectorId:"imagelightbox",animationSpeed:350,preloadNext:!0,enableKeyboard:!0,quitOnEnd:!1,quitOnImgClick:!1,quitOnDocClick:!0};this.options=Object.assign(i,o),a.info(this.options),this.target=null,this.image=null,this.imageWidth=0,this.imageHeight=0,this.swipeDiff=0,this.inProgress=!1,this.swipeStart=0,this.swipeEnd=0,this.onStartListeners=[],this.onEndListeners=[],this.onLoadStartListeners=[],this.onLoadEndListeners=[],this.bindEvents()}return o(t,[{key:"bindEvents",value:function(){var e=this;Array.prototype.forEach.call(this.targets,function(t){t.addEventListener("click",e.onImageClick.bind(e))}),window.addEventListener("resize",this.windowResizeListener.bind(this)),this.options.quitOnDocClick&&document.body.addEventListener(t.HAS_TOUCH?"touchend":"click",this.documentClick.bind(this)),this.options.enableKeyboard&&document.body.addEventListener("keyup",this.handleKeyboard.bind(this))}},{key:"handleKeyboard",value:function(t){if(null===this.image)return!0;if(t.preventDefault(),27===t.keyCode&&this.quitLightbox(),37===t.keyCode||39===t.keyCode){var e=Array.prototype.indexOf.call(this.targets,this.target)-(37===t.keyCode?1:-1);e>this.targets.length-1?this.target=this.targets[0]:0>e?this.target=this.targets[this.targets.length-1]:this.target=this.targets[e],this.loadImage()}}},{key:"documentClick",value:function(){a.debug("document click"),null!==this.image&&this.target.href===this.image.src&&(a.info("quitting"),this.options.quitOnDocClick&&this.quitLightbox())}},{key:"quitLightbox",value:function(){var t=this;a.debug("quitLightbox"),null!==this.image&&(r.CSSUtil.setTransitionProperty(this.image,"opacity "+this.options.animationSpeed/1e3+"s linear"),setTimeout(function(){t.image.style.opacity=0},5),setTimeout(function(){t.removeImage(),t.inProgress=!1,t.onEndListeners.forEach(function(t){return t()})},this.options.animationSpeed))}},{key:"onImageClick",value:function(t){a.debug(t);var e=t.srcElement.parentElement;return this.isTargetValid(e)?(t.preventDefault(),void(this.inProgress||(this.inProgress=!1,this.onStartListeners.forEach(function(t){return t()}),this.target=e,this.loadImage()))):!0}},{key:"isTargetValid",value:function(t){if(this.options.restrictTypes===!1)return!0;var e=new RegExp("(.("+this.options.allowedTypes+")$)");return"a"===t.tagName.toLowerCase()&&e.test(t.href)}},{key:"loadImage",value:function(){var e=this,i=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];if(a.info("loadImage"),this.inProgress)return!1;if(a.debug("not progress"),null!==this.image){if(a.debug("has current image"),i!==!1&&(this.targets.length<2||this.options.quitOnEnd===!0&&(i===s.LightDirection.RIGHT&&0===Array.prototype.indexOf(this.targets,this.target)||i===s.LightDirection.LEFT&&Array.prototype.indexOf(this.targets,this.target)===targets.length-1)))return this.quitLightbox(),!1;a.debug("unload"),r.CSSUtil.setTransitionProperty(this.image,"opacity "+this.options.animationSpeed/1e3+"s linear");var n="0px";i!==!1&&(n=100*i-this.swipeDiff+"px"),this.image.style.transform="translateX("+n+")",setTimeout(function(){e.image.style.opacity=0},5),setTimeout(function(){a.debug("remove from dom"),e.removeImage()},this.options.animationSpeed),this.swipeDiff=0}this.inProgress=!0,this.onLoadStartListeners.forEach(function(t){return t()}),setTimeout(function(){a.debug("loadImage in");var i=new Image;e.image=i,i.onload=function(){i.id=e.options.selectorId,a.debug("img loaded"),document.body.appendChild(i),e.setImage(),i.style.opacity=0;var t=e.options.animationSpeed/1e3;if(a.debug(t),r.CSSUtil.setTransitionProperty(i,"opacity "+t+"s ease"),i.style.transform="translateX(0px)",setTimeout(function(){i.style.opacity=1},10),setTimeout(function(){e.inProgress=!1,e.onLoadEndListeners.forEach(function(t){return t()})},e.options.animationSpeed),e.options.preloadNext){var n=Array.prototype.indexOf.call(e.targets,e.target),o=e.targets[n+1];if(null!==o&&void 0!==o){a.debug("preloading next");var s=new Image;s.src=o.href}else a.debug("no preloading")}},i.src=e.target.href,e.swipeStart=0,e.swipeEnd=0,t.HAS_POINTERS?(i.addEventListener("pointerup",e.imageClickEvent.bind(e)),i.addEventListener("MSPointerUp",e.imageClickEvent.bind(e))):i.addEventListener("click",e.imageClickEvent.bind(e)),["touchstart","pointerdown","MSPointerDown"].forEach(function(t){i.addEventListener(t,e.imageTouchStart.bind(e))}),["touchmove","pointermove","MSPointerMove"].forEach(function(t){i.addEventListener(t,e.imageTouchMove.bind(e))}),["touchend","touchcancel","pointerup","MSPointerUp"].forEach(function(t){i.addEventListener(t,e.imageTouchEnd.bind(e))})},this.options.animationSpeed+100)}},{key:"removeImage",value:function(){var t=document.querySelector("#"+this.options.selectorId);document.body.removeChild(t),this.image=null}},{key:"imageClickEvent",value:function(t){if(t.preventDefault(),a.debug("click"),this.options.quitOnImgClick)return this.quitLightbox(),!1;if(this.wasTouched(t))return!0;var e=t.pageX-t.target.offsetLeft;a.debug(e);var i=Array.prototype.indexOf.call(this.targets,this.target)-(this.imageWidth/2>e?1:-1);i>this.targets.length-1?this.target=this.targets[0]:0>i?this.target=this.targets[this.targets.length-1]:this.target=this.targets[i],this.loadImage()}},{key:"imageTouchStart",value:function(t){return!this.wasTouched(t)||this.options.quitOnImgClick?!0:void(this.swipeStart=t.pageX||t.touches[0].pageX)}},{key:"imageTouchMove",value:function(t){return!this.wasTouched(t)||this.options.quitOnImgClick?!0:(t.preventDefault(),this.swipeEnd=t.pageX||t.touches[0].pageX,this.swipeDiff=this.swipeStart-this.swipeEnd,void(this.image.style.transform="translateX("+-this.swipeDiff+"px)"))}},{key:"imageTouchEnd",value:function(t){if(!this.wasTouched(t)||this.options.quitOnImgClick)return!0;if(a.debug(this.swipeDiff),Math.abs(this.swipeDiff)>50){var e=Array.prototype.indexOf.call(this.targets,this.target)-(this.swipeDiff<0?1:-1);e>this.targets.length-1?this.target=this.targets[0]:0>e?this.target=this.targets[this.targets.length-1]:this.target=this.targets[e];var i=this.swipeDiff>0?s.LightDirection.RIGHT:s.LightDirection.LEFT;this.loadImage(i)}else this.image.style.transform="translateX(0px)"}},{key:"setImage",value:function(){var t=this;if(!this.image)return!1;var e=.8*window.innerWidth,i=.9*window.innerHeight,n=new Image;n.src=this.image.src,n.onload=function(){if(t.imageWidth=n.width,t.imageHeight=n.height,t.imageWidth>e||t.imageHeight>i){var o=t.imageWidth/t.imageHeight>e/i?t.imageWidth/e:t.imageHeight/i;t.imageWidth/=o,t.imageHeight/=o}t.image.style.width=t.imageWidth+"px",t.image.style.height=t.imageHeight+"px",t.image.style.top=(window.innerHeight-t.imageHeight)/2+"px",t.image.style.left=(window.innerWidth-t.imageWidth)/2+"px"}}},{key:"wasTouched",value:function(e){if(t.HAS_TOUCH)return!0;if(!t.HAS_POINTERS||"undefined"==typeof e||"undefined"==typeof e.pointerType)return!1;if("undefined"!=typeof e.MSPOINTER_TYPE_MOUSE){if(e.MSPOINTER_TYPE_MOUSE!==e.pointerType)return!0}else if("mouse"!==e.pointerType)return!0;return!1}},{key:"switchToIndex",value:function(t){t>=0&&t<this.targets.length&&(this.target=this.targets[t],this.loadImage())}},{key:"windowResizeListener",value:function(){a.debug("resized"),this.setImage()}},{key:"addOnStartListener",value:function(t){this.onStartListeners.push(t)}},{key:"addOnEndListener",value:function(t){this.onEndListeners.push(t)}},{key:"addOnLoadStartListener",value:function(t){this.onLoadStartListeners.push(t)}},{key:"addOnLoadEndListener",value:function(t){this.onLoadEndListeners.push(t)}},{key:"registerPlugin",value:function(t){t.register(this)}}]),t}();e["default"]=u,u.HAS_TOUCH="ontouchstart"in window,u.HAS_POINTERS=window.navigator.pointerEnabled||window.navigator.msPointerEnabled,t.exports=e["default"]},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}();Object.defineProperty(e,"__esModule",{value:!0});var o=e.CSSUtil=function(){function t(){i(this,t)}return n(t,null,[{key:"setTransitionProperty",value:function(t,e){var i=t.style;return""===i.transition?void(i.transition=e):""===i.WebkitTransition?void(i.WebkitTransition=e):""===i.MozTransition?void(i.MozTransition=e):void(""===i.OTransition&&(i.OTransition=e))}},{key:"cssTransitionSupport",value:function(){var t=document.body||document.documentElement,e=t.style;return""===e.WebkitTransition?"-webkit-":""===e.MozTransition?"-moz-":""===e.OTransition?"-o-":""===e.transition?"":!1}},{key:"cssTransitionTranslateX",value:function(e,i,n){var o=t.cssTransitionSupport();e.style[o+"transform"]="translateX("+i+")",e.style[o+"transition"]=o+"transform "+n+"s linear"}}]),t}();o.isCssTransitionSupport=o.cssTransitionSupport()!==!1},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=e.LightDirection=function o(){i(this,o)};n.LEFT=1,n.RIGHT=-1},function(t,e,i){var n,o;(function(t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(s,a){"object"===r(t)&&t.exports?t.exports=a():"object"===r(i(5))?(n=a,o="function"==typeof n?n.call(e,i,e,t):n,!(void 0!==o&&(t.exports=o))):s.log=a()}(void 0,function(){function t(t){return("undefined"==typeof console?"undefined":r(console))===u?!1:void 0!==console[t]?e(console,t):void 0!==console.log?e(console,"log"):a}function e(t,e){var i=t[e];if("function"==typeof i.bind)return i.bind(t);try{return Function.prototype.bind.call(i,t)}catch(n){return function(){return Function.prototype.apply.apply(i,[t,arguments])}}}function i(t,e,i){return function(){("undefined"==typeof console?"undefined":r(console))!==u&&(n.call(this,e,i),this[t].apply(this,arguments))}}function n(t,e){for(var i=0;i<l.length;i++){var n=l[i];this[n]=t>i?a:this.methodFactory(n,t,e)}}function o(e,n,o){return t(e)||i.apply(this,arguments)}function s(t,e,i){function s(t){var e=(l[t]||"silent").toUpperCase();try{return void(window.localStorage[h]=e)}catch(i){}try{window.document.cookie=encodeURIComponent(h)+"="+e+";"}catch(i){}}function a(){var t;try{t=window.localStorage[h]}catch(e){}if(("undefined"==typeof t?"undefined":r(t))===u)try{var i=window.document.cookie,n=i.indexOf(encodeURIComponent(h)+"=");n&&(t=/^([^;]+)/.exec(i.slice(n))[1])}catch(e){}return void 0===c.levels[t]&&(t=void 0),t}var d,c=this,h="loglevel";t&&(h+=":"+t),c.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},c.methodFactory=i||o,c.getLevel=function(){return d},c.setLevel=function(e,i){if("string"==typeof e&&void 0!==c.levels[e.toUpperCase()]&&(e=c.levels[e.toUpperCase()]),!("number"==typeof e&&e>=0&&e<=c.levels.SILENT))throw"log.setLevel() called with invalid level: "+e;return d=e,i!==!1&&s(e),n.call(c,e,t),("undefined"==typeof console?"undefined":r(console))===u&&e<c.levels.SILENT?"No console available for logging":void 0},c.setDefaultLevel=function(t){a()||c.setLevel(t,!1)},c.enableAll=function(t){c.setLevel(c.levels.TRACE,t)},c.disableAll=function(t){c.setLevel(c.levels.SILENT,t)};var g=a();null==g&&(g=null==e?"WARN":e),c.setLevel(g,!1)}var a=function(){},u="undefined",l=["trace","debug","info","warn","error"],d=new s,c={};d.getLogger=function(t){if("string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=c[t];return e||(e=c[t]=new s(t,d.getLevel(),d.methodFactory)),e};var h=("undefined"==typeof window?"undefined":r(window))!==u?window.log:void 0;return d.noConflict=function(){return("undefined"==typeof window?"undefined":r(window))!==u&&window.log===d&&(window.log=h),d},d})}).call(e,i(4)(t))},function(t,e){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){(function(e){t.exports=e}).call(e,{})}]); \ No newline at end of file
diff --git a/dist/LightBox.Navigation.min.js b/dist/LightBox.Navigation.min.js
new file mode 100644
index 0000000..63d77af
--- /dev/null
+++ b/dist/LightBox.Navigation.min.js
@@ -0,0 +1 @@
+var LightBox=LightBox||{};LightBox.Navigation=function(t){function i(n){if(e[n])return e[n].exports;var a=e[n]={exports:{},id:n,loaded:!1};return t[n].call(a.exports,a,a.exports,i),a.loaded=!0,a.exports}var e={};return i.m=t,i.c=e,i.p="",i(0)}([function(t,i){"use strict";function e(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}var n=function(){function t(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(i,e,n){return e&&t(i.prototype,e),n&&t(i,n),i}}();Object.defineProperty(i,"__esModule",{value:!0});var a=function(){function t(){e(this,t)}return n(t,[{key:"register",value:function(t){this.lightbox=t,t.addOnStartListener(this.showNavigation.bind(this)),t.addOnEndListener(this.hideNavigation.bind(this)),t.addOnLoadEndListener(this.updateNavigation.bind(this))}},{key:"showNavigation",value:function(){var t=this;this.sink=document.createElement("div"),this.sink.id="imagelightbox-nav-sink",this.nav=document.createElement("div"),this.nav.id="imagelightbox-nav",this.sink.appendChild(this.nav),Array.prototype.forEach.call(this.lightbox.targets,function(i){t.nav.appendChild(document.createElement("a"))}),document.body.appendChild(this.sink);var i=this.nav.querySelectorAll("a");Array.prototype.forEach.call(i,function(i,e){["click","touchend"].forEach(function(n){i.addEventListener(n,t.navClick.bind(t,e))})});var e=this.nav.getBoundingClientRect(),n=e.width/2;this.nav.style.marginLeft="-"+n+"px"}},{key:"updateNavigation",value:function(){Array.prototype.forEach.call(this.nav.childNodes,function(t){t.classList.remove("active")});var t=Array.prototype.indexOf.call(this.lightbox.targets,this.lightbox.target);this.nav.childNodes[t].classList.add("active")}},{key:"hideNavigation",value:function(){try{document.body.removeChild(this.sink)}catch(t){}}},{key:"navClick",value:function(t,i){i.stopPropagation(),i.cancelBubble=!0,this.lightbox.switchToIndex(t)}}]),t}();i["default"]=a,t.exports=i["default"]}]); \ No newline at end of file
diff --git a/dist/LightBox.Overlay.min.js b/dist/LightBox.Overlay.min.js
new file mode 100644
index 0000000..d520769
--- /dev/null
+++ b/dist/LightBox.Overlay.min.js
@@ -0,0 +1 @@
+var LightBox=LightBox||{};LightBox.Overlay=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){n(this,e),this.element=document.createElement("div"),this.element.id="imagelightbox-overlay"}return r(e,[{key:"register",value:function(e){e.addOnStartListener(this.overlayOn.bind(this)),e.addOnEndListener(this.overlayOff.bind(this))}},{key:"overlayOn",value:function(){document.body.appendChild(this.element)}},{key:"overlayOff",value:function(){document.body.removeChild(this.element)}}]),e}();t["default"]=o,e.exports=t["default"]}]); \ No newline at end of file
diff --git a/dist/LightBox.Plugins.min.js b/dist/LightBox.Plugins.min.js
new file mode 100644
index 0000000..ced5c13
--- /dev/null
+++ b/dist/LightBox.Plugins.min.js
@@ -0,0 +1,13 @@
+/**
+ * Image LightBox Plugins - A touch-friendly image lightbox, without bells and whistles.
+ * @version v0.2.0
+ * @link https://victorhaggqvist.github.io/touch-imagelightbox
+ * @license MIT
+ * @author Victor Häggqvist <[email protected]> (https://victorhaggqvist.com/)
+ */
+var LightBox=LightBox||{};LightBox.ActivityIndicator=function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){n(this,t),this.element=document.createElement("div"),this.element.id="imagelightbox-loading",this.element.appendChild(document.createElement("div"))}return i(t,[{key:"register",value:function(t){t.addOnLoadStartListener(this.activityIndicatorOn.bind(this)),t.addOnLoadEndListener(this.activityIndicatorOff.bind(this)),t.addOnEndListener(this.activityIndicatorOff.bind(this))}},{key:"activityIndicatorOn",value:function(){document.body.appendChild(this.element)}},{key:"activityIndicatorOff",value:function(){try{document.body.removeChild(this.element)}catch(t){}}}]),t}();e["default"]=r,t.exports=e["default"]}]);
+var LightBox=LightBox||{};LightBox.Captions=function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){n(this,t),this.element=document.createElement("div"),this.element.id="imagelightbox-caption"}return i(t,[{key:"register",value:function(t){this.lightbox=t,t.addOnLoadStartListener(this.hideCaption.bind(this)),t.addOnLoadEndListener(this.showCaption.bind(this)),t.addOnEndListener(this.hideCaption.bind(this))}},{key:"showCaption",value:function(){var t=this.lightbox.target.querySelector("img");if(null!==t){var e=t.getAttribute("alt");null!==e&&e.length>0&&(this.element.innerHTML=t.alt,document.body.appendChild(this.element))}}},{key:"hideCaption",value:function(){try{document.body.removeChild(this.element)}catch(t){}}}]),t}();e["default"]=o,t.exports=e["default"]}]);
+var LightBox=LightBox||{};LightBox.CloseButton=function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];n(this,t),this.closeOnDocumentClick=e,this.element=document.createElement("a"),this.element.id="imagelightbox-close",this.element.innerHTML="Close"}return i(t,[{key:"register",value:function(t){this.lightbox=t,t.addOnStartListener(this.showButton.bind(this)),t.addOnEndListener(this.hideButton.bind(this))}},{key:"showButton",value:function(){var t=this;this.lightbox.options.quitOnDocClick=this.closeOnDocumentClick,["click","touchend"].forEach(function(e){t.element.addEventListener(e,t.exitLightbox.bind(t))}),document.body.appendChild(this.element)}},{key:"hideButton",value:function(){document.body.removeChild(this.element)}},{key:"exitLightbox",value:function(){this.lightbox.quitLightbox()}}]),t}();e["default"]=o,t.exports=e["default"]}]);
+var LightBox=LightBox||{};LightBox.Core=function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}();Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),s=i(2),a=i(3),u=function(){function t(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];n(this,t),a.info("LightBox"),this.targets=document.querySelectorAll(e),a.debug(this.targets),a.debug("HAS_TOUCH "+t.HAS_TOUCH);var o={allowedTypes:"png|jpg|jpeg|gif",restrictTypes:!1,selectorId:"imagelightbox",animationSpeed:350,preloadNext:!0,enableKeyboard:!0,quitOnEnd:!1,quitOnImgClick:!1,quitOnDocClick:!0};this.options=Object.assign(i,o),a.info(this.options),this.target=null,this.image=null,this.imageWidth=0,this.imageHeight=0,this.swipeDiff=0,this.inProgress=!1,this.swipeStart=0,this.swipeEnd=0,this.onStartListeners=[],this.onEndListeners=[],this.onLoadStartListeners=[],this.onLoadEndListeners=[],this.bindEvents()}return o(t,[{key:"bindEvents",value:function(){var e=this;Array.prototype.forEach.call(this.targets,function(t){t.addEventListener("click",e.onImageClick.bind(e))}),window.addEventListener("resize",this.windowResizeListener.bind(this)),this.options.quitOnDocClick&&document.body.addEventListener(t.HAS_TOUCH?"touchend":"click",this.documentClick.bind(this)),this.options.enableKeyboard&&document.body.addEventListener("keyup",this.handleKeyboard.bind(this))}},{key:"handleKeyboard",value:function(t){if(null===this.image)return!0;if(t.preventDefault(),27===t.keyCode&&this.quitLightbox(),37===t.keyCode||39===t.keyCode){var e=Array.prototype.indexOf.call(this.targets,this.target)-(37===t.keyCode?1:-1);e>this.targets.length-1?this.target=this.targets[0]:0>e?this.target=this.targets[this.targets.length-1]:this.target=this.targets[e],this.loadImage()}}},{key:"documentClick",value:function(){a.debug("document click"),null!==this.image&&this.target.href===this.image.src&&(a.info("quitting"),this.options.quitOnDocClick&&this.quitLightbox())}},{key:"quitLightbox",value:function(){var t=this;a.debug("quitLightbox"),null!==this.image&&(r.CSSUtil.setTransitionProperty(this.image,"opacity "+this.options.animationSpeed/1e3+"s linear"),setTimeout(function(){t.image.style.opacity=0},5),setTimeout(function(){t.removeImage(),t.inProgress=!1,t.onEndListeners.forEach(function(t){return t()})},this.options.animationSpeed))}},{key:"onImageClick",value:function(t){a.debug(t);var e=t.srcElement.parentElement;return this.isTargetValid(e)?(t.preventDefault(),void(this.inProgress||(this.inProgress=!1,this.onStartListeners.forEach(function(t){return t()}),this.target=e,this.loadImage()))):!0}},{key:"isTargetValid",value:function(t){if(this.options.restrictTypes===!1)return!0;var e=new RegExp("(.("+this.options.allowedTypes+")$)");return"a"===t.tagName.toLowerCase()&&e.test(t.href)}},{key:"loadImage",value:function(){var e=this,i=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];if(a.info("loadImage"),this.inProgress)return!1;if(a.debug("not progress"),null!==this.image){if(a.debug("has current image"),i!==!1&&(this.targets.length<2||this.options.quitOnEnd===!0&&(i===s.LightDirection.RIGHT&&0===Array.prototype.indexOf(this.targets,this.target)||i===s.LightDirection.LEFT&&Array.prototype.indexOf(this.targets,this.target)===targets.length-1)))return this.quitLightbox(),!1;a.debug("unload"),r.CSSUtil.setTransitionProperty(this.image,"opacity "+this.options.animationSpeed/1e3+"s linear");var n="0px";i!==!1&&(n=100*i-this.swipeDiff+"px"),this.image.style.transform="translateX("+n+")",setTimeout(function(){e.image.style.opacity=0},5),setTimeout(function(){a.debug("remove from dom"),e.removeImage()},this.options.animationSpeed),this.swipeDiff=0}this.inProgress=!0,this.onLoadStartListeners.forEach(function(t){return t()}),setTimeout(function(){a.debug("loadImage in");var i=new Image;e.image=i,i.onload=function(){i.id=e.options.selectorId,a.debug("img loaded"),document.body.appendChild(i),e.setImage(),i.style.opacity=0;var t=e.options.animationSpeed/1e3;if(a.debug(t),r.CSSUtil.setTransitionProperty(i,"opacity "+t+"s ease"),i.style.transform="translateX(0px)",setTimeout(function(){i.style.opacity=1},10),setTimeout(function(){e.inProgress=!1,e.onLoadEndListeners.forEach(function(t){return t()})},e.options.animationSpeed),e.options.preloadNext){var n=Array.prototype.indexOf.call(e.targets,e.target),o=e.targets[n+1];if(null!==o&&void 0!==o){a.debug("preloading next");var s=new Image;s.src=o.href}else a.debug("no preloading")}},i.src=e.target.href,e.swipeStart=0,e.swipeEnd=0,t.HAS_POINTERS?(i.addEventListener("pointerup",e.imageClickEvent.bind(e)),i.addEventListener("MSPointerUp",e.imageClickEvent.bind(e))):i.addEventListener("click",e.imageClickEvent.bind(e)),["touchstart","pointerdown","MSPointerDown"].forEach(function(t){i.addEventListener(t,e.imageTouchStart.bind(e))}),["touchmove","pointermove","MSPointerMove"].forEach(function(t){i.addEventListener(t,e.imageTouchMove.bind(e))}),["touchend","touchcancel","pointerup","MSPointerUp"].forEach(function(t){i.addEventListener(t,e.imageTouchEnd.bind(e))})},this.options.animationSpeed+100)}},{key:"removeImage",value:function(){var t=document.querySelector("#"+this.options.selectorId);document.body.removeChild(t),this.image=null}},{key:"imageClickEvent",value:function(t){if(t.preventDefault(),a.debug("click"),this.options.quitOnImgClick)return this.quitLightbox(),!1;if(this.wasTouched(t))return!0;var e=t.pageX-t.target.offsetLeft;a.debug(e);var i=Array.prototype.indexOf.call(this.targets,this.target)-(this.imageWidth/2>e?1:-1);i>this.targets.length-1?this.target=this.targets[0]:0>i?this.target=this.targets[this.targets.length-1]:this.target=this.targets[i],this.loadImage()}},{key:"imageTouchStart",value:function(t){return!this.wasTouched(t)||this.options.quitOnImgClick?!0:void(this.swipeStart=t.pageX||t.touches[0].pageX)}},{key:"imageTouchMove",value:function(t){return!this.wasTouched(t)||this.options.quitOnImgClick?!0:(t.preventDefault(),this.swipeEnd=t.pageX||t.touches[0].pageX,this.swipeDiff=this.swipeStart-this.swipeEnd,void(this.image.style.transform="translateX("+-this.swipeDiff+"px)"))}},{key:"imageTouchEnd",value:function(t){if(!this.wasTouched(t)||this.options.quitOnImgClick)return!0;if(a.debug(this.swipeDiff),Math.abs(this.swipeDiff)>50){var e=Array.prototype.indexOf.call(this.targets,this.target)-(this.swipeDiff<0?1:-1);e>this.targets.length-1?this.target=this.targets[0]:0>e?this.target=this.targets[this.targets.length-1]:this.target=this.targets[e];var i=this.swipeDiff>0?s.LightDirection.RIGHT:s.LightDirection.LEFT;this.loadImage(i)}else this.image.style.transform="translateX(0px)"}},{key:"setImage",value:function(){var t=this;if(!this.image)return!1;var e=.8*window.innerWidth,i=.9*window.innerHeight,n=new Image;n.src=this.image.src,n.onload=function(){if(t.imageWidth=n.width,t.imageHeight=n.height,t.imageWidth>e||t.imageHeight>i){var o=t.imageWidth/t.imageHeight>e/i?t.imageWidth/e:t.imageHeight/i;t.imageWidth/=o,t.imageHeight/=o}t.image.style.width=t.imageWidth+"px",t.image.style.height=t.imageHeight+"px",t.image.style.top=(window.innerHeight-t.imageHeight)/2+"px",t.image.style.left=(window.innerWidth-t.imageWidth)/2+"px"}}},{key:"wasTouched",value:function(e){if(t.HAS_TOUCH)return!0;if(!t.HAS_POINTERS||"undefined"==typeof e||"undefined"==typeof e.pointerType)return!1;if("undefined"!=typeof e.MSPOINTER_TYPE_MOUSE){if(e.MSPOINTER_TYPE_MOUSE!==e.pointerType)return!0}else if("mouse"!==e.pointerType)return!0;return!1}},{key:"switchToIndex",value:function(t){t>=0&&t<this.targets.length&&(this.target=this.targets[t],this.loadImage())}},{key:"windowResizeListener",value:function(){a.debug("resized"),this.setImage()}},{key:"addOnStartListener",value:function(t){this.onStartListeners.push(t)}},{key:"addOnEndListener",value:function(t){this.onEndListeners.push(t)}},{key:"addOnLoadStartListener",value:function(t){this.onLoadStartListeners.push(t)}},{key:"addOnLoadEndListener",value:function(t){this.onLoadEndListeners.push(t)}},{key:"registerPlugin",value:function(t){t.register(this)}}]),t}();e["default"]=u,u.HAS_TOUCH="ontouchstart"in window,u.HAS_POINTERS=window.navigator.pointerEnabled||window.navigator.msPointerEnabled,t.exports=e["default"]},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}();Object.defineProperty(e,"__esModule",{value:!0});var o=e.CSSUtil=function(){function t(){i(this,t)}return n(t,null,[{key:"setTransitionProperty",value:function(t,e){var i=t.style;return""===i.transition?void(i.transition=e):""===i.WebkitTransition?void(i.WebkitTransition=e):""===i.MozTransition?void(i.MozTransition=e):void(""===i.OTransition&&(i.OTransition=e))}},{key:"cssTransitionSupport",value:function(){var t=document.body||document.documentElement,e=t.style;return""===e.WebkitTransition?"-webkit-":""===e.MozTransition?"-moz-":""===e.OTransition?"-o-":""===e.transition?"":!1}},{key:"cssTransitionTranslateX",value:function(e,i,n){var o=t.cssTransitionSupport();e.style[o+"transform"]="translateX("+i+")",e.style[o+"transition"]=o+"transform "+n+"s linear"}}]),t}();o.isCssTransitionSupport=o.cssTransitionSupport()!==!1},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var n=e.LightDirection=function o(){i(this,o)};n.LEFT=1,n.RIGHT=-1},function(t,e,i){var n,o;(function(t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(s,a){"object"===r(t)&&t.exports?t.exports=a():"object"===r(i(5))?(n=a,o="function"==typeof n?n.call(e,i,e,t):n,!(void 0!==o&&(t.exports=o))):s.log=a()}(void 0,function(){function t(t){return("undefined"==typeof console?"undefined":r(console))===u?!1:void 0!==console[t]?e(console,t):void 0!==console.log?e(console,"log"):a}function e(t,e){var i=t[e];if("function"==typeof i.bind)return i.bind(t);try{return Function.prototype.bind.call(i,t)}catch(n){return function(){return Function.prototype.apply.apply(i,[t,arguments])}}}function i(t,e,i){return function(){("undefined"==typeof console?"undefined":r(console))!==u&&(n.call(this,e,i),this[t].apply(this,arguments))}}function n(t,e){for(var i=0;i<l.length;i++){var n=l[i];this[n]=t>i?a:this.methodFactory(n,t,e)}}function o(e,n,o){return t(e)||i.apply(this,arguments)}function s(t,e,i){function s(t){var e=(l[t]||"silent").toUpperCase();try{return void(window.localStorage[h]=e)}catch(i){}try{window.document.cookie=encodeURIComponent(h)+"="+e+";"}catch(i){}}function a(){var t;try{t=window.localStorage[h]}catch(e){}if(("undefined"==typeof t?"undefined":r(t))===u)try{var i=window.document.cookie,n=i.indexOf(encodeURIComponent(h)+"=");n&&(t=/^([^;]+)/.exec(i.slice(n))[1])}catch(e){}return void 0===c.levels[t]&&(t=void 0),t}var d,c=this,h="loglevel";t&&(h+=":"+t),c.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},c.methodFactory=i||o,c.getLevel=function(){return d},c.setLevel=function(e,i){if("string"==typeof e&&void 0!==c.levels[e.toUpperCase()]&&(e=c.levels[e.toUpperCase()]),!("number"==typeof e&&e>=0&&e<=c.levels.SILENT))throw"log.setLevel() called with invalid level: "+e;return d=e,i!==!1&&s(e),n.call(c,e,t),("undefined"==typeof console?"undefined":r(console))===u&&e<c.levels.SILENT?"No console available for logging":void 0},c.setDefaultLevel=function(t){a()||c.setLevel(t,!1)},c.enableAll=function(t){c.setLevel(c.levels.TRACE,t)},c.disableAll=function(t){c.setLevel(c.levels.SILENT,t)};var g=a();null==g&&(g=null==e?"WARN":e),c.setLevel(g,!1)}var a=function(){},u="undefined",l=["trace","debug","info","warn","error"],d=new s,c={};d.getLogger=function(t){if("string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=c[t];return e||(e=c[t]=new s(t,d.getLevel(),d.methodFactory)),e};var h=("undefined"==typeof window?"undefined":r(window))!==u?window.log:void 0;return d.noConflict=function(){return("undefined"==typeof window?"undefined":r(window))!==u&&window.log===d&&(window.log=h),d},d})}).call(e,i(4)(t))},function(t,e){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){(function(e){t.exports=e}).call(e,{})}]);
+var LightBox=LightBox||{};LightBox.Navigation=function(t){function i(n){if(e[n])return e[n].exports;var a=e[n]={exports:{},id:n,loaded:!1};return t[n].call(a.exports,a,a.exports,i),a.loaded=!0,a.exports}var e={};return i.m=t,i.c=e,i.p="",i(0)}([function(t,i){"use strict";function e(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}var n=function(){function t(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(i,e,n){return e&&t(i.prototype,e),n&&t(i,n),i}}();Object.defineProperty(i,"__esModule",{value:!0});var a=function(){function t(){e(this,t)}return n(t,[{key:"register",value:function(t){this.lightbox=t,t.addOnStartListener(this.showNavigation.bind(this)),t.addOnEndListener(this.hideNavigation.bind(this)),t.addOnLoadEndListener(this.updateNavigation.bind(this))}},{key:"showNavigation",value:function(){var t=this;this.sink=document.createElement("div"),this.sink.id="imagelightbox-nav-sink",this.nav=document.createElement("div"),this.nav.id="imagelightbox-nav",this.sink.appendChild(this.nav),Array.prototype.forEach.call(this.lightbox.targets,function(i){t.nav.appendChild(document.createElement("a"))}),document.body.appendChild(this.sink);var i=this.nav.querySelectorAll("a");Array.prototype.forEach.call(i,function(i,e){["click","touchend"].forEach(function(n){i.addEventListener(n,t.navClick.bind(t,e))})});var e=this.nav.getBoundingClientRect(),n=e.width/2;this.nav.style.marginLeft="-"+n+"px"}},{key:"updateNavigation",value:function(){Array.prototype.forEach.call(this.nav.childNodes,function(t){t.classList.remove("active")});var t=Array.prototype.indexOf.call(this.lightbox.targets,this.lightbox.target);this.nav.childNodes[t].classList.add("active")}},{key:"hideNavigation",value:function(){try{document.body.removeChild(this.sink)}catch(t){}}},{key:"navClick",value:function(t,i){i.stopPropagation(),i.cancelBubble=!0,this.lightbox.switchToIndex(t)}}]),t}();i["default"]=a,t.exports=i["default"]}]);
+var LightBox=LightBox||{};LightBox.Overlay=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){n(this,e),this.element=document.createElement("div"),this.element.id="imagelightbox-overlay"}return r(e,[{key:"register",value:function(e){e.addOnStartListener(this.overlayOn.bind(this)),e.addOnEndListener(this.overlayOff.bind(this))}},{key:"overlayOn",value:function(){document.body.appendChild(this.element)}},{key:"overlayOff",value:function(){document.body.removeChild(this.element)}}]),e}();t["default"]=o,e.exports=t["default"]}]); \ No newline at end of file
diff --git a/dist/touch-imagelightbox.css b/dist/touch-imagelightbox.css
deleted file mode 100644
index f1ca31d..0000000
--- a/dist/touch-imagelightbox.css
+++ /dev/null
@@ -1 +0,0 @@
-#imagelightbox-loading,#imagelightbox-loading div{border-radius:50%}#imagelightbox-loading{box-shadow:rgba(0,0,0,.75)0 0 40px;background:rgba(0,0,0,.5);height:20px;left:50%;margin:-20px 0 0 -20px;padding:10px;position:fixed;top:50%;width:20px;z-index:10003;animation:fade-in .25s linear}#imagelightbox-loading div{animation:imagelightbox-loading .5s ease infinite;background-color:#fff;height:20px;width:20px}@keyframes imagelightbox-loading{0%{opacity:.5;transform:scale(.75)}50%{opacity:1;transform:scale(1)}100%{opacity:.5;transform:scale(.75)}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}#imagelightbox-overlay{background:rgba(255,255,255,.9);bottom:0;left:0;position:fixed;right:0;top:0;z-index:9998;animation:fade-in .25s linear}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}#imagelightbox-close{border-radius:50%;background-color:#666;height:40px;position:fixed;right:40px;text-align:left;text-indent:-9999px;top:40px;transition:color .3s ease;width:40px;z-index:10002;cursor:pointer;animation:fade-in .25s linear}#imagelightbox-close:hover{background-color:#111}#imagelightbox-close:before,#imagelightbox-close:after{background-color:#fff;bottom:20%;content:'';left:50%;margin-left:-1px;position:absolute;top:20%;width:2px}#imagelightbox-close:before{rotate:45deg}#imagelightbox-close:after{rotate:-45deg}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}@media only screen and (max-width:660px){#imagelightbox-close{right:20px;top:20px}}#imagelightbox-nav-sink{display:flex;justify-content:center}#imagelightbox-nav{border-radius:20px;animation:fade-in .25s linear;background-color:rgba(0,0,0,.5);bottom:60px;padding:5px 2px 1px;position:fixed;z-index:10001}#imagelightbox-nav a{border-radius:50%;border:1px solid #fff;display:inline-block;height:20px;margin:0 5px;width:20px}#imagelightbox-nav .active{background-color:#fff}@media only screen and (max-width:660px){#imagelightbox-nav{bottom:20px}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}#imagelightbox-caption{background-color:#666;bottom:0;color:#fff;left:0;padding:10px;position:fixed;right:0;text-align:center;z-index:10001;animation:fade-in .25s linear}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}html{-ms-touch-action:manipulation;touch-action:manipulation}#imagelightbox{-ms-touch-action:none;touch-action:none;box-shadow:rgba(0,0,0,.75)0 0 50px;cursor:pointer;position:fixed;z-index:10000} \ No newline at end of file
diff --git a/dist/touch-imagelightbox.min.css b/dist/touch-imagelightbox.min.css
index 0e2c8fb..f1ca31d 100644
--- a/dist/touch-imagelightbox.min.css
+++ b/dist/touch-imagelightbox.min.css
@@ -1 +1 @@
-html{-ms-touch-action:manipulation;touch-action:manipulation}#imagelightbox{-ms-touch-action:none;touch-action:none;-moz-box-shadow:rgba(0,0,0,0.75) 0 0 50px;-webkit-box-shadow:rgba(0,0,0,0.75) 0 0 50px;box-shadow:rgba(0,0,0,0.75) 0 0 50px;cursor:pointer;position:fixed;z-index:10000}#imagelightbox-loading,#imagelightbox-loading div{-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%}#imagelightbox-loading{-moz-box-shadow:rgba(0,0,0,0.75) 0 0 40px;-webkit-box-shadow:rgba(0,0,0,0.75) 0 0 40px;box-shadow:rgba(0,0,0,0.75) 0 0 40px;background:#444;background:rgba(0,0,0,0.5);height:20px;left:50%;margin:-20px 0 0 -20px;padding:10px;position:fixed;top:50%;width:20px;z-index:10003}#imagelightbox-loading div{-moz-animation:imagelightbox-loading .5s ease infinite;-o-animation:imagelightbox-loading .5s ease infinite;-webkit-animation:imagelightbox-loading .5s ease infinite;animation:imagelightbox-loading .5s ease infinite;background-color:#fff;height:20px;width:20px}@-webkit-keyframes imagelightbox-loading{0%{opacity:.5;-webkit-transform:scale(0.75)}50%{opacity:1;-webkit-transform:scale(1)}100%{opacity:.5;-webkit-transform:scale(0.75)}}@-moz-keyframes imagelightbox-loading{0%{opacity:.5;-moz-transform:scale(0.75)}50%{opacity:1;-moz-transform:scale(1)}100%{opacity:.5;-moz-transform:scale(0.75)}}@-o-keyframes imagelightbox-loading{0%{opacity:.5;-o-transform:scale(0.75)}50%{opacity:1;-o-transform:scale(1)}100%{opacity:.5;-o-transform:scale(0.75)}}@keyframes imagelightbox-loading{0%{opacity:.5;transform:scale(0.75)}50%{opacity:1;transform:scale(1)}100%{opacity:.5;transform:scale(0.75)}}#imagelightbox-overlay{background:#fff;background:rgba(255,255,255,0.9);bottom:0;left:0;position:fixed;right:0;top:0;z-index:9998}#imagelightbox-close{-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;background-color:#666;height:40px;position:fixed;right:40px;text-align:left;text-indent:-9999px;top:40px;-moz-transition:color .3s ease;-ms-transition:color .3s ease;-o-transition:color .3s ease;-webkit-transition:color .3s ease;transition:color .3s ease;width:40px;z-index:10002}#imagelightbox-close:hover{background-color:#111}#imagelightbox-close:before,#imagelightbox-close:after{background-color:#fff;bottom:20%;content:'';left:50%;margin-left:-1px;position:absolute;top:20%;width:2px}#imagelightbox-close:before{-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg)}#imagelightbox-close:after{-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#imagelightbox-caption{background-color:#666;bottom:0;color:#fff;left:0;padding:10px;position:fixed;right:0;text-align:center;z-index:10001}#imagelightbox-nav{-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;-moz-transform:translateX(-50%);-ms-transform:translateX(-50%);-webkit-transform:translateX(-50%);transform:translateX(-50%);background-color:#444;background-color:rgba(0,0,0,0.5);bottom:60px;left:50%;padding:5px 2px 1px;position:fixed;z-index:10001}#imagelightbox-nav a{-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;border:1px solid #fff;display:inline-block;height:20px;margin:0 5px;width:20px}#imagelightbox-nav .active{background-color:#fff}#imagelightbox-loading,#imagelightbox-overlay,#imagelightbox-close,#imagelightbox-caption,#imagelightbox-nav{-moz-animation:fade-in .25s linear;-o-animation:fade-in .25s linear;-webkit-animation:fade-in .25s linear;animation:fade-in .25s linear}@-webkit-keyframes fade-in{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fade-in{0%{opacity:0}100%{opacity:1}}@-o-keyframes fade-in{0%{opacity:0}100%{opacity:1}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}@media only screen and (max-width: 660px){#imagelightbox-close{right:20px;top:20px}#imagelightbox-nav{bottom:20px}}
+#imagelightbox-loading,#imagelightbox-loading div{border-radius:50%}#imagelightbox-loading{box-shadow:rgba(0,0,0,.75)0 0 40px;background:rgba(0,0,0,.5);height:20px;left:50%;margin:-20px 0 0 -20px;padding:10px;position:fixed;top:50%;width:20px;z-index:10003;animation:fade-in .25s linear}#imagelightbox-loading div{animation:imagelightbox-loading .5s ease infinite;background-color:#fff;height:20px;width:20px}@keyframes imagelightbox-loading{0%{opacity:.5;transform:scale(.75)}50%{opacity:1;transform:scale(1)}100%{opacity:.5;transform:scale(.75)}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}#imagelightbox-overlay{background:rgba(255,255,255,.9);bottom:0;left:0;position:fixed;right:0;top:0;z-index:9998;animation:fade-in .25s linear}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}#imagelightbox-close{border-radius:50%;background-color:#666;height:40px;position:fixed;right:40px;text-align:left;text-indent:-9999px;top:40px;transition:color .3s ease;width:40px;z-index:10002;cursor:pointer;animation:fade-in .25s linear}#imagelightbox-close:hover{background-color:#111}#imagelightbox-close:before,#imagelightbox-close:after{background-color:#fff;bottom:20%;content:'';left:50%;margin-left:-1px;position:absolute;top:20%;width:2px}#imagelightbox-close:before{rotate:45deg}#imagelightbox-close:after{rotate:-45deg}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}@media only screen and (max-width:660px){#imagelightbox-close{right:20px;top:20px}}#imagelightbox-nav-sink{display:flex;justify-content:center}#imagelightbox-nav{border-radius:20px;animation:fade-in .25s linear;background-color:rgba(0,0,0,.5);bottom:60px;padding:5px 2px 1px;position:fixed;z-index:10001}#imagelightbox-nav a{border-radius:50%;border:1px solid #fff;display:inline-block;height:20px;margin:0 5px;width:20px}#imagelightbox-nav .active{background-color:#fff}@media only screen and (max-width:660px){#imagelightbox-nav{bottom:20px}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}#imagelightbox-caption{background-color:#666;bottom:0;color:#fff;left:0;padding:10px;position:fixed;right:0;text-align:center;z-index:10001;animation:fade-in .25s linear}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}html{-ms-touch-action:manipulation;touch-action:manipulation}#imagelightbox{-ms-touch-action:none;touch-action:none;box-shadow:rgba(0,0,0,.75)0 0 50px;cursor:pointer;position:fixed;z-index:10000} \ No newline at end of file