1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[29],{499:function(t,i,o){"use strict";var s,r;!function(t){t.Vertical="vertical",t.Horizontal="horizontal"}(s||(s={})),function(t){t[t.Positive=-1]="Positive",t[t.NotPositive=1]="NotPositive"}(r||(r={}));var e=o(435),n=function(){return(n=Object.assign||function(t){for(var i,o=1,s=arguments.length;o<s;o++)for(var r in i=arguments[o])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t}).apply(this,arguments)},a=function(t){Object(e.H)(t),t.stopPropagation()},l=function(){function t(t,i){this.scroll=t,this.options=i,this.currentPos={x:0,y:0},this.hooksFn=[],this.handleDOM(),this.handleHooks(),this.handleInteractive()}return t.prototype.handleDOM=function(){var t=this.options,i=t.relationElement,o=t.relationElementHandleElementIndex,s=void 0===o?0:o;this.wrapper=i,this.indicatorEl=this.wrapper.children[s]},t.prototype.handleHooks=function(){var t=this,i=this.scroll,o=i.hooks,s=i.scroller.translater.hooks,r=i.scroller.animater.hooks;this.registerHooks(o,o.eventTypes.refresh,this.refresh),this.registerHooks(s,s.eventTypes.translate,(function(i){t.updatePosition(i)})),this.registerHooks(r,r.eventTypes.time,this.transitionTime),this.registerHooks(r,r.eventTypes.timeFunction,this.transitionTimingFunction)},t.prototype.transitionTime=function(t){void 0===t&&(t=0),this.indicatorEl.style[e.P.transitionDuration]=t+"ms"},t.prototype.transitionTimingFunction=function(t){this.indicatorEl.style[e.P.transitionTimingFunction]=t},t.prototype.handleInteractive=function(){!1!==this.options.interactive&&this.registerEvents()},t.prototype.registerHooks=function(t,i,o){t.on(i,o,this),this.hooksFn.push([t,i,o])},t.prototype.registerEvents=function(){var t=this.scroll.options,i=t.disableMouse,o=t.disableTouch,s=[],r=[],n=[];i||(s.push({name:"mousedown",handler:this.start.bind(this)}),r.push({name:"mousemove",handler:this.move.bind(this)}),n.push({name:"mouseup",handler:this.end.bind(this)})),o||(s.push({name:"touchstart",handler:this.start.bind(this)}),r.push({name:"touchmove",handler:this.move.bind(this)}),n.push({name:"touchend",handler:this.end.bind(this)},{name:"touchcancel",handler:this.end.bind(this)})),this.startEventRegister=new e.f(this.indicatorEl,s),this.moveEventRegister=new e.f(window,r),this.endEventRegister=new e.f(window,n)},t.prototype.refresh=function(){var t,i,o=this.scroll,s=o.x,n=o.y,a=o.hasHorizontalScroll,l=o.hasVerticalScroll,h=o.maxScrollX,c=o.maxScrollY,p=(t=this.options.ratio,i={ratioX:0,ratioY:0},t?("number"==typeof t?i.ratioX=i.ratioY=t:"object"==typeof t&&t&&(i.ratioX=t.x||0,i.ratioY=t.y||0),i):i),d=p.ratioX,m=p.ratioY,u=Object(e.v)(this.wrapper),v=u.width,f=u.height,y=Object(e.z)(this.indicatorEl),S=y.width,g=y.height;a&&(this.maxScrollX=v-S,this.translateXSign=this.maxScrollX>0?r.Positive:r.NotPositive,this.minScrollX=0,this.ratioX=d||Math.abs(this.maxScrollX/h)),l&&(this.maxScrollY=f-g,this.translateYSign=this.maxScrollY>0?r.Positive:r.NotPositive,this.minScrollY=0,this.ratioY=m||Math.abs(this.maxScrollY/c)),this.updatePosition({x:s,y:n})},t.prototype.start=function(t){if(!this.BScrollIsDisabled()){var i=t.touches?t.touches[0]:t;a(t),this.initiated=!0,this.moved=!1,this.lastPointX=i.pageX,this.lastPointY=i.pageY,this.startTime=Object(e.y)(),this.scroll.scroller.hooks.trigger(this.scroll.scroller.hooks.eventTypes.beforeScrollStart)}},t.prototype.BScrollIsDisabled=function(){return!this.scroll.enabled},t.prototype.move=function(t){if(this.initiated){var i=t.touches?t.touches[0]:t,o=i.pageX,s=i.pageY;a(t);var r=o-this.lastPointX,e=s-this.lastPointY;if(this.lastPointX=o,this.lastPointY=s,this.moved||this.indicatorNotMoved(r,e)||(this.moved=!0,this.scroll.scroller.hooks.trigger(this.scroll.scroller.hooks.eventTypes.scrollStart)),this.moved){var n=this.getBScrollPosByRatio(this.currentPos,r,e);this.syncBScroll(n)}}},t.prototype.end=function(t){if(this.initiated&&(this.initiated=!1,a(t),this.moved)){var i=this.scroll,o=i.x,s=i.y;this.scroll.scroller.hooks.trigger(this.scroll.scroller.hooks.eventTypes.scrollEnd,{x:o,y:s})}},t.prototype.getBScrollPosByRatio=function(t,i,o){var s=t.x,r=t.y,n=this.scroll,a=n.hasHorizontalScroll,l=n.hasVerticalScroll,h=n.minScrollX,c=n.maxScrollX,p=n.minScrollY,d=n.maxScrollY,m=this.scroll,u=m.x,v=m.y;if(a){var f=Object(e.m)(s+i,Math.min(this.minScrollX,this.maxScrollX),Math.max(this.minScrollX,this.maxScrollX)),y=Math.round(f/this.ratioX*this.translateXSign);u=Object(e.m)(y,c,h)}if(l){var S=Object(e.m)(r+o,Math.min(this.minScrollY,this.maxScrollY),Math.max(this.minScrollY,this.maxScrollY)),g=Math.round(S/this.ratioY*this.translateYSign);v=Object(e.m)(g,d,p)}return{x:u,y:v}},t.prototype.indicatorNotMoved=function(t,i){var o=this.currentPos,s=o.x,r=o.y,e=s===this.minScrollX&&t<=0||s===this.maxScrollX&&t>=0,n=r===this.minScrollY&&i<=0||r===this.maxScrollY&&i>=0;return e&&n},t.prototype.syncBScroll=function(t){var i=Object(e.y)(),o=this.scroll,s=o.options,r=o.scroller,n=s.probeType,a=s.momentumLimitTime;r.translater.translate(t),i-this.startTime>a&&(this.startTime=i,n===e.j.Throttle&&r.hooks.trigger(r.hooks.eventTypes.scroll,t)),n>e.j.Throttle&&r.hooks.trigger(r.hooks.eventTypes.scroll,t)},t.prototype.updatePosition=function(t){var i=this.getIndicatorPosByRatio(t);this.applyTransformProperty(i),this.currentPos=n({},i)},t.prototype.applyTransformProperty=function(t){var i=this.scroll.options.translateZ,o=["translateX("+t.x+"px)","translateY("+t.y+"px)",""+i];this.indicatorEl.style[e.P.transform]=o.join(" ")},t.prototype.getIndicatorPosByRatio=function(t){var i=t.x,o=t.y,s=this.scroll,r=s.hasHorizontalScroll,a=s.hasVerticalScroll,l=n({},this.currentPos);if(r){var h=Math.round(this.ratioX*i*this.translateXSign);l.x=Object(e.m)(h,Math.min(this.minScrollX,this.maxScrollX),Math.max(this.minScrollX,this.maxScrollX))}if(a){var c=Math.round(this.ratioY*o*this.translateYSign);l.y=Object(e.m)(c,Math.min(this.minScrollY,this.maxScrollY),Math.max(this.minScrollY,this.maxScrollY))}return l},t.prototype.destroy=function(){!1!==this.options.interactive&&(this.startEventRegister.destroy(),this.moveEventRegister.destroy(),this.endEventRegister.destroy()),this.hooksFn.forEach((function(t){var i=t[0],o=t[1],s=t[2];i.off(o,s)})),this.hooksFn.length=0},t}(),h=function(){function t(t){this.scroll=t,this.options=[],this.indicators=[],this.handleOptions(),this.handleHooks()}return t.prototype.handleOptions=function(){var t=this.scroll.options.indicators;Object(e.l)(Array.isArray(t),"'indicators' must be an array.");for(var i=0,o=t;i<o.length;i++){var s=o[i];Object(e.l)(!!s.relationElement,"'relationElement' must be a HTMLElement."),this.createIndicators(s)}},t.prototype.createIndicators=function(t){this.indicators.push(new l(this.scroll,t))},t.prototype.handleHooks=function(){var t=this,i=this.scroll.hooks;i.on(i.eventTypes.destroy,(function(){for(var i=0,o=t.indicators;i<o.length;i++){o[i].destroy()}t.indicators=[]}))},t.pluginName="indicators",t}();i.a=h},520:function(t,i,o){},593:function(t,i,o){t.exports=o.p+"assets/img/dinner.feac964a.jpg"},594:function(t,i,o){"use strict";o(520)},745:function(t,i,o){"use strict";o.r(i);var s=o(436),r=o(499),e=o(593),n=o.n(e);s.a.use(r.a);var a={created:function(){this.dinnerLink=n.a},mounted:function(){this.initScroll()},methods:{initScroll:function(){this.scroll=new s.a(this.$refs.wrapper,{startX:-50,startY:-50,freeScroll:!0,bounce:!1,indicators:[{relationElement:this.$refs.indicatorWrapper,relationElementHandleElementIndex:1}]})}}},l=(o(594),o(41)),h=Object(l.a)(a,(function(){var t=this._self._c;return t("div",{staticClass:"minimap-container"},[t("div",{ref:"wrapper",staticClass:"scroll-wrapper"},[t("img",{staticClass:"scroll-content",style:{maxWidth:"none"},attrs:{src:this.dinnerLink}})]),this._v(" "),t("div",{ref:"indicatorWrapper",staticClass:"scroll-indicator"},[t("img",{staticClass:"scroll-indicator-bg",attrs:{src:this.dinnerLink}}),this._v(" "),t("div",{staticClass:"scroll-indicator-handle"})])])}),[],!1,null,"ac84d20e",null);i.default=h.exports}}]);
|