vueperslides
Advanced tools
Comparing version 1.9.3 to 1.9.4
@@ -371,4 +371,2 @@ (function (global, factory) { | ||
bindEvents: function bindEvents() { | ||
var _this2 = this; | ||
var hasTouch = 'ontouchstart' in window; | ||
@@ -397,5 +395,3 @@ | ||
// First render the onload translation. | ||
setTimeout(function () { | ||
_this2.onResize();_this2.onScroll(); | ||
}, 100); | ||
this.refreshParallax(); | ||
@@ -426,3 +422,3 @@ // then add event listener. | ||
}, | ||
onScroll: function onScroll(e) { | ||
onScroll: function onScroll() { | ||
var doc = document.documentElement; | ||
@@ -597,6 +593,6 @@ var scrollTop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0); | ||
setTimer: function setTimer() { | ||
var _this3 = this; | ||
var _this2 = this; | ||
this.timer = setTimeout(function () { | ||
_this3.goToSlide(_this3.slides.current + 1, { autoPlaying: true }); | ||
_this2.goToSlide(_this2.slides.current + 1, { autoPlaying: true }); | ||
}, this.conf.speed); | ||
@@ -610,2 +606,10 @@ }, | ||
}, | ||
refreshParallax: function refreshParallax() { | ||
var _this3 = this; | ||
setTimeout(function () { | ||
_this3.onResize(); | ||
_this3.onScroll(); | ||
}, 100); | ||
}, | ||
getSlideInRange: function getSlideInRange(index) { | ||
@@ -612,0 +616,0 @@ var clone = null; |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.VueperSlides=e.VueperSlides||{})}(this,function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])}return e};!function(){if("undefined"!=typeof document){var e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",t.styleSheet?t.styleSheet.cssText="":t.appendChild(document.createTextNode("")),e.appendChild(t)}}();var s={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{class:{vueperslides__slide:!0,"vueperslides__slide--active":e.$parent.slides.activeUid===e._uid},style:e.styles,attrs:{"aria-hidden":e.$parent.slides.activeUid===e._uid?"false":"true"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:!e.$parent.conf.slideContentOutside&&(e.title||e.hasTitleSlotData||e.content||e.hasContentSlotData),expression:"!$parent.conf.slideContentOutside && (title || hasTitleSlotData || content || hasContentSlotData)"}],staticClass:"vueperslides__slide-content"},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.title||e.hasTitleSlotData,expression:"title || hasTitleSlotData"}],staticClass:"slide-title"},[s("div",{directives:[{name:"show",rawName:"v-show",value:!e.$parent.conf.slideContentOutside&&!e.title,expression:"!$parent.conf.slideContentOutside && !title"}]},[e._t("slideTitle")],2),e.title?s("div",{domProps:{innerHTML:e._s(e.title)}}):e._e()]),e.content||e.hasContentSlotData?s("div",{staticClass:"slide-content"},[s("div",{directives:[{name:"show",rawName:"v-show",value:!e.$parent.conf.slideContentOutside&&!e.content,expression:"!$parent.conf.slideContentOutside && !content"}]},[e._t("slideContent")],2),e.content?s("div",{domProps:{innerHTML:e._s(e.content)}}):e._e()]):e._e()])])},staticRenderFns:[],props:{clone:{type:Number,default:null},image:{type:String,default:""},title:{type:String,default:""},content:{type:String,default:""}},created:function(){this.$parent.addSlide(this)},destroyed:function(){null===this.clone&&this.$parent.removeSlide(this._uid)},computed:{styles:function(){return t({},this.image&&{backgroundImage:"url("+this.image+")"})},hasTitleSlotData:function(){return void 0!==this.$slots.slideTitle},hasContentSlotData:function(){return void 0!==this.$slots.slideContent}}},i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])}return e};function n(e){if(Array.isArray(e)){for(var t=0,s=Array(e.length);t<e.length;t++)s[t]=e[t];return s}return Array.from(e)}!function(){if("undefined"!=typeof document){var e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style"),s=".vueperslides { position: relative; } .vueperslides__inner { position: relative; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .vueperslides__parallax-wrapper { position: relative; overflow: hidden; } .vueperslides__track-wrapper { position: absolute; top: 0; height: 100%; left: 0; right: 0; overflow: hidden; z-index: 1; } .vueperslides--parallax .vueperslides__track-wrapper { height: 200%; -webkit-transform: translateY(0); -ms-transform: translateY(0); transform: translateY(0); } .vueperslides--fade .vueperslides__track { white-space: normal; -webkit-transition: none; -o-transition: none; transition: none; } .vueperslides--touchable .vueperslides__track { cursor: ew-resize; cursor: -webkit-grab; cursor: grab; } .vueperslides--touchable .vueperslides__track--mousedown, .vueperslides--touchable .vueperslides__track--dragging { cursor: -webkit-grabbing; cursor: grabbing; } .vueperslides__track { white-space: nowrap; -webkit-transition: 0.5s ease-in-out transform; -o-transition: 0.5s ease-in-out transform; transition: 0.5s ease-in-out transform; height: 100%; } .vueperslides__track--mousedown { -webkit-transition: 0.2s ease-in-out transform !important; -o-transition: 0.2s ease-in-out transform !important; transition: 0.2s ease-in-out transform !important; } .vueperslides__track--dragging { -webkit-transition: none; -o-transition: none; transition: none; } .vueperslides__track--no-animation { -webkit-transition-duration: 0s; -o-transition-duration: 0s; transition-duration: 0s; } .vueperslides__slide { white-space: normal; background-size: cover; display: inline-block; width: 100%; height: 100%; position: relative; } .vueperslides__slide .vueperslides__slide-content { position: absolute; } .vueperslides--fade .vueperslides__slide { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0; -webkit-transition: .8s ease-in-out opacity; -o-transition: .8s ease-in-out opacity; transition: .8s ease-in-out opacity; } .vueperslides--fade .vueperslides__slide--active { z-index: 1; opacity: 1; } .vueperslides__arrow { position: absolute; fill: currentColor; width: 1em; text-align: center; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%); -webkit-transition: 0.3s ease-in-out; -o-transition: 0.3s ease-in-out; transition: 0.3s ease-in-out; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; outline: none; z-index: 2; } .vueperslides__paused { position: absolute; -webkit-transition: 0.3s ease-in-out; -o-transition: 0.3s ease-in-out; transition: 0.3s ease-in-out; } .vueperslides__bullets { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; position: absolute; bottom: 0; left: 0; right: 0; } .vueperslides__bullets--outside { position: relative; } .vueperslides__bullet { cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; outline: none; z-index: 2; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } .vueperslides__bullet::-moz-focus-inner { border: 0; } ";t.type="text/css",t.styleSheet?t.styleSheet.cssText=s:t.appendChild(document.createTextNode(s)),e.appendChild(t)}}();var o={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"vueperslides",staticClass:"vueperslides",class:{"vueperslides--ready":e.isReady,"vueperslides--fade":e.conf.fade,"vueperslides--parallax":e.conf.parallax,"vueperslides--touchable":e.touch.enabled&&!e.disable,"vueperslides--animated":e.transition.animated},attrs:{"aria-label":"Slideshow"}},["top"===e.conf.slideContentOutside?s("div",{staticClass:"vueperslides__slide-content vueperslides__slide-content--outside-top",class:e.conf.slideContentOutsideClass},[e.slides.count?s("div",{staticClass:"slide-title",domProps:{innerHTML:e._s(e.getCurrentSlideData("title"))}}):e._e(),e.slides.count?s("div",{staticClass:"slide-content",domProps:{innerHTML:e._s(e.getCurrentSlideData("content"))}}):e._e()]):e._e(),s("div",{staticClass:"vueperslides__inner"},[s("div",{staticClass:"vueperslides__parallax-wrapper",style:"padding-bottom:"+100*e.conf.slideRatio+"%",attrs:{"aria-live":"polite"}},[s("div",{staticClass:"vueperslides__track-wrapper",style:e.trackWrapperStyles},[s("div",{ref:"track",staticClass:"vueperslides__track",class:{"vueperslides__track--dragging":e.touch.dragging,"vueperslides__track--mousedown":e.mouseDown},style:e.trackStyles},[e.slides.count&&e.clones[0]?s("vueper-slide",{staticClass:"vueperslides__slide--clone",style:e.clones[0].style,attrs:{clone:0,title:e.clones[0].title,content:e.clones[0].content,image:e.clones[0].image,"aria-hidden":"true"}},[e.clones[0].titleSlot?s("div",{attrs:{slot:"slideTitle"},domProps:{innerHTML:e._s(e.clones[0].titleSlot)},slot:"slideTitle"}):e._e(),e.clones[0].contentSlot?s("div",{attrs:{slot:"slideContent"},domProps:{innerHTML:e._s(e.clones[0].contentSlot)},slot:"slideContent"}):e._e()]):e._e(),e._t("default",null,{currentSlide:e.slides.current}),e.slides.count&&e.clones[1]?s("vueper-slide",{staticClass:"vueperslides__slide--clone",style:e.clones[1].style,attrs:{clone:1,title:e.clones[1].title,content:e.clones[1].content,image:e.clones[1].image,"aria-hidden":"true"}},[e.clones[1].titleSlot?s("div",{attrs:{slot:"slideTitle"},domProps:{innerHTML:e._s(e.clones[1].titleSlot)},slot:"slideTitle"}):e._e(),e.clones[1].contentSlot?s("div",{attrs:{slot:"slideContent"},domProps:{innerHTML:e._s(e.clones[1].contentSlot)},slot:"slideContent"}):e._e()]):e._e()],2)])]),e.$slots.pausedIcon?s("div",{staticClass:"vueperslides__paused"},[e._t("pausedIcon")],2):e._e(),e.conf.arrows&&e.slides.count>1&&!e.disable?s("div",{staticClass:"vueperslides__arrows",class:{"vueperslides__arrows--outside":e.conf.arrowsOutside}},[s("button",{directives:[{name:"show",rawName:"v-show",value:!e.arrowPrevDisabled,expression:"!arrowPrevDisabled"}],staticClass:"vueperslides__arrow vueperslides__arrow--prev",attrs:{"aria-label":"Previous"},on:{click:function(t){e.previous()}}},[e._t("arrowLeft",[s("svg",{attrs:{viewBox:"0 0 24 24"}},[s("path",{attrs:{d:"M16.2,21c0.3,0,0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L9.6,12L17,4.7c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1-0.4-1.4,0L6.8,12l8.8,8.7C15.7,20.9,16,21,16.2,21z"}})])])],2),s("button",{directives:[{name:"show",rawName:"v-show",value:!e.arrowNextDisabled,expression:"!arrowNextDisabled"}],staticClass:"vueperslides__arrow vueperslides__arrow--next",attrs:{"aria-label":"Next"},on:{click:function(t){e.next()}}},[e._t("arrowRight",[s("svg",{attrs:{viewBox:"0 0 24 24"}},[s("path",{attrs:{d:"M7.8,21c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l7.4-7.3L7,4.7c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l8.8,8.7l-8.8,8.7C8.3,20.9,8,21,7.8,21z"}})])])],2)]):e._e(),e.conf.bullets&&e.slides.count>1&&!e.disable&&!e.conf.bulletsOutside?s("div",{staticClass:"vueperslides__bullets",attrs:{role:"tablist","aria-label":"Slideshow navigation"}},e._l(e.slides.list,function(t,i){return s("button",{key:i,ref:"bullet",refInFor:!0,staticClass:"vueperslides__bullet",class:{"vueperslides__bullet--active":e.slides.current===i},on:{click:function(t){e.goToSlide(i)},keyup:[function(t){return"button"in t||!e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])?"button"in t&&0!==t.button?null:void e.previous():null},function(t){return"button"in t||!e._k(t.keyCode,"right",39,t.key,["Right","ArrowRight"])?"button"in t&&2!==t.button?null:void e.next():null}]}},[s("span",[e._v(e._s(i+1))])])})):e._e()]),e.conf.bullets&&e.slides.count>1&&!e.disable&&e.conf.bulletsOutside?s("div",{staticClass:"vueperslides__bullets vueperslides__bullets--outside"},e._l(e.slides.list,function(t,i){return s("button",{key:i,ref:"bullet",refInFor:!0,staticClass:"vueperslides__bullet",class:{"vueperslides__bullet--active":e.slides.current===i},on:{click:function(t){e.goToSlide(i)},keyup:[function(t){return"button"in t||!e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])?"button"in t&&0!==t.button?null:void e.previous():null},function(t){return"button"in t||!e._k(t.keyCode,"right",39,t.key,["Right","ArrowRight"])?"button"in t&&2!==t.button?null:void e.next():null}]}},[s("span",[e._v(e._s(i+1))])])})):e._e(),"bottom"===e.conf.slideContentOutside?s("div",{staticClass:"vueperslides__slide-content vueperslides__slide-content--outside-bottom",class:e.conf.slideContentOutsideClass},[e.slides.count?s("div",{staticClass:"slide-title",domProps:{innerHTML:e._s(e.getCurrentSlideData("title"))}}):e._e(),e.slides.count?s("div",{staticClass:"slide-content",domProps:{innerHTML:e._s(e.getCurrentSlideData("content"))}}):e._e()]):e._e()])},staticRenderFns:[],name:"vueper-slides",components:{VueperSlide:s},props:{initSlide:{type:Number,default:1},slideRatio:{type:Number,default:1/3},arrows:{type:Boolean,default:!0},arrowsOutside:{type:Boolean,default:!1},disableArrowsOnEdges:{type:[Boolean,String],default:!1},bullets:{type:Boolean,default:!0},bulletsOutside:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},slideContentOutside:{type:[Boolean,String],default:!1},slideContentOutsideClass:{type:String,default:""},autoplay:{type:Boolean,default:!1},speed:{type:[Number,String],default:4e3},transitionSpeed:{type:[Number,String],default:600},pauseOnHover:{type:Boolean,default:!0},infinite:{type:Boolean,default:!0},refreshClonesOnDrag:{type:Boolean,default:!1},parallax:{type:[Boolean,Number],default:!1},touchable:{type:Boolean,default:!0},draggingDistance:{type:Number,default:null},disable:{type:Boolean,default:!1},breakpoints:{type:Object,default:function(){return{}}}},data:function(){return{isReady:!1,container:null,slides:{list:[],count:0,activeUid:null,current:0,clones:[]},clones:[],mouseDown:!1,mouseOver:!1,touch:{enabled:!0,dragging:!1,dragStartX:0,dragAmount:0,goNext:!0},transition:{currentTranslation:0,speed:0,animated:!1},timer:null,arrowPrevDisabled:!1,arrowNextDisabled:!1,breakpointsData:{list:[],current:null},parallaxData:{translation:0,slideshowOffsetTop:null,isVisible:!1}}},mounted:function(){this.init()},methods:{init:function(){var e=this;this.emit("before-init",!1),this.container=this.$refs.vueperslides,this.touch.enabled=this.conf.touchable,this.transition.speed=this.conf.transitionSpeed,Object.keys(this.breakpoints).length&&(this.setBreakpointsList(),this.setBreakpointConfig(this.getCurrentBreakpoint())),this.conf.infinite&&(this.cloneSlides(),this.$nextTick(function(){return e.cloneSlides()})),this.goToSlide(this.conf.initSlide-1),this.bindEvents(),this.isReady=!0,this.emit("ready")},emit:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[e];if((t||"number"==typeof s)&&(i[1]={},t&&this.slides.activeUid&&(i[1].currentSlide=this.getSlideData(this.slides.current)),"number"==typeof s)){var n=this.getSlideInRange(s).nextSlide;i[1].nextSlide=this.getSlideData(n)}this.$emit.apply(this,[e].concat(i))},getSlideData:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=this.slides.list[e],i=s.$slots,n=i.slideTitle,o=void 0===n?[{}]:n,l=i.slideContent,r=void 0===l?[{}]:l,a=o[0].elm,d=void 0===a?{}:a,u=r[0].elm,c=void 0===u?{}:u,h={index:e,title:s.title,titleSlot:d&&d.innerHTML||null,content:s.content,contentSlot:c&&c.innerHTML||null,image:s.image};if(t){var p=s.$el.attributes,f=(p=void 0===p?{}:p).style,v=(f=void 0===f?{}:f).value,g=void 0===v?"":v;h.style=g}return h},getCurrentSlideData:function(e){var t=this.getSlideData(this.slides.current),s=t.titleSlot,i=t.title,n=t.contentSlot,o=t.content;return"title"===e?i||s:o||n},setBreakpointsList:function(){this.breakpointsData.list=[99999].concat(n(Object.keys(this.breakpoints))).sort(function(e,t){return parseInt(e)<parseInt(t)})},getCurrentBreakpoint:function(){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=[e].concat(n(this.breakpointsData.list)).sort(function(e,t){return parseInt(e)<parseInt(t)});return this.breakpointsData.list[t.indexOf(e)-1]},hasBreakpointChanged:function(e){return this.breakpointsData.current!==e},setBreakpointConfig:function(e){this.breakpointsData.current=e},cloneSlides:function(){this.clones[0]=this.getSlideData(this.slides.count-1,!0),this.clones[1]=this.getSlideData(0,!0)},bindEvents:function(){var e=this,t="ontouchstart"in window;this.touch.enabled&&(this.$refs.track.addEventListener(t?"touchstart":"mousedown",this.onMouseDown),document.addEventListener(t?"touchmove":"mousemove",this.onMouseMove),document.addEventListener(t?"touchend":"mouseup",this.onMouseUp)),this.conf.pauseOnHover&&!t&&this.conf.autoplay&&(this.container.addEventListener("mouseover",this.onMouseIn),this.container.addEventListener("mouseout",this.onMouseOut)),(this.breakpointsData.list.length||this.conf.parallax)&&window.addEventListener("resize",this.onResize),this.conf.parallax&&(setTimeout(function(){e.onResize(),e.onScroll()},100),document.addEventListener("scroll",this.onScroll))},getSlideshowOffsetTop:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null===this.parallaxData.slideshowOffsetTop||e){for(var t=this.container,s=t.offsetTop;t=t.offsetParent;)s+=t.offsetTop;this.parallaxData.slideshowOffsetTop=s}return this.parallaxData.slideshowOffsetTop},onScroll:function(e){var t=document.documentElement,s=(window.pageYOffset||t.scrollTop)-(t.clientTop||0),i=window.innerHeight||t.clientHeight||document.body.clientHeight,n=this.container.clientHeight,o=this.getSlideshowOffsetTop(),l=o+n-s,r=i+s-o;if(this.parallaxData.isVisible=l>0&&r>0,this.parallaxData.isVisible){var a=100*l/(i+n),d=-1===this.conf.parallax?100-a:a;this.parallaxData.translation=-d/2}},onResize:function(){if(this.breakpointsData.list.length){var e=this.getCurrentBreakpoint();this.hasBreakpointChanged(e)&&this.setBreakpointConfig(e)}this.conf.parallax&&this.getSlideshowOffsetTop(!0)},onMouseIn:function(){this.mouseOver=!0,this.conf.pauseOnHover&&this.conf.autoplay&&this.clearTimer()},onMouseOut:function(){this.mouseOver=!1,this.conf.pauseOnHover&&this.conf.autoplay&&this.setTimer()},onMouseDown:function(e){if(this.touch.enabled&&!this.disable)if(e.touches||e.preventDefault(),this.conf.infinite&&this.cloneSlides(),this.mouseDown=!0,this.draggingDistance)this.touch.dragStartX="ontouchstart"in window?e.touches[0].clientX:e.clientX;else{var t=this.getDragPercentage(e);this.touch.goNext=t>=.5,this.transition.currentTranslation=-100*(this.slides.current+(this.touch.goNext?1:0)+(this.clones.length?1:0)-t)}},onMouseMove:function(e){if(this.mouseDown||this.touch.dragging)if(this.mouseDown=!1,this.touch.dragging=!0,this.conf.refreshClonesOnDrag&&this.conf.infinite&&this.cloneSlides(),this.draggingDistance){this.touch.dragAmount=this.getDragAmount(e);var t=this.touch.dragAmount/this.container.clientWidth;this.transition.currentTranslation=-100*(this.slides.current+(this.clones.length?1:0)-t)}else{var s=this.getDragPercentage(e);this.transition.currentTranslation=-100*(this.slides.current+(this.touch.goNext?1:0)+(this.clones.length?1:0)-s)}},onMouseUp:function(e){if(this.mouseDown||this.touch.dragging){this.mouseDown=!1,this.touch.dragging=!1;var t=void 0;if(this.draggingDistance){var s=this.touch.dragAmount;this.container.clientWidth;t=this.slides.current,Math.abs(s)>=this.draggingDistance&&(t+=s>0?-1:1)}else t=-(Math.round(this.transition.currentTranslation/100)+(this.clones.length?1:0));var i=this.getSlideInRange(t).nextSlide;this.arrowNextDisabled&&this.conf.autoplay&&0===i&&(i=this.slides.count-1),i!==this.slides.current?this.goToSlide(t):this.transition.currentTranslation=100*-(this.slides.current+(this.clones.length?1:0)),this.touch.dragStartX=null,this.touch.dragAmount=null,this.enableScroll()}},getDragPercentage:function(e){return(("ontouchstart"in window?e.touches[0].clientX:e.clientX)-this.container.offsetLeft)/this.container.clientWidth},getDragAmount:function(e){return("ontouchstart"in window?e.touches[0].clientX:e.clientX)-this.touch.dragStartX},disableScroll:function(){document.ontouchmove=function(e){e.preventDefault()}},enableScroll:function(){document.ontouchmove=function(){return!0}},clearTimer:function(){clearTimeout(this.timer),this.timer=0},setTimer:function(){var e=this;this.timer=setTimeout(function(){e.goToSlide(e.slides.current+1,{autoPlaying:!0})},this.conf.speed)},previous:function(){this.goToSlide(this.slides.current-1)},next:function(){this.goToSlide(this.slides.current+1)},getSlideInRange:function(e){var t=null;return this.clones.length?e<0?(e=this.slides.count-1,t=0):e>this.slides.count-1&&(e=0,t=1):e<0?e=this.conf.disableArrowsOnEdges?0:this.slides.count-1:e>this.slides.count-1&&(e=this.conf.disableArrowsOnEdges?this.conf.autoplay?0:this.slides.count-1:0),{nextSlide:e,clone:t}},goToSlide:function(e){var t=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.slides.count&&!this.disable){this.conf.autoplay&&this.clearTimer();var i=s.animation,n=void 0===i||i,o=s.autoPlaying,l=void 0!==o&&o,r=s.jumping,a=void 0!==r&&r;this.transition.animated=n,setTimeout(function(){return t.transition.animated=!1},this.transitionSpeed);var d=this.getSlideInRange(e),u=d.nextSlide,c=d.clone;this.isReady&&!a&&(this.emit("before-slide",!0,u),null!==c&&this.cloneSlides()),this.conf.arrows&&this.conf.disableArrowsOnEdges&&(this.arrowPrevDisabled=0===u,this.arrowNextDisabled=u===this.slides.count-1),null!==c&&setTimeout(function(){var s=-1===e&&t.slides.current!==t.slides.count-1,i=e===t.slides.count&&0!==t.slides.current;s||i||(t.transition.speed=0,t.goToSlide(c?0:t.slides.count-1,{animation:!1,jumping:!0}),setTimeout(function(){return t.transition.speed=t.conf.transitionSpeed},10))},this.transition.speed-50),this.slides.current=u,this.conf.fade||(this.transition.currentTranslation=null!==c?-100*(c?this.slides.count+1:0):-100*(this.slides.current+(this.clones.length?1:0))),this.slides.activeUid=this.slides.list[this.slides.current]._uid,this.conf.autoplay&&!this.mouseOver&&this.setTimer(),this.slides.count&&(this.$slots.default[this.slides.current]&&this.isReady&&!a&&this.emit("slide"),this.isReady&&!l&&!a&&this.$refs.bullet[this.slides.current]&&this.$refs.bullet[this.slides.current].focus())}},addSlide:function(e){var t=this,s=this.conf.infinite&&this.isReady&&null===e.clone;null!==e.clone?this.clones[e.clone]=e:(this.slides.list.push(e),this.slides.count=this.slides.list.length),this.slides.count>1&&this.touchable&&(this.touch.enabled=!0),s&&this.$nextTick(function(){return t.cloneSlides()})},removeSlide:function(e){var t=this,s=!1;this.slides.list.some(function(i,n){if(i._uid===e)return t.slides.list.splice(n,1),t.slides.count=t.slides.list.length,e===t.slides.activeUid&&(t.slides.activeUid=null,t.goToSlide(n-1,{autoPlaying:!0})),t.slides.count<=1&&(t.touch.enabled=!1),t.clones.length&&t.isReady&&!i.clone&&(s=!0),!0}),this.slides.count&&s&&this.cloneSlides()}},computed:{conf:function(){var e=i({},this.$props,this.$props.breakpoints&&this.$props.breakpoints[this.breakpointsData.current]||{});return e.fade&&(e.infinite=!1),e},trackStyles:function(){var e={};return e.transitionDuration=this.transition.speed+"ms",this.conf.fade||(e.transform="translateX("+this.transition.currentTranslation+"%)"),e},trackWrapperStyles:function(){var e={};return this.conf.parallax&&(e.transform="translateY("+this.parallaxData.translation+"%)",e.willChange=this.parallaxData.isVisible?"transform":"auto"),e}}};"undefined"!=typeof window&&window.Vue&&(window.Vue.component("vueper-slides",o),window.Vue.component("vueper-slide",s)),e.VueperSlides=o,e.VueperSlide=s,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.VueperSlides=e.VueperSlides||{})}(this,function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])}return e};!function(){if("undefined"!=typeof document){var e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",t.styleSheet?t.styleSheet.cssText="":t.appendChild(document.createTextNode("")),e.appendChild(t)}}();var s={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{class:{vueperslides__slide:!0,"vueperslides__slide--active":e.$parent.slides.activeUid===e._uid},style:e.styles,attrs:{"aria-hidden":e.$parent.slides.activeUid===e._uid?"false":"true"}},[s("div",{directives:[{name:"show",rawName:"v-show",value:!e.$parent.conf.slideContentOutside&&(e.title||e.hasTitleSlotData||e.content||e.hasContentSlotData),expression:"!$parent.conf.slideContentOutside && (title || hasTitleSlotData || content || hasContentSlotData)"}],staticClass:"vueperslides__slide-content"},[s("div",{directives:[{name:"show",rawName:"v-show",value:e.title||e.hasTitleSlotData,expression:"title || hasTitleSlotData"}],staticClass:"slide-title"},[s("div",{directives:[{name:"show",rawName:"v-show",value:!e.$parent.conf.slideContentOutside&&!e.title,expression:"!$parent.conf.slideContentOutside && !title"}]},[e._t("slideTitle")],2),e.title?s("div",{domProps:{innerHTML:e._s(e.title)}}):e._e()]),e.content||e.hasContentSlotData?s("div",{staticClass:"slide-content"},[s("div",{directives:[{name:"show",rawName:"v-show",value:!e.$parent.conf.slideContentOutside&&!e.content,expression:"!$parent.conf.slideContentOutside && !content"}]},[e._t("slideContent")],2),e.content?s("div",{domProps:{innerHTML:e._s(e.content)}}):e._e()]):e._e()])])},staticRenderFns:[],props:{clone:{type:Number,default:null},image:{type:String,default:""},title:{type:String,default:""},content:{type:String,default:""}},created:function(){this.$parent.addSlide(this)},destroyed:function(){null===this.clone&&this.$parent.removeSlide(this._uid)},computed:{styles:function(){return t({},this.image&&{backgroundImage:"url("+this.image+")"})},hasTitleSlotData:function(){return void 0!==this.$slots.slideTitle},hasContentSlotData:function(){return void 0!==this.$slots.slideContent}}},i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])}return e};function n(e){if(Array.isArray(e)){for(var t=0,s=Array(e.length);t<e.length;t++)s[t]=e[t];return s}return Array.from(e)}!function(){if("undefined"!=typeof document){var e=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style"),s=".vueperslides { position: relative; } .vueperslides__inner { position: relative; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .vueperslides__parallax-wrapper { position: relative; overflow: hidden; } .vueperslides__track-wrapper { position: absolute; top: 0; height: 100%; left: 0; right: 0; overflow: hidden; z-index: 1; } .vueperslides--parallax .vueperslides__track-wrapper { height: 200%; -webkit-transform: translateY(0); -ms-transform: translateY(0); transform: translateY(0); } .vueperslides--fade .vueperslides__track { white-space: normal; -webkit-transition: none; -o-transition: none; transition: none; } .vueperslides--touchable .vueperslides__track { cursor: ew-resize; cursor: -webkit-grab; cursor: grab; } .vueperslides--touchable .vueperslides__track--mousedown, .vueperslides--touchable .vueperslides__track--dragging { cursor: -webkit-grabbing; cursor: grabbing; } .vueperslides__track { white-space: nowrap; -webkit-transition: 0.5s ease-in-out transform; -o-transition: 0.5s ease-in-out transform; transition: 0.5s ease-in-out transform; height: 100%; } .vueperslides__track--mousedown { -webkit-transition: 0.2s ease-in-out transform !important; -o-transition: 0.2s ease-in-out transform !important; transition: 0.2s ease-in-out transform !important; } .vueperslides__track--dragging { -webkit-transition: none; -o-transition: none; transition: none; } .vueperslides__track--no-animation { -webkit-transition-duration: 0s; -o-transition-duration: 0s; transition-duration: 0s; } .vueperslides__slide { white-space: normal; background-size: cover; display: inline-block; width: 100%; height: 100%; position: relative; } .vueperslides__slide .vueperslides__slide-content { position: absolute; } .vueperslides--fade .vueperslides__slide { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0; -webkit-transition: .8s ease-in-out opacity; -o-transition: .8s ease-in-out opacity; transition: .8s ease-in-out opacity; } .vueperslides--fade .vueperslides__slide--active { z-index: 1; opacity: 1; } .vueperslides__arrow { position: absolute; fill: currentColor; width: 1em; text-align: center; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%); -webkit-transition: 0.3s ease-in-out; -o-transition: 0.3s ease-in-out; transition: 0.3s ease-in-out; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; outline: none; z-index: 2; } .vueperslides__paused { position: absolute; -webkit-transition: 0.3s ease-in-out; -o-transition: 0.3s ease-in-out; transition: 0.3s ease-in-out; } .vueperslides__bullets { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; position: absolute; bottom: 0; left: 0; right: 0; } .vueperslides__bullets--outside { position: relative; } .vueperslides__bullet { cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; outline: none; z-index: 2; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; } .vueperslides__bullet::-moz-focus-inner { border: 0; } ";t.type="text/css",t.styleSheet?t.styleSheet.cssText=s:t.appendChild(document.createTextNode(s)),e.appendChild(t)}}();var o={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{ref:"vueperslides",staticClass:"vueperslides",class:{"vueperslides--ready":e.isReady,"vueperslides--fade":e.conf.fade,"vueperslides--parallax":e.conf.parallax,"vueperslides--touchable":e.touch.enabled&&!e.disable,"vueperslides--animated":e.transition.animated},attrs:{"aria-label":"Slideshow"}},["top"===e.conf.slideContentOutside?s("div",{staticClass:"vueperslides__slide-content vueperslides__slide-content--outside-top",class:e.conf.slideContentOutsideClass},[e.slides.count?s("div",{staticClass:"slide-title",domProps:{innerHTML:e._s(e.getCurrentSlideData("title"))}}):e._e(),e.slides.count?s("div",{staticClass:"slide-content",domProps:{innerHTML:e._s(e.getCurrentSlideData("content"))}}):e._e()]):e._e(),s("div",{staticClass:"vueperslides__inner"},[s("div",{staticClass:"vueperslides__parallax-wrapper",style:"padding-bottom:"+100*e.conf.slideRatio+"%",attrs:{"aria-live":"polite"}},[s("div",{staticClass:"vueperslides__track-wrapper",style:e.trackWrapperStyles},[s("div",{ref:"track",staticClass:"vueperslides__track",class:{"vueperslides__track--dragging":e.touch.dragging,"vueperslides__track--mousedown":e.mouseDown},style:e.trackStyles},[e.slides.count&&e.clones[0]?s("vueper-slide",{staticClass:"vueperslides__slide--clone",style:e.clones[0].style,attrs:{clone:0,title:e.clones[0].title,content:e.clones[0].content,image:e.clones[0].image,"aria-hidden":"true"}},[e.clones[0].titleSlot?s("div",{attrs:{slot:"slideTitle"},domProps:{innerHTML:e._s(e.clones[0].titleSlot)},slot:"slideTitle"}):e._e(),e.clones[0].contentSlot?s("div",{attrs:{slot:"slideContent"},domProps:{innerHTML:e._s(e.clones[0].contentSlot)},slot:"slideContent"}):e._e()]):e._e(),e._t("default",null,{currentSlide:e.slides.current}),e.slides.count&&e.clones[1]?s("vueper-slide",{staticClass:"vueperslides__slide--clone",style:e.clones[1].style,attrs:{clone:1,title:e.clones[1].title,content:e.clones[1].content,image:e.clones[1].image,"aria-hidden":"true"}},[e.clones[1].titleSlot?s("div",{attrs:{slot:"slideTitle"},domProps:{innerHTML:e._s(e.clones[1].titleSlot)},slot:"slideTitle"}):e._e(),e.clones[1].contentSlot?s("div",{attrs:{slot:"slideContent"},domProps:{innerHTML:e._s(e.clones[1].contentSlot)},slot:"slideContent"}):e._e()]):e._e()],2)])]),e.$slots.pausedIcon?s("div",{staticClass:"vueperslides__paused"},[e._t("pausedIcon")],2):e._e(),e.conf.arrows&&e.slides.count>1&&!e.disable?s("div",{staticClass:"vueperslides__arrows",class:{"vueperslides__arrows--outside":e.conf.arrowsOutside}},[s("button",{directives:[{name:"show",rawName:"v-show",value:!e.arrowPrevDisabled,expression:"!arrowPrevDisabled"}],staticClass:"vueperslides__arrow vueperslides__arrow--prev",attrs:{"aria-label":"Previous"},on:{click:function(t){e.previous()}}},[e._t("arrowLeft",[s("svg",{attrs:{viewBox:"0 0 24 24"}},[s("path",{attrs:{d:"M16.2,21c0.3,0,0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L9.6,12L17,4.7c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1-0.4-1.4,0L6.8,12l8.8,8.7C15.7,20.9,16,21,16.2,21z"}})])])],2),s("button",{directives:[{name:"show",rawName:"v-show",value:!e.arrowNextDisabled,expression:"!arrowNextDisabled"}],staticClass:"vueperslides__arrow vueperslides__arrow--next",attrs:{"aria-label":"Next"},on:{click:function(t){e.next()}}},[e._t("arrowRight",[s("svg",{attrs:{viewBox:"0 0 24 24"}},[s("path",{attrs:{d:"M7.8,21c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l7.4-7.3L7,4.7c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l8.8,8.7l-8.8,8.7C8.3,20.9,8,21,7.8,21z"}})])])],2)]):e._e(),e.conf.bullets&&e.slides.count>1&&!e.disable&&!e.conf.bulletsOutside?s("div",{staticClass:"vueperslides__bullets",attrs:{role:"tablist","aria-label":"Slideshow navigation"}},e._l(e.slides.list,function(t,i){return s("button",{key:i,ref:"bullet",refInFor:!0,staticClass:"vueperslides__bullet",class:{"vueperslides__bullet--active":e.slides.current===i},on:{click:function(t){e.goToSlide(i)},keyup:[function(t){return"button"in t||!e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])?"button"in t&&0!==t.button?null:void e.previous():null},function(t){return"button"in t||!e._k(t.keyCode,"right",39,t.key,["Right","ArrowRight"])?"button"in t&&2!==t.button?null:void e.next():null}]}},[s("span",[e._v(e._s(i+1))])])})):e._e()]),e.conf.bullets&&e.slides.count>1&&!e.disable&&e.conf.bulletsOutside?s("div",{staticClass:"vueperslides__bullets vueperslides__bullets--outside"},e._l(e.slides.list,function(t,i){return s("button",{key:i,ref:"bullet",refInFor:!0,staticClass:"vueperslides__bullet",class:{"vueperslides__bullet--active":e.slides.current===i},on:{click:function(t){e.goToSlide(i)},keyup:[function(t){return"button"in t||!e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])?"button"in t&&0!==t.button?null:void e.previous():null},function(t){return"button"in t||!e._k(t.keyCode,"right",39,t.key,["Right","ArrowRight"])?"button"in t&&2!==t.button?null:void e.next():null}]}},[s("span",[e._v(e._s(i+1))])])})):e._e(),"bottom"===e.conf.slideContentOutside?s("div",{staticClass:"vueperslides__slide-content vueperslides__slide-content--outside-bottom",class:e.conf.slideContentOutsideClass},[e.slides.count?s("div",{staticClass:"slide-title",domProps:{innerHTML:e._s(e.getCurrentSlideData("title"))}}):e._e(),e.slides.count?s("div",{staticClass:"slide-content",domProps:{innerHTML:e._s(e.getCurrentSlideData("content"))}}):e._e()]):e._e()])},staticRenderFns:[],name:"vueper-slides",components:{VueperSlide:s},props:{initSlide:{type:Number,default:1},slideRatio:{type:Number,default:1/3},arrows:{type:Boolean,default:!0},arrowsOutside:{type:Boolean,default:!1},disableArrowsOnEdges:{type:[Boolean,String],default:!1},bullets:{type:Boolean,default:!0},bulletsOutside:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},slideContentOutside:{type:[Boolean,String],default:!1},slideContentOutsideClass:{type:String,default:""},autoplay:{type:Boolean,default:!1},speed:{type:[Number,String],default:4e3},transitionSpeed:{type:[Number,String],default:600},pauseOnHover:{type:Boolean,default:!0},infinite:{type:Boolean,default:!0},refreshClonesOnDrag:{type:Boolean,default:!1},parallax:{type:[Boolean,Number],default:!1},touchable:{type:Boolean,default:!0},draggingDistance:{type:Number,default:null},disable:{type:Boolean,default:!1},breakpoints:{type:Object,default:function(){return{}}}},data:function(){return{isReady:!1,container:null,slides:{list:[],count:0,activeUid:null,current:0,clones:[]},clones:[],mouseDown:!1,mouseOver:!1,touch:{enabled:!0,dragging:!1,dragStartX:0,dragAmount:0,goNext:!0},transition:{currentTranslation:0,speed:0,animated:!1},timer:null,arrowPrevDisabled:!1,arrowNextDisabled:!1,breakpointsData:{list:[],current:null},parallaxData:{translation:0,slideshowOffsetTop:null,isVisible:!1}}},mounted:function(){this.init()},methods:{init:function(){var e=this;this.emit("before-init",!1),this.container=this.$refs.vueperslides,this.touch.enabled=this.conf.touchable,this.transition.speed=this.conf.transitionSpeed,Object.keys(this.breakpoints).length&&(this.setBreakpointsList(),this.setBreakpointConfig(this.getCurrentBreakpoint())),this.conf.infinite&&(this.cloneSlides(),this.$nextTick(function(){return e.cloneSlides()})),this.goToSlide(this.conf.initSlide-1),this.bindEvents(),this.isReady=!0,this.emit("ready")},emit:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[e];if((t||"number"==typeof s)&&(i[1]={},t&&this.slides.activeUid&&(i[1].currentSlide=this.getSlideData(this.slides.current)),"number"==typeof s)){var n=this.getSlideInRange(s).nextSlide;i[1].nextSlide=this.getSlideData(n)}this.$emit.apply(this,[e].concat(i))},getSlideData:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=this.slides.list[e],i=s.$slots,n=i.slideTitle,o=void 0===n?[{}]:n,l=i.slideContent,r=void 0===l?[{}]:l,a=o[0].elm,d=void 0===a?{}:a,u=r[0].elm,c=void 0===u?{}:u,h={index:e,title:s.title,titleSlot:d&&d.innerHTML||null,content:s.content,contentSlot:c&&c.innerHTML||null,image:s.image};if(t){var p=s.$el.attributes,f=(p=void 0===p?{}:p).style,v=(f=void 0===f?{}:f).value,g=void 0===v?"":v;h.style=g}return h},getCurrentSlideData:function(e){var t=this.getSlideData(this.slides.current),s=t.titleSlot,i=t.title,n=t.contentSlot,o=t.content;return"title"===e?i||s:o||n},setBreakpointsList:function(){this.breakpointsData.list=[99999].concat(n(Object.keys(this.breakpoints))).sort(function(e,t){return parseInt(e)<parseInt(t)})},getCurrentBreakpoint:function(){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=[e].concat(n(this.breakpointsData.list)).sort(function(e,t){return parseInt(e)<parseInt(t)});return this.breakpointsData.list[t.indexOf(e)-1]},hasBreakpointChanged:function(e){return this.breakpointsData.current!==e},setBreakpointConfig:function(e){this.breakpointsData.current=e},cloneSlides:function(){this.clones[0]=this.getSlideData(this.slides.count-1,!0),this.clones[1]=this.getSlideData(0,!0)},bindEvents:function(){var e="ontouchstart"in window;this.touch.enabled&&(this.$refs.track.addEventListener(e?"touchstart":"mousedown",this.onMouseDown),document.addEventListener(e?"touchmove":"mousemove",this.onMouseMove),document.addEventListener(e?"touchend":"mouseup",this.onMouseUp)),this.conf.pauseOnHover&&!e&&this.conf.autoplay&&(this.container.addEventListener("mouseover",this.onMouseIn),this.container.addEventListener("mouseout",this.onMouseOut)),(this.breakpointsData.list.length||this.conf.parallax)&&window.addEventListener("resize",this.onResize),this.conf.parallax&&(this.refreshParallax(),document.addEventListener("scroll",this.onScroll))},getSlideshowOffsetTop:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null===this.parallaxData.slideshowOffsetTop||e){for(var t=this.container,s=t.offsetTop;t=t.offsetParent;)s+=t.offsetTop;this.parallaxData.slideshowOffsetTop=s}return this.parallaxData.slideshowOffsetTop},onScroll:function(){var e=document.documentElement,t=(window.pageYOffset||e.scrollTop)-(e.clientTop||0),s=window.innerHeight||e.clientHeight||document.body.clientHeight,i=this.container.clientHeight,n=this.getSlideshowOffsetTop(),o=n+i-t,l=s+t-n;if(this.parallaxData.isVisible=o>0&&l>0,this.parallaxData.isVisible){var r=100*o/(s+i),a=-1===this.conf.parallax?100-r:r;this.parallaxData.translation=-a/2}},onResize:function(){if(this.breakpointsData.list.length){var e=this.getCurrentBreakpoint();this.hasBreakpointChanged(e)&&this.setBreakpointConfig(e)}this.conf.parallax&&this.getSlideshowOffsetTop(!0)},onMouseIn:function(){this.mouseOver=!0,this.conf.pauseOnHover&&this.conf.autoplay&&this.clearTimer()},onMouseOut:function(){this.mouseOver=!1,this.conf.pauseOnHover&&this.conf.autoplay&&this.setTimer()},onMouseDown:function(e){if(this.touch.enabled&&!this.disable)if(e.touches||e.preventDefault(),this.conf.infinite&&this.cloneSlides(),this.mouseDown=!0,this.draggingDistance)this.touch.dragStartX="ontouchstart"in window?e.touches[0].clientX:e.clientX;else{var t=this.getDragPercentage(e);this.touch.goNext=t>=.5,this.transition.currentTranslation=-100*(this.slides.current+(this.touch.goNext?1:0)+(this.clones.length?1:0)-t)}},onMouseMove:function(e){if(this.mouseDown||this.touch.dragging)if(this.mouseDown=!1,this.touch.dragging=!0,this.conf.refreshClonesOnDrag&&this.conf.infinite&&this.cloneSlides(),this.draggingDistance){this.touch.dragAmount=this.getDragAmount(e);var t=this.touch.dragAmount/this.container.clientWidth;this.transition.currentTranslation=-100*(this.slides.current+(this.clones.length?1:0)-t)}else{var s=this.getDragPercentage(e);this.transition.currentTranslation=-100*(this.slides.current+(this.touch.goNext?1:0)+(this.clones.length?1:0)-s)}},onMouseUp:function(e){if(this.mouseDown||this.touch.dragging){this.mouseDown=!1,this.touch.dragging=!1;var t=void 0;if(this.draggingDistance){var s=this.touch.dragAmount;this.container.clientWidth;t=this.slides.current,Math.abs(s)>=this.draggingDistance&&(t+=s>0?-1:1)}else t=-(Math.round(this.transition.currentTranslation/100)+(this.clones.length?1:0));var i=this.getSlideInRange(t).nextSlide;this.arrowNextDisabled&&this.conf.autoplay&&0===i&&(i=this.slides.count-1),i!==this.slides.current?this.goToSlide(t):this.transition.currentTranslation=100*-(this.slides.current+(this.clones.length?1:0)),this.touch.dragStartX=null,this.touch.dragAmount=null,this.enableScroll()}},getDragPercentage:function(e){return(("ontouchstart"in window?e.touches[0].clientX:e.clientX)-this.container.offsetLeft)/this.container.clientWidth},getDragAmount:function(e){return("ontouchstart"in window?e.touches[0].clientX:e.clientX)-this.touch.dragStartX},disableScroll:function(){document.ontouchmove=function(e){e.preventDefault()}},enableScroll:function(){document.ontouchmove=function(){return!0}},clearTimer:function(){clearTimeout(this.timer),this.timer=0},setTimer:function(){var e=this;this.timer=setTimeout(function(){e.goToSlide(e.slides.current+1,{autoPlaying:!0})},this.conf.speed)},previous:function(){this.goToSlide(this.slides.current-1)},next:function(){this.goToSlide(this.slides.current+1)},refreshParallax:function(){var e=this;setTimeout(function(){e.onResize(),e.onScroll()},100)},getSlideInRange:function(e){var t=null;return this.clones.length?e<0?(e=this.slides.count-1,t=0):e>this.slides.count-1&&(e=0,t=1):e<0?e=this.conf.disableArrowsOnEdges?0:this.slides.count-1:e>this.slides.count-1&&(e=this.conf.disableArrowsOnEdges?this.conf.autoplay?0:this.slides.count-1:0),{nextSlide:e,clone:t}},goToSlide:function(e){var t=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.slides.count&&!this.disable){this.conf.autoplay&&this.clearTimer();var i=s.animation,n=void 0===i||i,o=s.autoPlaying,l=void 0!==o&&o,r=s.jumping,a=void 0!==r&&r;this.transition.animated=n,setTimeout(function(){return t.transition.animated=!1},this.transitionSpeed);var d=this.getSlideInRange(e),u=d.nextSlide,c=d.clone;this.isReady&&!a&&(this.emit("before-slide",!0,u),null!==c&&this.cloneSlides()),this.conf.arrows&&this.conf.disableArrowsOnEdges&&(this.arrowPrevDisabled=0===u,this.arrowNextDisabled=u===this.slides.count-1),null!==c&&setTimeout(function(){var s=-1===e&&t.slides.current!==t.slides.count-1,i=e===t.slides.count&&0!==t.slides.current;s||i||(t.transition.speed=0,t.goToSlide(c?0:t.slides.count-1,{animation:!1,jumping:!0}),setTimeout(function(){return t.transition.speed=t.conf.transitionSpeed},10))},this.transition.speed-50),this.slides.current=u,this.conf.fade||(this.transition.currentTranslation=null!==c?-100*(c?this.slides.count+1:0):-100*(this.slides.current+(this.clones.length?1:0))),this.slides.activeUid=this.slides.list[this.slides.current]._uid,this.conf.autoplay&&!this.mouseOver&&this.setTimer(),this.slides.count&&(this.$slots.default[this.slides.current]&&this.isReady&&!a&&this.emit("slide"),this.isReady&&!l&&!a&&this.$refs.bullet[this.slides.current]&&this.$refs.bullet[this.slides.current].focus())}},addSlide:function(e){var t=this,s=this.conf.infinite&&this.isReady&&null===e.clone;null!==e.clone?this.clones[e.clone]=e:(this.slides.list.push(e),this.slides.count=this.slides.list.length),this.slides.count>1&&this.touchable&&(this.touch.enabled=!0),s&&this.$nextTick(function(){return t.cloneSlides()})},removeSlide:function(e){var t=this,s=!1;this.slides.list.some(function(i,n){if(i._uid===e)return t.slides.list.splice(n,1),t.slides.count=t.slides.list.length,e===t.slides.activeUid&&(t.slides.activeUid=null,t.goToSlide(n-1,{autoPlaying:!0})),t.slides.count<=1&&(t.touch.enabled=!1),t.clones.length&&t.isReady&&!i.clone&&(s=!0),!0}),this.slides.count&&s&&this.cloneSlides()}},computed:{conf:function(){var e=i({},this.$props,this.$props.breakpoints&&this.$props.breakpoints[this.breakpointsData.current]||{});return e.fade&&(e.infinite=!1),e},trackStyles:function(){var e={};return e.transitionDuration=this.transition.speed+"ms",this.conf.fade||(e.transform="translateX("+this.transition.currentTranslation+"%)"),e},trackWrapperStyles:function(){var e={};return this.conf.parallax&&(e.transform="translateY("+this.parallaxData.translation+"%)",e.willChange=this.parallaxData.isVisible?"transform":"auto"),e}}};"undefined"!=typeof window&&window.Vue&&(window.Vue.component("vueper-slides",o),window.Vue.component("vueper-slide",s)),e.VueperSlides=o,e.VueperSlide=s,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=vueperslides.min.js.map |
{ | ||
"name": "vueperslides", | ||
"version": "1.9.3", | ||
"version": "1.9.4", | ||
"description": "A touch ready & responsive slideshow for Vue JS.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/antoniandre/vueper-slides", |
@@ -28,2 +28,3 @@ # Vueper Slides | ||
- __Version 1.9.4__ Add a method to refresh parallax | ||
- __Version 1.9.1__ Add onload parallax translation calculation | ||
@@ -30,0 +31,0 @@ - __Version 1.9.0__ Add previous() & next() methods for external controls |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
198842
849
42