From dc0386cb495d73add7a8e44db3b3294067542e35 Mon Sep 17 00:00:00 2001 From: Antonio Laguna Date: Thu, 2 Mar 2017 10:43:57 +0100 Subject: [PATCH] 1.2.0 --- package.json | 3 +- static/js/webslides.js | 124 +++++++++++++++++++++++++------------ static/js/webslides.min.js | 10 ++- webpack.config.babel.js | 11 +++- 4 files changed, 104 insertions(+), 44 deletions(-) diff --git a/package.json b/package.json index c193c58..b7cfbf3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webslides", - "version": "1.1.0", + "version": "1.2.0", "description": "Making HTML presentations easy", "main": "index.js", "repository": { @@ -34,6 +34,7 @@ "babel-preset-es2015": "^6.22.0", "npm-run-all": "^4.0.2", "rimraf": "^2.6.0", + "smart-banner-webpack-plugin": "^3.0.1", "webpack": "^2.2.1", "webpack-dev-server": "^2.4.1" }, diff --git a/static/js/webslides.js b/static/js/webslides.js index 0a46daa..a3db2e0 100644 --- a/static/js/webslides.js +++ b/static/js/webslides.js @@ -1,3 +1,11 @@ +/*! + * Name: WebSlides + * Version: 1.2.0 + * Date: 2017-03-02 + * Description: Making HTML presentations easy + * URL: https://github.com/jlantunez/webslides#readme + * Credits: @jlantunez, @LuisSacristan, @Belelros + */ /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -182,6 +190,10 @@ var DOM = function () { var Keys = { ENTER: 13, SPACE: 32, + RE_PAGE: 33, + AV_PAGE: 34, + END: 35, + HOME: 36, LEFT: 37, UP: 38, RIGHT: 39, @@ -325,16 +337,29 @@ var PLUGINS = { var WebSlides = function () { /** * Options for WebSlides - * @param {number|boolean} autoslide Is false by default. If a number is - * @param {boolean} changeOnClick Is false by default. If true, it will allow + * @param {number|boolean} autoslide If a number is provided, it will allow + * autosliding by said amount of miliseconds. + * @param {boolean} changeOnClick If true, it will allow * clicking on any place to change the slide. + * @param {number} minWheelDelta Controls the amount of needed scroll to + * trigger navigation. + * @param {number} scrollWait Controls the amount of time to wait till + * navigation can occur again with scroll. + * @param {number} slideOffset Controls the amount of needed touch delta to + * trigger navigation. */ function WebSlides() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref$autoslide = _ref.autoslide, autoslide = _ref$autoslide === undefined ? false : _ref$autoslide, _ref$changeOnClick = _ref.changeOnClick, - changeOnClick = _ref$changeOnClick === undefined ? false : _ref$changeOnClick; + changeOnClick = _ref$changeOnClick === undefined ? false : _ref$changeOnClick, + _ref$minWheelDelta = _ref.minWheelDelta, + minWheelDelta = _ref$minWheelDelta === undefined ? 40 : _ref$minWheelDelta, + _ref$scrollWait = _ref.scrollWait, + scrollWait = _ref$scrollWait === undefined ? 450 : _ref$scrollWait, + _ref$slideOffset = _ref.slideOffset, + slideOffset = _ref$slideOffset === undefined ? 50 : _ref$slideOffset; _classCallCheck(this, WebSlides); @@ -388,18 +413,16 @@ var WebSlides = function () { */ this.interval_ = null; /** - * Amount of time to wait to go to next slide automatically or false to - * disable the feature. - * @type {boolean|number} - * @private + * Options dictionary. + * @type {Object} */ - this.autoslide_ = autoslide; - /** - * Whether navigation should initiate on click or not. - * @type {boolean} - * @private - */ - this.changeOnClick_ = changeOnClick; + this.options = { + autoslide: autoslide, + changeOnClick: changeOnClick, + minWheelDelta: minWheelDelta, + scrollWait: scrollWait, + slideOffset: slideOffset + }; if (!this.el) { throw new Error('Couldn\'t find the webslides container!'); @@ -494,7 +517,7 @@ var WebSlides = function () { value: function goToSlide(slideI) { var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - if (this.isValidIndexSlide_(slideI) && !this.isMoving) { + if (this.isValidIndexSlide_(slideI) && !this.isMoving && this.currentSlideI_ !== slideI) { this.isMoving = true; var isMovingForward = false; @@ -704,7 +727,7 @@ var WebSlides = function () { * automatically. */ value: function play(time) { - time = time || this.autoslide_; + time = time || this.options.autoslide; if (!this.interval_ && typeof time === 'number' && time > 0) { this.interval_ = setInterval(this.goNext.bind(this), time); @@ -877,7 +900,7 @@ var ClickNav = function () { */ this.ws_ = wsInstance; - if (wsInstance.changeOnClick_) { + if (wsInstance.options.changeOnClick) { this.ws_.el.addEventListener('click', this.onClick_.bind(this)); } } @@ -1109,27 +1132,50 @@ var Keyboard = function () { key: 'onKeyPress_', value: function onKeyPress_(event) { var method = void 0; + var argument = void 0; - if (event.which === __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].SPACE) { - method = this.ws_.goNext; - } else { - if (this.ws_.isVertical) { - if (event.which === __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].DOWN) { - method = this.ws_.goNext; - } else if (event.which === __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].UP) { - method = this.ws_.goPrev; - } - } else { - if (event.which === __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].RIGHT) { - method = this.ws_.goNext; - } else if (event.which === __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].LEFT) { - method = this.ws_.goPrev; - } + // Check if there's a focused element that might use the keyboard. + if (document.activeElement) { + var isContentEditable = document.activeElement.contentEditable !== 'inherit'; + var isInput = ['INPUT', 'SELECT', 'OPTION', 'TEXTAREA'].indexOf(document.activeElement.tagName) > -1; + + if (isInput || isContentEditable) { + return; } } + switch (event.which) { + case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].AV_PAGE: + case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].SPACE: + method = this.ws_.goNext; + break; + case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].RE_PAGE: + method = this.ws_.goPrev; + break; + case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].HOME: + method = this.ws_.goToSlide; + argument = 0; + break; + case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].END: + method = this.ws_.goToSlide; + argument = this.ws_.maxSlide_ - 1; + break; + case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].DOWN: + method = this.ws_.isVertical ? this.ws_.goNext : null; + break; + case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].UP: + method = this.ws_.isVertical ? this.ws_.goPrev : null; + break; + case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].LEFT: + method = !this.ws_.isVertical ? this.ws_.goPrev : null; + break; + case __WEBPACK_IMPORTED_MODULE_0__utils_keys__["a" /* default */].RIGHT: + method = !this.ws_.isVertical ? this.ws_.goNext : null; + break; + } + if (method) { - method.call(this.ws_); + method.call(this.ws_, argument); } } }]); @@ -1333,8 +1379,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons -var MIN_WHEEL_DELTA = 40; - var Scroll = function () { /** * Scroll handler for the WebSlides. @@ -1396,7 +1440,7 @@ var Scroll = function () { this.timeout_ = setTimeout(function () { _this.timeout_ = null; - }, 450); + }, this.ws_.options.scrollWait); } /** @@ -1433,7 +1477,7 @@ var Scroll = function () { } } - if (Math.abs(wheelDeltaY) >= MIN_WHEEL_DELTA || Math.abs(wheelDeltaX) >= MIN_WHEEL_DELTA) { + if (Math.abs(wheelDeltaY) >= this.ws_.options.minWheelDelta || Math.abs(wheelDeltaX) >= this.ws_.options.minWheelDelta) { if (isHorizontalMovement && this.isGoingLeft_ || !isHorizontalMovement && this.isGoingUp_) { this.ws_.goPrev(); } else { @@ -1476,8 +1520,6 @@ var EVENTS = { } }; -var SLIDE_OFFSET = 50; - var Touch = function () { /** * @param {WebSlides} wsInstance The WebSlides instance @@ -1590,9 +1632,9 @@ var Touch = function () { // It's an horizontal drag if (Math.abs(diffX) > Math.abs(diffY)) { - if (diffX < -SLIDE_OFFSET) { + if (diffX < -this.ws_.options.slideOffset) { this.ws_.goPrev(); - } else if (diffX > SLIDE_OFFSET) { + } else if (diffX > this.ws_.options.slideOffset) { this.ws_.goNext(); } } diff --git a/static/js/webslides.min.js b/static/js/webslides.min.js index 46766d3..8d9679d 100644 --- a/static/js/webslides.min.js +++ b/static/js/webslides.min.js @@ -1 +1,9 @@ -!function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/static/js/",t(t.s=16)}([function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=n(13),a=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=document.createElement(e);return i.id=t,n&&(i.textContent=n),i}},{key:"hide",value:function(e){e.style.display="none"}},{key:"show",value:function(e){e.style.display=""}},{key:"fireEvent",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new r.a(t,{detail:n});e.dispatchEvent(i)}},{key:"toArray",value:function(e){return[].slice.call(e)}}]),e}();t.a=o},function(e,t,n){"use strict";var i={ENTER:13,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40};t.a=i},function(e,t,n){"use strict";function i(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;n0&&void 0!==arguments[0]?arguments[0]:{},n=t.autoslide,r=void 0!==n&&n,a=t.changeOnClick,o=void 0!==a&&a;if(i(this,e),this.el=document.getElementById("webslides"),this.isMoving=!1,this.slides=null,this.currentSlideI_=-1,this.currentSlide_=null,this.maxSlide_=0,this.isVertical=this.el.classList.contains(l.VERTICAL),this.plugins={},this.interval_=null,this.autoslide_=r,this.changeOnClick_=o,!this.el)throw new Error("Couldn't find the webslides container!");this.removeChildren_(),this.grabSlides_(),this.createPlugins_(),this.initSlides_(),this.play(),this.onInit_()}return u(e,[{key:"removeChildren_",value:function(){for(var e=this.el.childNodes,t=e.length;t--;){var n=e[t];a.a.isCandidate(n)||this.el.removeChild(n)}}},{key:"createPlugins_",value:function(){var e=this;Object.keys(c).forEach(function(t){var n=c[t];e.plugins[t]=new n(e)})}},{key:"onInit_",value:function(){o.a.fireEvent(this.el,"ws:init")}},{key:"grabSlides_",value:function(){this.slides=o.a.toArray(this.el.childNodes).map(function(e,t){return new a.a(e,t)}),this.maxSlide_=this.slides.length}},{key:"goToSlide",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isValidIndexSlide_(e)&&!this.isMoving){this.isMoving=!0;var n=!1;null!==t?n=t:this.currentSlideI_>=0&&(n=e>this.currentSlideI_);var i=this.slides[e];null===this.currentSlide_||!this.isVertical||this.plugins.touch&&this.plugins.touch.isEnabled?this.transitionToSlide_(n,i,this.onSlideChange_):this.scrollTransitionToSlide_(n,i,this.onSlideChange_)}}},{key:"scrollTransitionToSlide_",value:function(e,t,i){var r=this;this.el.style.overflow="none",e?t.show():(t.moveBeforeFirst(),t.show(),n.i(s.a)(this.currentSlide_.el.offsetTop,0)),n.i(s.a)(t.el.offsetTop,500,function(){r.currentSlide_.hide(),e&&r.currentSlide_.moveAfterLast(),r.el.style.overflow="auto",setTimeout(function(){i.call(r,t)},150)})}},{key:"transitionToSlide_",value:function(e,t,i){n.i(s.a)(0,0),e||t.moveBeforeFirst(),this.currentSlide_&&(e&&this.currentSlide_.moveAfterLast(),this.currentSlide_.hide()),t.show(),i.call(this,t)}},{key:"onSlideChange_",value:function(e){this.currentSlide_=e,this.currentSlideI_=e.i,this.isMoving=!1,o.a.fireEvent(this.el,"ws:slide-change",{slides:this.maxSlide_,currentSlide0:this.currentSlideI_,currentSlide:this.currentSlideI_+1})}},{key:"goNext",value:function(){var e=this.currentSlideI_+1;e>=this.maxSlide_&&(e=0),this.goToSlide(e,!0)}},{key:"goPrev",value:function(){var e=this.currentSlideI_-1;e<0&&(e=this.maxSlide_-1),this.goToSlide(e,!1)}},{key:"isValidIndexSlide_",value:function(e){return e>=0&&e=this.maxSlide_)&&(e=0),0!==e)for(var t=0;t0&&(this.interval_=setInterval(this.goNext.bind(this),e))}},{key:"stop",value:function(){this.interval_&&(clearInterval(this.interval_),this.interval_=null)}}],[{key:"registerPlugin",value:function(e,t){c[e]=t}}]),e}();t.a=h},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=n(0),a=function(){function e(e,t){for(var n=0;nMath.abs(t);if(this.isGoingUp_=t<0,this.isGoingLeft_=n<0,r){if(i)return;e.preventDefault()}(Math.abs(t)>=o||Math.abs(n)>=o)&&(r&&this.isGoingLeft_||!r&&this.isGoingUp_?this.ws_.goPrev():this.ws_.goNext(),e.preventDefault())}}]),e}();t.a=s},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=n(2),a=function(){function e(e,t){for(var n=0;nMath.abs(t)&&(e<-s?this.ws_.goPrev():e>s&&this.ws_.goNext())}}],[{key:"normalizeEventInfo",value:function(e){var t=void 0,n=void 0,i={pageX:0,pageY:0};return"undefined"!=typeof e.changedTouches?i=e.changedTouches[0]:"undefined"!=typeof e.originalEvent&&"undefined"!=typeof e.originalEvent.changedTouches&&(i=e.originalEvent.changedTouches[0]),t=e.offsetX||e.layerX||i.pageX,n=e.offsetY||e.layerY||i.pageY,{x:t,y:n}}}]),e}();t.a=u},function(e,t,n){"use strict";function i(){try{var e=new r("t",{detail:{a:"b"}});return"t"===e.type&&"b"===e.detail.a}catch(e){}return!1}var r=window.CustomEvent,a=function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n},o=i()?r:a;t.a=o},function(e,t,n){"use strict";function i(e){return.5-Math.cos(e*Math.PI)/2}function r(e){return e}t.a={swing:i,linear:r}},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=e-a.scrollTop,o=a.scrollTop,s=16;if(!t)return a.scrollTop=e,void n();var u=function u(l){l+=s;var c=Math.min(1,l/t),h=r.a.swing(c,l*c,e,i,t);a.scrollTop=Math.floor(o+h*i),l1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=document.createElement(e);return i.id=t,n&&(i.textContent=n),i}},{key:"hide",value:function(e){e.style.display="none"}},{key:"show",value:function(e){e.style.display=""}},{key:"fireEvent",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=new r.a(t,{detail:n});e.dispatchEvent(i)}},{key:"toArray",value:function(e){return[].slice.call(e)}}]),e}();t.a=s},function(e,t,n){"use strict";var i={ENTER:13,SPACE:32,RE_PAGE:33,AV_PAGE:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};t.a=i},function(e,t,n){"use strict";function i(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;n0&&void 0!==arguments[0]?arguments[0]:{},n=t.autoslide,r=void 0!==n&&n,a=t.changeOnClick,s=void 0!==a&&a,o=t.minWheelDelta,l=void 0===o?40:o,c=t.scrollWait,h=void 0===c?450:c,d=t.slideOffset,f=void 0===d?50:d;if(i(this,e),this.el=document.getElementById("webslides"),this.isMoving=!1,this.slides=null,this.currentSlideI_=-1,this.currentSlide_=null,this.maxSlide_=0,this.isVertical=this.el.classList.contains(u.VERTICAL),this.plugins={},this.interval_=null,this.options={autoslide:r,changeOnClick:s,minWheelDelta:l,scrollWait:h,slideOffset:f},!this.el)throw new Error("Couldn't find the webslides container!");this.removeChildren_(),this.grabSlides_(),this.createPlugins_(),this.initSlides_(),this.play(),this.onInit_()}return l(e,[{key:"removeChildren_",value:function(){for(var e=this.el.childNodes,t=e.length;t--;){var n=e[t];a.a.isCandidate(n)||this.el.removeChild(n)}}},{key:"createPlugins_",value:function(){var e=this;Object.keys(c).forEach(function(t){var n=c[t];e.plugins[t]=new n(e)})}},{key:"onInit_",value:function(){s.a.fireEvent(this.el,"ws:init")}},{key:"grabSlides_",value:function(){this.slides=s.a.toArray(this.el.childNodes).map(function(e,t){return new a.a(e,t)}),this.maxSlide_=this.slides.length}},{key:"goToSlide",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isValidIndexSlide_(e)&&!this.isMoving&&this.currentSlideI_!==e){this.isMoving=!0;var n=!1;null!==t?n=t:this.currentSlideI_>=0&&(n=e>this.currentSlideI_);var i=this.slides[e];null===this.currentSlide_||!this.isVertical||this.plugins.touch&&this.plugins.touch.isEnabled?this.transitionToSlide_(n,i,this.onSlideChange_):this.scrollTransitionToSlide_(n,i,this.onSlideChange_)}}},{key:"scrollTransitionToSlide_",value:function(e,t,i){var r=this;this.el.style.overflow="none",e?t.show():(t.moveBeforeFirst(),t.show(),n.i(o.a)(this.currentSlide_.el.offsetTop,0)),n.i(o.a)(t.el.offsetTop,500,function(){r.currentSlide_.hide(),e&&r.currentSlide_.moveAfterLast(),r.el.style.overflow="auto",setTimeout(function(){i.call(r,t)},150)})}},{key:"transitionToSlide_",value:function(e,t,i){n.i(o.a)(0,0),e||t.moveBeforeFirst(),this.currentSlide_&&(e&&this.currentSlide_.moveAfterLast(),this.currentSlide_.hide()),t.show(),i.call(this,t)}},{key:"onSlideChange_",value:function(e){this.currentSlide_=e,this.currentSlideI_=e.i,this.isMoving=!1,s.a.fireEvent(this.el,"ws:slide-change",{slides:this.maxSlide_,currentSlide0:this.currentSlideI_,currentSlide:this.currentSlideI_+1})}},{key:"goNext",value:function(){var e=this.currentSlideI_+1;e>=this.maxSlide_&&(e=0),this.goToSlide(e,!0)}},{key:"goPrev",value:function(){var e=this.currentSlideI_-1;e<0&&(e=this.maxSlide_-1),this.goToSlide(e,!1)}},{key:"isValidIndexSlide_",value:function(e){return e>=0&&e=this.maxSlide_)&&(e=0),0!==e)for(var t=0;t0&&(this.interval_=setInterval(this.goNext.bind(this),e))}},{key:"stop",value:function(){this.interval_&&(clearInterval(this.interval_),this.interval_=null)}}],[{key:"registerPlugin",value:function(e,t){c[e]=t}}]),e}();t.a=h},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=n(0),a=function(){function e(e,t){for(var n=0;n-1;if(a||i)return}switch(e.which){case r.a.AV_PAGE:case r.a.SPACE:t=this.ws_.goNext;break;case r.a.RE_PAGE:t=this.ws_.goPrev;break;case r.a.HOME:t=this.ws_.goToSlide,n=0;break;case r.a.END:t=this.ws_.goToSlide,n=this.ws_.maxSlide_-1;break;case r.a.DOWN:t=this.ws_.isVertical?this.ws_.goNext:null;break;case r.a.UP:t=this.ws_.isVertical?this.ws_.goPrev:null;break;case r.a.LEFT:t=this.ws_.isVertical?null:this.ws_.goPrev;break;case r.a.RIGHT:t=this.ws_.isVertical?null:this.ws_.goNext}t&&t.call(this.ws_,n)}}]),e}();t.a=s},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=n(0),a=function(){function e(e,t){for(var n=0;nMath.abs(t);if(this.isGoingUp_=t<0,this.isGoingLeft_=n<0,r){if(i)return;e.preventDefault()}(Math.abs(t)>=this.ws_.options.minWheelDelta||Math.abs(n)>=this.ws_.options.minWheelDelta)&&(r&&this.isGoingLeft_||!r&&this.isGoingUp_?this.ws_.goPrev():this.ws_.goNext(),e.preventDefault())}}]),e}();t.a=s},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=n(2),a=function(){function e(e,t){for(var n=0;nMath.abs(t)&&(e<-this.ws_.options.slideOffset?this.ws_.goPrev():e>this.ws_.options.slideOffset&&this.ws_.goNext())}}],[{key:"normalizeEventInfo",value:function(e){var t=void 0,n=void 0,i={pageX:0,pageY:0};return"undefined"!=typeof e.changedTouches?i=e.changedTouches[0]:"undefined"!=typeof e.originalEvent&&"undefined"!=typeof e.originalEvent.changedTouches&&(i=e.originalEvent.changedTouches[0]),t=e.offsetX||e.layerX||i.pageX,n=e.offsetY||e.layerY||i.pageY,{x:t,y:n}}}]),e}();t.a=o},function(e,t,n){"use strict";function i(){try{var e=new r("t",{detail:{a:"b"}});return"t"===e.type&&"b"===e.detail.a}catch(e){}return!1}var r=window.CustomEvent,a=function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n},s=i()?r:a;t.a=s},function(e,t,n){"use strict";function i(e){return.5-Math.cos(e*Math.PI)/2}function r(e){return e}t.a={swing:i,linear:r}},function(e,t,n){"use strict";function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},i=e-a.scrollTop,s=a.scrollTop,o=16;if(!t)return a.scrollTop=e,void n();var l=function l(u){u+=o;var c=Math.min(1,u/t),h=r.a.swing(c,u*c,e,i,t);a.scrollTop=Math.floor(s+h*i),u