1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[21],{462:function(o,t,s){"use strict";var e=s(435),r=[{key:"putAt",name:"putAt"}].map((function(o){return{key:o.key,sourceKey:"plugins.movable."+o.name}})),i=function(){function o(o){this.scroll=o,this.handleBScroll(),this.handleHooks()}return o.prototype.handleBScroll=function(){this.scroll.proxy(r)},o.prototype.handleHooks=function(){var o=this;this.hooksFn=[];var t=this.scroll.scroller,s=t.scrollBehaviorX,e=t.scrollBehaviorY,r=function(o,t){o.maxScrollPos>0&&(o.minScrollPos=t.wrapperSize-t.contentSize,o.maxScrollPos=0)};this.registerHooks(s.hooks,s.hooks.eventTypes.ignoreHasScroll,(function(){return!0})),this.registerHooks(s.hooks,s.hooks.eventTypes.computeBoundary,(function(o){r(o,s)})),this.registerHooks(e.hooks,e.hooks.eventTypes.ignoreHasScroll,(function(){return!0})),this.registerHooks(e.hooks,e.hooks.eventTypes.computeBoundary,(function(o){r(o,e)})),this.registerHooks(this.scroll.hooks,this.scroll.hooks.eventTypes.destroy,(function(){o.destroy()}))},o.prototype.putAt=function(o,t,s,r){void 0===s&&(s=this.scroll.options.bounceTime),void 0===r&&(r=e.r.bounce);var i=this.resolvePostion(o,t);this.scroll.scrollTo(i.x,i.y,s,r)},o.prototype.resolvePostion=function(o,t){var s=this.scroll.scroller,e=s.scrollBehaviorX,r=s.scrollBehaviorY,i={left:function(){return 0},top:function(){return 0},right:function(){return e.minScrollPos},bottom:function(){return r.minScrollPos},center:function(o){return(0===o?e.minScrollPos:r.minScrollPos)/2}};return{x:"number"==typeof o?o:i[o](0),y:"number"==typeof t?t:i[t](1)}},o.prototype.destroy=function(){this.hooksFn.forEach((function(o){var t=o[0],s=o[1],e=o[2];t.off(s,e)})),this.hooksFn.length=0},o.prototype.registerHooks=function(o,t,s){o.on(t,s,this),this.hooksFn.push([o,t,s])},o.pluginName="movable",o.applyOrder=e.a.Pre,o}();t.a=i},479:function(o,t,s){"use strict";var e=[{key:"zoomTo",name:"zoomTo"}].map((function(o){return{key:o.key,sourceKey:"plugins.zoom."+o.name}})),r=s(435),i=function(){function o(o){this.scroll=o,this.scale=1,this.prevScale=1,this.init()}return o.prototype.init=function(){this.handleBScroll(),this.handleOptions(),this.handleHooks(),this.tryInitialZoomTo(this.zoomOpt)},o.prototype.zoomTo=function(o,t,s,e){var r=this.resolveOrigin(t,s),i={x:r.originX,y:r.originY,baseScale:this.scale};this._doZoomTo(o,i,e,!0)},o.prototype.handleBScroll=function(){this.scroll.proxy(e),this.scroll.registerType(["beforeZoomStart","zoomStart","zooming","zoomEnd"])},o.prototype.handleOptions=function(){var o=!0===this.scroll.options.zoom?{}:this.scroll.options.zoom;this.zoomOpt=Object(r.t)({start:1,min:1,max:4,initialOrigin:[0,0],minimalZoomDistance:5,bounceTime:800},o)},o.prototype.handleHooks=function(){var o=this,t=this.scroll,s=this.scroll.scroller;this.wrapper=this.scroll.scroller.wrapper,this.setTransformOrigin(this.scroll.scroller.content);var e=s.scrollBehaviorX,i=s.scrollBehaviorY;this.hooksFn=[],this.registerHooks(t.hooks,t.hooks.eventTypes.contentChanged,(function(t){o.setTransformOrigin(t),o.scale=1,o.tryInitialZoomTo(o.zoomOpt)})),this.registerHooks(t.hooks,t.hooks.eventTypes.beforeInitialScrollTo,(function(){if(1!==o.zoomOpt.start)return!0})),this.registerHooks(e.hooks,e.hooks.eventTypes.beforeComputeBoundary,(function(){var t=Object(r.z)(o.scroll.scroller.content);e.contentSize=Math.floor(t.width*o.scale)})),this.registerHooks(i.hooks,i.hooks.eventTypes.beforeComputeBoundary,(function(){var t=Object(r.z)(o.scroll.scroller.content);i.contentSize=Math.floor(t.height*o.scale)})),this.registerHooks(s.actions.hooks,s.actions.hooks.eventTypes.start,(function(t){var s=t.touches&&t.touches.length||0;o.fingersOperation(s),2===s&&o.zoomStart(t)})),this.registerHooks(s.actions.hooks,s.actions.hooks.eventTypes.beforeMove,(function(t){var s=t.touches&&t.touches.length||0;if(o.fingersOperation(s),2===s)return o.zoom(t),!0})),this.registerHooks(s.actions.hooks,s.actions.hooks.eventTypes.beforeEnd,(function(t){if(2===o.fingersOperation())return o.zoomEnd(),!0})),this.registerHooks(s.translater.hooks,s.translater.hooks.eventTypes.beforeTranslate,(function(t,s){var e=s.scale?s.scale:o.prevScale;o.prevScale=e,t.push("scale("+e+")")})),this.registerHooks(s.hooks,s.hooks.eventTypes.scrollEnd,(function(){2===o.fingersOperation()&&o.scroll.trigger(o.scroll.eventTypes.zoomEnd,{scale:o.scale})})),this.registerHooks(this.scroll.hooks,"destroy",this.destroy)},o.prototype.setTransformOrigin=function(o){o.style[r.P.transformOrigin]="0 0"},o.prototype.tryInitialZoomTo=function(o){var t=o.start,s=o.initialOrigin,e=this.scroll.scroller,r=e.scrollBehaviorX,i=e.scrollBehaviorY;1!==t&&(this.resetBoundaries([r,i]),this.zoomTo(t,s[0],s[1],0))},o.prototype.fingersOperation=function(o){if("number"!=typeof o)return this.numberOfFingers;this.numberOfFingers=o},o.prototype._doZoomTo=function(o,t,s,e){var i=this;void 0===s&&(s=this.zoomOpt.bounceTime),void 0===e&&(e=!1);var n=this.zoomOpt,c=n.min,l=n.max,a=this.scale,h=Object(r.m)(o,c,l);!function(){if(0!==s){if(s>0){var o,t=Object(r.y)(),e=t+s,n=function(){var c=Object(r.y)();if(c>=e)return i.scroll.trigger(i.scroll.eventTypes.zooming,{scale:h}),void Object(r.n)(o);var l=r.r.bounce.fn((c-t)/s)*(h-a)+a;i.scroll.trigger(i.scroll.eventTypes.zooming,{scale:l}),o=Object(r.O)(n)};n()}}else i.scroll.trigger(i.scroll.eventTypes.zooming,{scale:h})}(),this.fingersOperation(2),this._zoomTo(h,a,t,s,e)},o.prototype._zoomTo=function(o,t,s,e,i){void 0===i&&(i=!1);var n=o/s.baseScale;this.setScale(o);var c=this.scroll.scroller,l=c.scrollBehaviorX,a=c.scrollBehaviorY;this.resetBoundaries([l,a]);var h=this.getNewPos(s.x,n,l,!0,i),u=this.getNewPos(s.y,n,a,!0,i);l.currentPos===Math.round(h)&&a.currentPos===Math.round(u)&&o===t||c.scrollTo(h,u,e,r.r.bounce,{start:{scale:t},end:{scale:o}})},o.prototype.resolveOrigin=function(o,t){var s=this.scroll.scroller,e=s.scrollBehaviorX,r=s.scrollBehaviorY,i={left:function(){return 0},top:function(){return 0},right:function(){return e.contentSize},bottom:function(){return r.contentSize},center:function(o){return(0===o?e.contentSize:r.contentSize)/2}};return{originX:"number"==typeof o?o:i[o](0),originY:"number"==typeof t?t:i[t](1)}},o.prototype.zoomStart=function(o){var t=o.touches[0],s=o.touches[1];this.startDistance=this.getFingerDistance(o),this.startScale=this.scale;var e=Object(r.J)(this.wrapper),i=e.left,n=e.top;this.origin={x:Math.abs(t.pageX+s.pageX)/2+i-this.scroll.x,y:Math.abs(t.pageY+s.pageY)/2+n-this.scroll.y,baseScale:this.startScale},this.scroll.trigger(this.scroll.eventTypes.beforeZoomStart)},o.prototype.zoom=function(o){var t=this.getFingerDistance(o);if(this.zoomed||!(Math.abs(t-this.startDistance)<this.zoomOpt.minimalZoomDistance)){var s=this.dampingScale(t/this.startDistance*this.startScale),e=s/this.startScale;this.setScale(s),this.zoomed||(this.zoomed=!0,this.scroll.trigger(this.scroll.eventTypes.zoomStart));var r=this.scroll.scroller,i=r.scrollBehaviorX,n=r.scrollBehaviorY,c=this.getNewPos(this.origin.x,e,i,!1,!1),l=this.getNewPos(this.origin.y,e,n,!1,!1);this.scroll.trigger(this.scroll.eventTypes.zooming,{scale:this.scale}),r.translater.translate({x:c,y:l,scale:s})}},o.prototype.zoomEnd=function(){this.zoomed&&(this.shouldRebound()?this._doZoomTo(this.scale,this.origin,this.zoomOpt.bounceTime):this.scroll.trigger(this.scroll.eventTypes.zoomEnd,{scale:this.scale}))},o.prototype.getFingerDistance=function(o){var t=o.touches[0],s=o.touches[1],e=Math.abs(t.pageX-s.pageX),i=Math.abs(t.pageY-s.pageY);return Object(r.w)(e,i)},o.prototype.shouldRebound=function(){var o=this.zoomOpt,t=o.min,s=o.max,e=this.scale;if(e!==Object(r.m)(e,t,s))return!0;var i=this.scroll.scroller,n=i.scrollBehaviorX,c=i.scrollBehaviorY;this.resetBoundaries([n,c]);var l=n.checkInBoundary().inBoundary,a=n.checkInBoundary().inBoundary;return!(l&&a)},o.prototype.dampingScale=function(o){var t=this.zoomOpt,s=t.min,e=t.max;return o<s?o=.5*s*Math.pow(2,o/s):o>e&&(o=2*e*Math.pow(.5,e/o)),o},o.prototype.setScale=function(o){this.scale=o},o.prototype.resetBoundaries=function(o){o.forEach((function(o){return o.computeBoundary()}))},o.prototype.getNewPos=function(o,t,s,e,i){void 0===i&&(i=!1);var n=o-o*t+(i?s.currentPos:s.startPos);return e&&(n=Object(r.m)(n,s.maxScrollPos,s.minScrollPos)),n>0?Math.floor(n):Math.ceil(n)},o.prototype.registerHooks=function(o,t,s){o.on(t,s,this),this.hooksFn.push([o,t,s])},o.prototype.destroy=function(){this.hooksFn.forEach((function(o){var t=o[0],s=o[1],e=o[2];t.off(s,e)})),this.hooksFn.length=0},o.pluginName="zoom",o}();t.a=i},531:function(o,t,s){},690:function(o,t,s){o.exports=s.p+"assets/img/ftstr.ca5d5288.png"},691:function(o,t,s){o.exports=s.p+"assets/img/qos_crop.85516b28.png"},692:function(o,t,s){"use strict";s(531)},755:function(o,t,s){"use strict";s.r(t);var e=s(436),r=s(462),i=s(479),n=s(690),c=s.n(n),l=s(691),a=s.n(l);e.a.use(r.a),e.a.use(i.a);var h={created:function(){this.swordsmanLink=c.a,this.witchLink=a.a},mounted:function(){this.init()},beforeDestroy:function(){this.bs1.destroy(),this.bs2.destroy()},methods:{handleClick:function(){this.bs2.putAt("right","bottom",500)},init:function(){this.bs1=new e.a(this.$refs.scroll,{bindToTarget:!0,scrollX:!0,scrollY:!0,freeScroll:!0,movable:!0,zoom:{start:1.2,min:.5,max:3}}),this.bs1.putAt("center","center",0),this.bs2=new e.a(this.$refs.scroll,{specifiedIndexAsContent:1,bindToTarget:!0,scrollX:!0,scrollY:!0,freeScroll:!0,movable:!0,startY:150,zoom:{start:1,min:.5,max:3}})}}},u=(s(692),s(41)),p=Object(u.a)(h,(function(){var o=this,t=o._self._c;return t("div",{staticClass:"movable-multi-content-scale-container"},[t("div",{ref:"scroll",staticClass:"scroll-wrapper"},[t("div",{staticClass:"scroll-content content1"},[t("figure",[t("figcaption",[o._v("Swordsman")]),o._v(" "),t("img",{staticClass:"picture",attrs:{src:o.swordsmanLink,alt:"ftstr"}})])]),o._v(" "),t("div",{staticClass:"scroll-content content2"},[t("figure",[t("figcaption",[o._v("The Witch")]),o._v(" "),t("img",{staticClass:"picture",attrs:{src:o.witchLink,alt:"qos_crop"}})])])]),o._v(" "),t("button",{staticClass:"btn",on:{click:o.handleClick}},[o._v("Put The Witch at right-bottom corner")])])}),[],!1,null,"6a45ed20",null);t.default=p.exports}}]);
|