27.152b8fda.js 15 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[27],{439:function(t,e,o){"use strict";var s=o(435),i=function(){function t(t){this.scroll=t,this.wheelEndTimer=0,this.wheelMoveTimer=0,this.wheelStart=!1,this.init()}return t.prototype.init=function(){this.handleBScroll(),this.handleOptions(),this.handleHooks(),this.registerEvent()},t.prototype.handleBScroll=function(){this.scroll.registerType(["alterOptions","mousewheelStart","mousewheelMove","mousewheelEnd"])},t.prototype.handleOptions=function(){var t=!0===this.scroll.options.mouseWheel?{}:this.scroll.options.mouseWheel;this.mouseWheelOpt=Object(s.t)({speed:20,invert:!1,easeTime:300,discreteTime:400,throttleTime:0,dampingFactor:.1},t)},t.prototype.handleHooks=function(){this.hooksFn=[],this.registerHooks(this.scroll.hooks,"destroy",this.destroy)},t.prototype.registerEvent=function(){this.eventRegister=new s.f(this.scroll.scroller.wrapper,[{name:"wheel",handler:this.wheelHandler.bind(this)},{name:"mousewheel",handler:this.wheelHandler.bind(this)},{name:"DOMMouseScroll",handler:this.wheelHandler.bind(this)}])},t.prototype.registerHooks=function(t,e,o){t.on(e,o,this),this.hooksFn.push([t,e,o])},t.prototype.wheelHandler=function(t){if(this.scroll.enabled){this.beforeHandler(t),this.wheelStart||(this.wheelStartHandler(t),this.wheelStart=!0);var e=this.getWheelDelta(t);this.wheelMoveHandler(e),this.wheelEndDetector(e)}},t.prototype.wheelStartHandler=function(t){this.cleanCache();var e=this.scroll.scroller,o=e.scrollBehaviorX,i=e.scrollBehaviorY;o.setMovingDirection(s.b.Default),i.setMovingDirection(s.b.Default),o.setDirection(s.b.Default),i.setDirection(s.b.Default),this.scroll.trigger(this.scroll.eventTypes.alterOptions,this.mouseWheelOpt),this.scroll.trigger(this.scroll.eventTypes.mousewheelStart)},t.prototype.cleanCache=function(){this.deltaCache=[]},t.prototype.wheelMoveHandler=function(t){var e=this,o=this.mouseWheelOpt,s=o.throttleTime,i=o.dampingFactor;if(s&&this.wheelMoveTimer)this.deltaCache.push(t);else{var r=this.deltaCache.reduce((function(t,e){return{x:t.x+e.x,y:t.y+e.y}}),{x:0,y:0});this.cleanCache();var n=this.scroll.scroller,l=n.scrollBehaviorX,a=n.scrollBehaviorY;l.setMovingDirection(-t.directionX),a.setMovingDirection(-t.directionY),l.setDirection(t.x),a.setDirection(t.y);var h=l.performDampingAlgorithm(Math.round(t.x)+r.x,i),c=a.performDampingAlgorithm(Math.round(t.y)+r.x,i);if(!this.scroll.trigger(this.scroll.eventTypes.mousewheelMove,{x:h,y:c})){var p=this.getEaseTime();h===this.scroll.x&&c===this.scroll.y||this.scroll.scrollTo(h,c,p)}s&&(this.wheelMoveTimer=window.setTimeout((function(){e.wheelMoveTimer=0}),s))}},t.prototype.wheelEndDetector=function(t){var e=this;window.clearTimeout(this.wheelEndTimer),this.wheelEndTimer=window.setTimeout((function(){e.wheelStart=!1,window.clearTimeout(e.wheelMoveTimer),e.wheelMoveTimer=0,e.scroll.trigger(e.scroll.eventTypes.mousewheelEnd,t)}),this.mouseWheelOpt.discreteTime)},t.prototype.getWheelDelta=function(t){var e=this.mouseWheelOpt,o=e.speed,i=0,r=0,n=e.invert?s.b.Negative:s.b.Positive;switch(!0){case"deltaX"in t:1===t.deltaMode?(i=-t.deltaX*o,r=-t.deltaY*o):(i=-t.deltaX,r=-t.deltaY);break;case"wheelDeltaX"in t:i=t.wheelDeltaX/120*o,r=t.wheelDeltaY/120*o;break;case"wheelDelta"in t:i=r=t.wheelDelta/120*o;break;case"detail"in t:i=r=-t.detail/3*o}return i*=n,r*=n,this.scroll.hasVerticalScroll||(Math.abs(r)>Math.abs(i)&&(i=r),r=0),this.scroll.hasHorizontalScroll||(i=0),{x:i,y:r,directionX:i>0?s.b.Negative:i<0?s.b.Positive:s.b.Default,directionY:r>0?s.b.Negative:r<0?s.b.Positive:s.b.Default}},t.prototype.beforeHandler=function(t){var e=this.scroll.options,o=e.preventDefault,i=e.stopPropagation,r=e.preventDefaultException;o&&!Object(s.L)(t.target,r)&&Object(s.H)(t),i&&t.stopPropagation()},t.prototype.getEaseTime=function(){var t=this.mouseWheelOpt.easeTime;return t<100&&Object(s.S)("easeTime should be greater than 100.If mouseWheel easeTime is too small,scrollEnd will be triggered many times."),Math.max(t,100)},t.prototype.destroy=function(){this.eventRegister.destroy(),window.clearTimeout(this.wheelEndTimer),window.clearTimeout(this.wheelMoveTimer),this.hooksFn.forEach((function(t){var e=t[0],o=t[1],s=t[2];e.off(o,s)}))},t.pluginName="mouseWheel",t.applyOrder=s.a.Pre,t}();e.a=i},460:function(t,e,o){"use strict";var s,i,r,n=o(435),l=function(){function t(t,e){this.indicator=t,this.options=e,this.hooks=new n.d(["touchStart","touchMove","touchEnd"]),this.registerEvents()}return t.prototype.registerEvents=function(){var t=this.options,e=t.disableMouse,o=t.disableTouch,s=[],i=[],r=[];e||(s.push({name:"mousedown",handler:this.start.bind(this)}),i.push({name:"mousemove",handler:this.move.bind(this)}),r.push({name:"mouseup",handler:this.end.bind(this)})),o||(s.push({name:"touchstart",handler:this.start.bind(this)}),i.push({name:"touchmove",handler:this.move.bind(this)}),r.push({name:"touchend",handler:this.end.bind(this)},{name:"touchcancel",handler:this.end.bind(this)})),this.startEventRegister=new n.f(this.indicator.indicatorEl,s),this.moveEventRegister=new n.f(window,i),this.endEventRegister=new n.f(window,r)},t.prototype.BScrollIsDisabled=function(){return!this.indicator.scroll.enabled},t.prototype.start=function(t){if(!this.BScrollIsDisabled()){var e=t.touches?t.touches[0]:t;Object(n.H)(t),t.stopPropagation(),this.initiated=!0,this.lastPoint=e[this.indicator.keysMap.point],this.hooks.trigger(this.hooks.eventTypes.touchStart)}},t.prototype.move=function(t){if(this.initiated){var e=(t.touches?t.touches[0]:t)[this.indicator.keysMap.point];Object(n.H)(t),t.stopPropagation();var o=e-this.lastPoint;this.lastPoint=e,this.hooks.trigger(this.hooks.eventTypes.touchMove,o)}},t.prototype.end=function(t){this.initiated&&(this.initiated=!1,Object(n.H)(t),t.stopPropagation(),this.hooks.trigger(this.hooks.eventTypes.touchEnd))},t.prototype.destroy=function(){this.startEventRegister.destroy(),this.moveEventRegister.destroy(),this.endEventRegister.destroy()},t}();!function(t){t.Horizontal="horizontal",t.Vertical="vertical"}(s||(s={})),function(t){t[t.Up=-1]="Up",t[t.Down=1]="Down"}(i||(i={})),function(t){t.Step="step",t.Point="clickedPoint"}(r||(r={}));var a=function(){function t(t,e){this.scroll=t,this.options=e,this.hooksFn=[],this.wrapper=e.wrapper,this.direction=e.direction,this.indicatorEl=this.wrapper.children[0],this.keysMap=this.getKeysMap(),this.handleFade(),this.handleHooks()}return t.prototype.handleFade=function(){this.options.fade&&(this.wrapper.style.opacity="0")},t.prototype.handleHooks=function(){var t=this,e=this.options,o=e.fade,s=e.interactive,i=e.scrollbarTrackClickable,r=this.scroll,n=r.hooks,a=r.scroller.translater.hooks,h=r.scroller.animater.hooks;if(this.registerHooks(n,n.eventTypes.refresh,this.refresh),this.registerHooks(a,a.eventTypes.translate,(function(e){var o=t.keysMap.hasScroll;t.scroll[o]&&t.updatePosition(e)})),this.registerHooks(h,h.eventTypes.time,this.transitionTime),this.registerHooks(h,h.eventTypes.timeFunction,this.transitionTimingFunction),o&&(this.registerHooks(r,r.eventTypes.scrollEnd,(function(){t.fade()})),this.registerHooks(r,r.eventTypes.scrollStart,(function(){t.fade(!0)})),r.eventTypes.mousewheelStart&&r.eventTypes.mousewheelEnd&&(this.registerHooks(r,r.eventTypes.mousewheelStart,(function(){t.fade(!0)})),this.registerHooks(r,r.eventTypes.mousewheelMove,(function(){t.fade(!0)})),this.registerHooks(r,r.eventTypes.mousewheelEnd,(function(){t.fade()})))),s){var c=this.scroll.options,p=c.disableMouse,d=c.disableTouch;this.eventHandler=new l(this,{disableMouse:p,disableTouch:d});var u=this.eventHandler.hooks;this.registerHooks(u,u.eventTypes.touchStart,this.startHandler),this.registerHooks(u,u.eventTypes.touchMove,this.moveHandler),this.registerHooks(u,u.eventTypes.touchEnd,this.endHandler)}i&&this.bindClick()},t.prototype.registerHooks=function(t,e,o){t.on(e,o,this),this.hooksFn.push([t,e,o])},t.prototype.bindClick=function(){var t=this.wrapper;this.clickEventRegister=new n.f(t,[{name:"click",handler:this.handleClick.bind(this)}])},t.prototype.handleClick=function(t){var e=this.calculateclickOffsetPos(t),o=this.scroll,i=o.x,r=o.y;i=this.direction===s.Horizontal?e:i,r=this.direction===s.Vertical?e:r,this.scroll.scrollTo(i,r,this.options.scrollbarTrackOffsetTime)},t.prototype.calculateclickOffsetPos=function(t){var e=this.keysMap,o=e.point,s=e.domRect,n=this.options.scrollbarTrackOffsetType,l=t[o]-this.wrapperRect[s],a=l<this.currentPos?i.Up:i.Down,h=0,c=this.currentPos;return n===r.Step?h=this.scrollInfo.baseSize*a:(h=0,c=l),this.newPos(c,h,this.scrollInfo)},t.prototype.getKeysMap=function(){return this.direction===s.Vertical?{hasScroll:"hasVerticalScroll",size:"height",wrapperSize:"clientHeight",scrollerSize:"scrollerHeight",maxScrollPos:"maxScrollY",pos:"y",point:"pageY",translateProperty:"translateY",domRect:"top"}:{hasScroll:"hasHorizontalScroll",size:"width",wrapperSize:"clientWidth",scrollerSize:"scrollerWidth",maxScrollPos:"maxScrollX",pos:"x",point:"pageX",translateProperty:"translateX",domRect:"left"}},t.prototype.fade=function(t){var e=this.options,o=e.fadeInTime,s=e.fadeOutTime,i=t?o:s,r=this.wrapper;r.style[n.P.transitionDuration]=i+"ms",r.style.opacity=t?"1":"0"},t.prototype.refresh=function(){var t=this.keysMap.hasScroll,e=this.scroll,o=e.x,s=e.y;if(this.wrapperRect=this.wrapper.getBoundingClientRect(),this.canScroll(e[t])){var i=this.keysMap,r=i.wrapperSize,n=i.scrollerSize,l=i.maxScrollPos;this.scrollInfo=this.refreshScrollInfo(this.wrapper[r],e[n],e[l],this.indicatorEl[r]),this.updatePosition({x:o,y:s})}},t.prototype.transitionTime=function(t){void 0===t&&(t=0),this.indicatorEl.style[n.P.transitionDuration]=t+"ms"},t.prototype.transitionTimingFunction=function(t){this.indicatorEl.style[n.P.transitionTimingFunction]=t},t.prototype.canScroll=function(t){return this.wrapper.style.display=t?"block":"none",t},t.prototype.refreshScrollInfo=function(t,e,o,s){var i=Math.max(Math.round(t*t/(e||t||1)),this.options.minSize);this.options.isCustom&&(i=s);var r=t-i;return{baseSize:i,maxScrollPos:r,minScrollPos:0,sizeRatio:r/o}},t.prototype.updatePosition=function(t){var e=this.caculatePosAndSize(t,this.scrollInfo),o=e.pos,s=e.size;this.refreshStyle(s,o),this.currentPos=o},t.prototype.caculatePosAndSize=function(t,e){var o,s=this.keysMap.pos,i=e.sizeRatio,r=e.baseSize,n=e.maxScrollPos,l=e.minScrollPos,a=this.options.minSize,h=Math.round(i*t[s]);return h<l?(o=Math.max(r+3*h,a),h=l):h>n?h=n+r-(o=Math.max(r-3*(h-n),a)):o=r,{pos:h,size:o}},t.prototype.refreshStyle=function(t,e){var o=this.keysMap,s=o.translateProperty,i=o.size,r=this.scroll.options.translateZ;this.indicatorEl.style[i]=t+"px",this.indicatorEl.style[n.P.transform]=s+"("+e+"px)"+r},t.prototype.startHandler=function(){this.moved=!1,this.startTime=Object(n.y)(),this.transitionTime(),this.scroll.scroller.hooks.trigger(this.scroll.scroller.hooks.eventTypes.beforeScrollStart)},t.prototype.moveHandler=function(t){if(this.moved||this.indicatorNotMoved(t)||(this.moved=!0,this.scroll.scroller.hooks.trigger(this.scroll.scroller.hooks.eventTypes.scrollStart)),this.moved){var e=this.newPos(this.currentPos,t,this.scrollInfo);this.syncBScroll(e)}},t.prototype.endHandler=function(){if(this.moved){var t=this.scroll,e=t.x,o=t.y;this.scroll.scroller.hooks.trigger(this.scroll.scroller.hooks.eventTypes.scrollEnd,{x:e,y:o})}},t.prototype.indicatorNotMoved=function(t){var e=this.currentPos,o=this.scrollInfo,s=o.maxScrollPos;return e===o.minScrollPos&&t<=0||e===s&&t>=0},t.prototype.syncBScroll=function(t){var e=Object(n.y)(),o=this.scroll,i=o.x,r=o.y,l=o.options,a=o.scroller,h=o.maxScrollY,c=o.minScrollY,p=o.maxScrollX,d=o.minScrollX,u=l.probeType,m=l.momentumLimitTime,f={x:i,y:r};this.direction===s.Vertical?f.y=Object(n.m)(t,h,c):f.x=Object(n.m)(t,p,d),a.translater.translate(f),e-this.startTime>m&&(this.startTime=e,u===n.j.Throttle&&a.hooks.trigger(a.hooks.eventTypes.scroll,f)),u>n.j.Throttle&&a.hooks.trigger(a.hooks.eventTypes.scroll,f)},t.prototype.newPos=function(t,e,o){var s=o.maxScrollPos,i=o.sizeRatio,r=o.minScrollPos,l=t+e;return l=Object(n.m)(l,r,s),Math.round(l/i)},t.prototype.destroy=function(){var t=this.options,e=t.interactive,o=t.scrollbarTrackClickable,s=t.isCustom;e&&this.eventHandler.destroy(),o&&this.clickEventRegister.destroy(),s||this.wrapper.parentNode.removeChild(this.wrapper),this.hooksFn.forEach((function(t){var e=t[0],o=t[1],s=t[2];e.off(o,s)})),this.hooksFn.length=0},t}(),h=function(){return(h=Object.assign||function(t){for(var e,o=1,s=arguments.length;o<s;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},c=function(){function t(t){this.scroll=t,this.handleOptions(),this.createIndicators(),this.handleHooks()}return t.prototype.handleHooks=function(){var t=this,e=this.scroll;e.hooks.on(e.hooks.eventTypes.destroy,(function(){for(var e=0,o=t.indicators;e<o.length;e++){o[e].destroy()}}))},t.prototype.handleOptions=function(){var t=!0===this.scroll.options.scrollbar?{}:this.scroll.options.scrollbar,e={fade:!0,fadeInTime:250,fadeOutTime:500,interactive:!1,customElements:[],minSize:8,scrollbarTrackClickable:!1,scrollbarTrackOffsetType:r.Step,scrollbarTrackOffsetTime:300};this.options=Object(n.t)(e,t)},t.prototype.createIndicators=function(){for(var t,e=this.scroll,o=[],i=["scrollX","scrollY"],r=[s.Horizontal,s.Vertical],n=this.options.customElements,l=0;l<i.length;l++){var c=i[l];if(e.options[c]){var p=n.shift(),d=r[l],u=!1,m=p||this.createScrollbarElement(d);m!==p?e.wrapper.appendChild(m):u=!0,t=h(h({wrapper:m,direction:d},this.options),{isCustom:u}),o.push(new a(e,t))}}this.indicators=o},t.prototype.createScrollbarElement=function(t,e){void 0===e&&(e=this.options.scrollbarTrackClickable);var o=document.createElement("div"),i=document.createElement("div");return o.style.cssText="position:absolute;z-index:9999;overflow:hidden;",i.style.cssText="box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px;",i.className="bscroll-indicator",t===s.Horizontal?(o.style.cssText+="height:7px;left:2px;right:2px;bottom:0;",i.style.height="100%",o.className="bscroll-horizontal-scrollbar"):(o.style.cssText+="width:7px;bottom:2px;top:2px;right:1px;",i.style.width="100%",o.className="bscroll-vertical-scrollbar"),e||(o.style.cssText+="pointer-events:none;"),o.appendChild(i),o},t.pluginName="scrollbar",t}();e.a=c},548:function(t,e,o){},713:function(t,e,o){t.exports=o.p+"assets/img/sad-girl.a88c160d.jpg"},714:function(t,e,o){"use strict";o(548)},770:function(t,e,o){"use strict";o.r(e);var s=o(436),i=o(460),r=o(439),n=o(713),l=o.n(n);s.a.use(i.a),s.a.use(r.a);var a={data:function(){return{girlImageLink:l.a}},methods:{initBscroll:function(){this.scroll=new s.a(this.$refs.wrapper,{scrollX:!0,scrollY:!1,click:!0,mouseWheel:!0,scrollbar:{customElements:[this.$refs.horizontal],fade:!0,interactive:!0,scrollbarTrackClickable:!0}})},onload:function(){this.initBscroll()}}},h=(o(714),o(41)),c=Object(h.a)(a,(function(){var t=this._self._c;return t("div",{staticClass:"mousewheel-scrollbar-container"},[t("div",{ref:"wrapper",staticClass:"custom-scrollbar-wrapper"},[t("div",{staticClass:"custom-scrollbar-content"},[t("img",{attrs:{src:this.girlImageLink,alt:""},on:{load:this.onload}})]),this._v(" "),t("div",{ref:"horizontal",staticClass:"custom-horizontal-scrollbar"},[t("div",{staticClass:"custom-horizontal-indicator"})])]),this._v(" "),t("div",{staticClass:"tip"},[this._v("please use your mouse-wheel")])])}),[],!1,null,"7ee62419",null);e.default=c.exports}}]);