New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-zoomer

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-zoomer - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

6

dist/vue-zoomer.js

@@ -7,9 +7,9 @@ parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r},p.cache={};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({"4PZ+":[function(require,module,exports) {

},{}],"7edH":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("lodash.debounce")),e=i(require("./TapDetector"));function i(t){return t&&t.__esModule?t:{default:t}}var n={props:{minScale:{type:Number,default:1},maxScale:{type:Number,default:5},zoomed:{type:Boolean,default:!1},resetTrigger:{type:Number,default:1e5},aspectRatio:{type:Number,default:1},backgroundColor:{type:String,default:"transparent"},pivot:{type:String,default:"cursor"},limitTranslation:{type:Boolean,default:!0}},data:function(){return{containerWidth:1,containerHeight:1,containerLeft:0,containerTop:0,translateX:0,animTranslateX:0,translateY:0,animTranslateY:0,scale:1,animScale:1,lastFullWheelTime:0,isPointerDown:!1,pointerPosX:-1,pointerPosY:-1,twoFingerInitDist:0,panLocked:!0,raf:null,tapDetector:null}},computed:{wrapperStyle:function(){var t=this.containerWidth*this.animTranslateX,e=this.containerHeight*this.animTranslateY;return{transform:["translate(".concat(t,"px, ").concat(e,"px)"),"scale(".concat(this.animScale,")")].join(" ")}}},watch:{scale:function(t){1!==t&&(this.$emit("update:zoomed",!0),this.panLocked=!1)},resetTrigger:"reset"},mounted:function(){this.tapDetector=new e.default,this.tapDetector.attach(this.$el),this.tapDetector.onDoubleTap(this.onDoubleTap),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this.loop()},destroyed:function(){this.tapDetector.detach(this.$el),window.removeEventListener("resize",this.onWindowResize),window.cancelAnimationFrame(this.raf)},methods:{tryToScale:function(t){var e=this.scale*t;if(e<this.minScale||e>this.maxScale){var i=Math.log2(t);i*=.2,t=Math.pow(2,i),e=this.scale*t}if(t=e/this.scale,this.scale=e,"image-center"!==this.pivot){var n=(this.pointerPosX-this.containerLeft)/this.containerWidth,s=(this.pointerPosY-this.containerTop)/this.containerHeight;this.translateX=(.5+this.translateX-n)*t+n-.5,this.translateY=(.5+this.translateY-s)*t+s-.5}},onPointerMove:function(t,e){if(this.isPointerDown){var i=t-this.pointerPosX,n=e-this.pointerPosY;this.panLocked||(this.translateX+=i/this.containerWidth,this.translateY+=n/this.containerHeight)}this.pointerPosX=t,this.pointerPosY=e},onInteractionEnd:(0,t.default)(function(){this.limit(),this.panLocked=1===this.scale,this.$emit("update:zoomed",!this.panLocked)},100),limit:function(){if(this.scale<this.minScale?this.scale=this.minScale:this.scale>this.maxScale&&this.tryToScale(this.maxScale/this.scale),this.limitTranslation){var t=this.calcTranslateLimit();Math.abs(this.translateX)>t.x&&(this.translateX*=t.x/Math.abs(this.translateX)),Math.abs(this.translateY)>t.y&&(this.translateY*=t.y/Math.abs(this.translateY))}},calcTranslateLimit:function(){if("y"===this.getMarginDirection()){var t=this.containerWidth/this.aspectRatio/this.containerHeight,e=(this.scale*t-1)/2;return e<0&&(e=0),{x:(this.scale-1)/2,y:e}}var i=this.containerHeight*this.aspectRatio/this.containerWidth,n=(this.scale*i-1)/2;return n<0&&(n=0),{x:n,y:(this.scale-1)/2}},getMarginDirection:function(){return this.containerWidth/this.containerHeight>this.aspectRatio?"x":"y"},onDoubleTap:function(t){1===this.scale?(t.clientX>0&&(this.pointerPosX=t.clientX,this.pointerPosY=t.clientY),this.tryToScale(Math.min(3,this.maxScale))):this.reset(),this.onInteractionEnd()},reset:function(){this.scale=1,this.panLocked=!0,this.translateX=0,this.translateY=0},onWindowResize:function(){var t=window.getComputedStyle(this.$el);this.containerWidth=parseFloat(t.width),this.containerHeight=parseFloat(t.height),this.limit()},refreshContainerPos:function(){this.containerLeft=+this.$el.offsetLeft||0,this.containerTop=+this.$el.offsetTop||0},loop:function(){this.animScale=this.gainOn(this.animScale,this.scale),this.animTranslateX=this.gainOn(this.animTranslateX,this.translateX),this.animTranslateY=this.gainOn(this.animTranslateY,this.translateY),this.raf=window.requestAnimationFrame(this.loop)},gainOn:function(t,e){var i=.3*(e-t);return Math.abs(i)>1e-5?t+i:e},onMouseWheel:function(t){if(120===Math.abs(t.wheelDelta)){var e=Date.now();e-this.lastFullWheelTime>50&&(this.onMouseWheelDo(t),this.lastFullWheelTime=e)}else this.onMouseWheelDo(t)},onMouseWheelDo:function(t){var e=Math.pow(1.25,t.wheelDelta/120);this.tryToScale(e),this.onInteractionEnd()},onMouseDown:function(t){this.refreshContainerPos(),this.isPointerDown=!0,this.pointerPosX=t.clientX,this.pointerPosY=t.clientY},onMouseUp:function(t){this.isPointerDown=!1,this.onInteractionEnd()},onMouseMove:function(t){this.onPointerMove(t.clientX,t.clientY)},onTouchStart:function(t){if(1===t.touches.length)this.refreshContainerPos(),this.pointerPosX=t.touches[0].clientX,this.pointerPosY=t.touches[0].clientY,this.isPointerDown=!0;else if(2===t.touches.length){this.isPointerDown=!0,this.pointerPosX=(t.touches[0].clientX+t.touches[1].clientX)/2,this.pointerPosY=(t.touches[0].clientY+t.touches[1].clientY)/2;var e=t.touches[0].clientX-t.touches[1].clientX,i=t.touches[0].clientY-t.touches[1].clientY;this.twoFingerInitDist=Math.sqrt(e*e+i*i)}},onTouchEnd:function(t){0===t.touches.length?(this.isPointerDown=!1,Math.abs(this.scale-1)<.1&&(this.scale=1),this.onInteractionEnd()):1===t.touches.length&&(this.pointerPosX=t.touches[0].clientX,this.pointerPosY=t.touches[0].clientY)},onTouchMove:function(t){if(1===t.touches.length)this.onPointerMove(t.touches[0].clientX,t.touches[0].clientY);else if(2===t.touches.length){var e=(t.touches[0].clientX+t.touches[1].clientX)/2,i=(t.touches[0].clientY+t.touches[1].clientY)/2;this.onPointerMove(e,i),this.pointerPosX=e,this.pointerPosY=i;var n=t.touches[0].clientX-t.touches[1].clientX,s=t.touches[0].clientY-t.touches[1].clientY,o=Math.sqrt(n*n+s*s);this.tryToScale(o/this.twoFingerInitDist),this.twoFingerInitDist=o}}}};exports.default=n;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("lodash.debounce")),e=i(require("./TapDetector"));function i(t){return t&&t.__esModule?t:{default:t}}var n={props:{minScale:{type:Number,default:1},maxScale:{type:Number,default:5},zoomed:{type:Boolean,default:!1},resetTrigger:{type:Number,default:1e5},aspectRatio:{type:Number,default:1},backgroundColor:{type:String,default:"transparent"},pivot:{type:String,default:"cursor"},limitTranslation:{type:Boolean,default:!0}},data:function(){return{containerWidth:1,containerHeight:1,containerLeft:0,containerTop:0,translateX:0,animTranslateX:0,translateY:0,animTranslateY:0,scale:1,animScale:1,lastFullWheelTime:0,lastWheelTime:0,lastWheelDirection:"x",isPointerDown:!1,pointerPosX:-1,pointerPosY:-1,twoFingerInitDist:0,panLocked:!0,raf:null,tapDetector:null}},computed:{wrapperStyle:function(){var t=this.containerWidth*this.animTranslateX,e=this.containerHeight*this.animTranslateY;return{transform:["translate(".concat(t,"px, ").concat(e,"px)"),"scale(".concat(this.animScale,")")].join(" ")}}},watch:{scale:function(t){1!==t&&(this.$emit("update:zoomed",!0),this.panLocked=!1)},resetTrigger:"reset"},mounted:function(){this.tapDetector=new e.default,this.tapDetector.attach(this.$el),this.tapDetector.onDoubleTap(this.onDoubleTap),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this.loop()},destroyed:function(){this.tapDetector.detach(this.$el),window.removeEventListener("resize",this.onWindowResize),window.cancelAnimationFrame(this.raf)},methods:{tryToScale:function(t){var e=this.scale*t;if(e<this.minScale||e>this.maxScale){var i=Math.log2(t);i*=.2,t=Math.pow(2,i),e=this.scale*t}if(t=e/this.scale,this.scale=e,"image-center"!==this.pivot){var n=(this.pointerPosX-this.containerLeft)/this.containerWidth,s=(this.pointerPosY-this.containerTop)/this.containerHeight;this.translateX=(.5+this.translateX-n)*t+n-.5,this.translateY=(.5+this.translateY-s)*t+s-.5}},onPointerMove:function(t,e){if(this.isPointerDown){var i=t-this.pointerPosX,n=e-this.pointerPosY;this.panLocked||(this.translateX+=i/this.containerWidth,this.translateY+=n/this.containerHeight)}this.pointerPosX=t,this.pointerPosY=e},onInteractionEnd:(0,t.default)(function(){this.limit(),this.panLocked=1===this.scale,this.$emit("update:zoomed",!this.panLocked)},100),limit:function(){if(this.scale<this.minScale?this.scale=this.minScale:this.scale>this.maxScale&&this.tryToScale(this.maxScale/this.scale),this.limitTranslation){var t=this.calcTranslateLimit();Math.abs(this.translateX)>t.x&&(this.translateX*=t.x/Math.abs(this.translateX)),Math.abs(this.translateY)>t.y&&(this.translateY*=t.y/Math.abs(this.translateY))}},calcTranslateLimit:function(){if("y"===this.getMarginDirection()){var t=this.containerWidth/this.aspectRatio/this.containerHeight,e=(this.scale*t-1)/2;return e<0&&(e=0),{x:(this.scale-1)/2,y:e}}var i=this.containerHeight*this.aspectRatio/this.containerWidth,n=(this.scale*i-1)/2;return n<0&&(n=0),{x:n,y:(this.scale-1)/2}},getMarginDirection:function(){return this.containerWidth/this.containerHeight>this.aspectRatio?"x":"y"},onDoubleTap:function(t){1===this.scale?(t.clientX>0&&(this.pointerPosX=t.clientX,this.pointerPosY=t.clientY),this.tryToScale(Math.min(3,this.maxScale))):this.reset(),this.onInteractionEnd()},reset:function(){this.scale=1,this.panLocked=!0,this.translateX=0,this.translateY=0},onWindowResize:function(){var t=window.getComputedStyle(this.$el);this.containerWidth=parseFloat(t.width),this.containerHeight=parseFloat(t.height),this.limit()},refreshContainerPos:function(){this.containerLeft=+this.$el.offsetLeft||0,this.containerTop=+this.$el.offsetTop||0},loop:function(){this.animScale=this.gainOn(this.animScale,this.scale),this.animTranslateX=this.gainOn(this.animTranslateX,this.translateX),this.animTranslateY=this.gainOn(this.animTranslateY,this.translateY),this.raf=window.requestAnimationFrame(this.loop)},gainOn:function(t,e){var i=.3*(e-t);return Math.abs(i)>1e-5?t+i:e},onMouseWheel:function(t){var e=Date.now();120===Math.abs(t.wheelDelta)?e-this.lastFullWheelTime>50&&(this.onMouseWheelDo(t),this.lastFullWheelTime=e):(e-this.lastWheelTime>50&&"number"==typeof t.deltaX&&(this.lastWheelDirection=Math.abs(t.deltaX)>Math.abs(t.deltaY)?"x":"y","x"===this.lastWheelDirection&&this.$emit("swipe",t.deltaX>0?"left":"right")),"y"===this.lastWheelDirection&&this.onMouseWheelDo(t)),this.lastWheelTime=e},onMouseWheelDo:function(t){var e=Math.pow(1.25,t.wheelDelta/120);this.tryToScale(e),this.onInteractionEnd()},onScroll:function(t){console.log(2)},onMouseDown:function(t){this.refreshContainerPos(),this.isPointerDown=!0,this.pointerPosX=t.clientX,this.pointerPosY=t.clientY},onMouseUp:function(t){this.isPointerDown=!1,this.onInteractionEnd()},onMouseMove:function(t){this.onPointerMove(t.clientX,t.clientY)},onTouchStart:function(t){if(1===t.touches.length)this.refreshContainerPos(),this.pointerPosX=t.touches[0].clientX,this.pointerPosY=t.touches[0].clientY,this.isPointerDown=!0;else if(2===t.touches.length){this.isPointerDown=!0,this.pointerPosX=(t.touches[0].clientX+t.touches[1].clientX)/2,this.pointerPosY=(t.touches[0].clientY+t.touches[1].clientY)/2;var e=t.touches[0].clientX-t.touches[1].clientX,i=t.touches[0].clientY-t.touches[1].clientY;this.twoFingerInitDist=Math.sqrt(e*e+i*i)}},onTouchEnd:function(t){0===t.touches.length?(this.isPointerDown=!1,Math.abs(this.scale-1)<.1&&(this.scale=1),this.onInteractionEnd()):1===t.touches.length&&(this.pointerPosX=t.touches[0].clientX,this.pointerPosY=t.touches[0].clientY)},onTouchMove:function(t){if(1===t.touches.length)this.onPointerMove(t.touches[0].clientX,t.touches[0].clientY);else if(2===t.touches.length){var e=(t.touches[0].clientX+t.touches[1].clientX)/2,i=(t.touches[0].clientY+t.touches[1].clientY)/2;this.onPointerMove(e,i),this.pointerPosX=e,this.pointerPosY=i;var n=t.touches[0].clientX-t.touches[1].clientX,s=t.touches[0].clientY-t.touches[1].clientY,o=Math.sqrt(n*n+s*s);this.tryToScale(o/this.twoFingerInitDist),this.twoFingerInitDist=o}}}};exports.default=n;
(function(){var o=exports.default||module.exports;"function"==typeof o&&(o=o.options),Object.assign(o,{render:function(){var o=this,e=o.$createElement,t=o._self._c||e;return t("div",{staticClass:"vue-zoomer",style:{backgroundColor:o.backgroundColor},on:{mousewheel:function(e){return e.preventDefault(),o.onMouseWheel(e)},mousedown:o.onMouseDown,mouseup:o.onMouseUp,mousemove:o.onMouseMove,touchstart:o.onTouchStart,touchend:o.onTouchEnd,touchmove:o.onTouchMove}},[t("div",{staticClass:"zoomer",style:o.wrapperStyle},[o._t("default")],2)])},staticRenderFns:[],_compiled:!0,_scopeId:"data-v-20389a",functional:void 0});})();
},{"lodash.debounce":"4PZ+","./TapDetector":"li1N"}],"Twlx":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=50,e={props:{value:{type:Number,required:!0},list:{type:Array,required:!0},backgroundColor:{type:String,default:"#333"},pivot:{type:String,default:"cursor"},limitTranslation:{type:Boolean,default:!0}},data:function(){return{containerWidth:1,containerHeight:1,selIndex:this.value,animSelIndex:this.value,currentZoomed:!1,autoSliding:!1,imageAspectRatios:[],isPointerDown:!1,lastPointerX:0,slideOffsetX:0}},computed:{middleStyle:function(){return{left:"".concat(0+this.slideOffsetX,"px")}},leftStyle:function(){return{left:"".concat(-this.containerWidth+this.slideOffsetX,"px")}},rightStyle:function(){return{left:"".concat(this.containerWidth+this.slideOffsetX,"px")}},slideThresh:function(){return Math.max(t,.1*this.containerWidth)}},watch:{value:function(t){t!==this.animSelIndex&&(this.selIndex=t,this.animSelIndex=t)}},mounted:function(){window.addEventListener("resize",this.onWindowResize),this.onWindowResize()},destroyed:function(){window.removeEventListener("resize",this.onWindowResize)},methods:{reset:function(){this.$refs.zoomers.forEach(function(t){t.reset()})},onWindowResize:function(){var t=window.getComputedStyle(this.$el);this.containerWidth=parseFloat(t.width),this.containerHeight=parseFloat(t.height)},onPointerMove:function(t){if(this.isPointerDown&&!this.currentZoomed){var e=0===this.selIndex&&t>0&&this.slideOffsetX+t>0||this.selIndex===this.list.length-1&&t<0&&this.slideOffsetX+t<0?.3:1;this.slideOffsetX+=t*e}},onPointerUp:function(){this.slideOffsetX<-this.slideThresh?this.paginate(1):this.slideOffsetX>this.slideThresh?this.paginate(-1):this.paginate(0)},paginate:function(t){var e=this,i=this.selIndex+t;i<0||i>=this.list.length?this.slideOffsetX=0:(this.slideOffsetX=this.containerWidth*-t,this.autoSliding=!0,this.$emit("input",i),this.animSelIndex=i,setTimeout(function(){e.selIndex=i,e.slideOffsetX=0,e.autoSliding=!1},400))},onMouseDown:function(t){this.isPointerDown=!0,this.lastPointerX=t.clientX},onMouseUp:function(t){this.isPointerDown=!1,this.onPointerUp()},onMouseMove:function(t){this.isPointerDown&&(this.onPointerMove(t.clientX-this.lastPointerX),this.lastPointerX=t.clientX)},onTouchStart:function(t){1===t.touches.length&&(this.isPointerDown=!0,this.lastPointerX=t.touches[0].clientX)},onTouchEnd:function(t){0===t.touches.length&&(this.isPointerDown=!1,this.onPointerUp())},onTouchMove:function(t){1===t.touches.length&&(this.onPointerMove(t.touches[0].clientX-this.lastPointerX),this.lastPointerX=t.touches[0].clientX)},onImageLoad:function(t,e){var i=e.target.naturalWidth/e.target.naturalHeight;this.$set(this.imageAspectRatios,t,i)}}};exports.default=e;
(function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,o=e.$createElement,t=e._self._c||o;return t("div",{staticClass:"vue-zoomer-gallery",class:{anim:e.autoSliding&&!e.isPointerDown},style:{"background-color":e.backgroundColor},on:{mousemove:e.onMouseMove,mousedown:e.onMouseDown,mouseout:function(o){e.isPointerDown=!1},mouseup:e.onMouseUp,touchstart:e.onTouchStart,touchend:e.onTouchEnd,touchmove:function(o){return o.preventDefault(),e.onTouchMove(o)}}},e._l(3,function(o,n){return t("v-zoomer",{key:n+e.selIndex,ref:"zoomers",refInFor:!0,staticClass:"slide",class:["left","middle","right"][n],style:[e.leftStyle,e.middleStyle,e.rightStyle][n],attrs:{"max-scale":10,zoomed:e.currentZoomed,"reset-trigger":n,"aspect-ratio":e.imageAspectRatios[e.selIndex+n-1]||1,pivot:e.pivot,"limit-translation":e.limitTranslation},on:{"update:zoomed":function(o){e.currentZoomed=o}}},[e.selIndex+n-1>-1&&e.selIndex+n-1<e.list.length?t("img",{staticStyle:{"object-fit":"contain",width:"100%",height:"100%"},attrs:{src:e.list[e.selIndex+n-1]},on:{load:function(o){return e.onImageLoad(e.selIndex+n-1,o)}}}):e._e()])}),1)},staticRenderFns:[],_compiled:!0,_scopeId:"data-v-822895",functional:void 0});})();
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=50,e={props:{value:{type:Number,required:!0},list:{type:Array,required:!0},backgroundColor:{type:String,default:"#333"},pivot:{type:String,default:"cursor"},limitTranslation:{type:Boolean,default:!0}},data:function(){return{containerWidth:1,containerHeight:1,selIndex:this.value,animSelIndex:this.value,currentZoomed:!1,autoSliding:!1,imageAspectRatios:[],isPointerDown:!1,lastPointerX:0,slideOffsetX:0}},computed:{middleStyle:function(){return{left:"".concat(0+this.slideOffsetX,"px")}},leftStyle:function(){return{left:"".concat(-this.containerWidth+this.slideOffsetX,"px")}},rightStyle:function(){return{left:"".concat(this.containerWidth+this.slideOffsetX,"px")}},slideThresh:function(){return Math.max(t,.1*this.containerWidth)}},watch:{value:function(t){t!==this.animSelIndex&&(this.selIndex=t,this.animSelIndex=t)}},mounted:function(){window.addEventListener("resize",this.onWindowResize),this.onWindowResize()},destroyed:function(){window.removeEventListener("resize",this.onWindowResize)},methods:{reset:function(){this.$refs.zoomers.forEach(function(t){t.reset()})},onWindowResize:function(){var t=window.getComputedStyle(this.$el);this.containerWidth=parseFloat(t.width),this.containerHeight=parseFloat(t.height)},onPointerMove:function(t){if(this.isPointerDown&&!this.currentZoomed){var e=0===this.selIndex&&t>0&&this.slideOffsetX+t>0||this.selIndex===this.list.length-1&&t<0&&this.slideOffsetX+t<0?.3:1;this.slideOffsetX+=t*e}},onPointerUp:function(){this.slideOffsetX<-this.slideThresh?this.paginate(1):this.slideOffsetX>this.slideThresh?this.paginate(-1):this.paginate(0)},paginate:function(t){var e=this,i=this.selIndex+t;i<0||i>=this.list.length?this.slideOffsetX=0:(this.slideOffsetX=this.containerWidth*-t,this.autoSliding=!0,this.$emit("input",i),this.animSelIndex=i,setTimeout(function(){e.selIndex=i,e.slideOffsetX=0,e.autoSliding=!1},400))},onMouseDown:function(t){this.isPointerDown=!0,this.lastPointerX=t.clientX},onMouseUp:function(t){this.isPointerDown=!1,this.onPointerUp()},onMouseMove:function(t){this.isPointerDown&&(this.onPointerMove(t.clientX-this.lastPointerX),this.lastPointerX=t.clientX)},onTouchStart:function(t){1===t.touches.length&&(this.isPointerDown=!0,this.lastPointerX=t.touches[0].clientX)},onTouchEnd:function(t){0===t.touches.length&&(this.isPointerDown=!1,this.onPointerUp())},onTouchMove:function(t){1===t.touches.length&&(this.onPointerMove(t.touches[0].clientX-this.lastPointerX),this.lastPointerX=t.touches[0].clientX)},onImageLoad:function(t,e){var i=e.target.naturalWidth/e.target.naturalHeight;this.$set(this.imageAspectRatios,t,i)},onImageSwipe:function(t){this.paginate("right"==t?-1:1)}}};exports.default=e;
(function(){var e=exports.default||module.exports;"function"==typeof e&&(e=e.options),Object.assign(e,{render:function(){var e=this,o=e.$createElement,t=e._self._c||o;return t("div",{staticClass:"vue-zoomer-gallery",class:{anim:e.autoSliding&&!e.isPointerDown},style:{"background-color":e.backgroundColor},on:{mousemove:e.onMouseMove,mousedown:e.onMouseDown,mouseout:e.onMouseUp,mouseup:e.onMouseUp,touchstart:e.onTouchStart,touchend:e.onTouchEnd,touchmove:function(o){return o.preventDefault(),e.onTouchMove(o)}}},e._l(3,function(o,n){return t("v-zoomer",{key:n+e.selIndex,ref:"zoomers",refInFor:!0,staticClass:"slide",class:["left","middle","right"][n],style:[e.leftStyle,e.middleStyle,e.rightStyle][n],attrs:{"max-scale":10,zoomed:e.currentZoomed,"reset-trigger":n,"aspect-ratio":e.imageAspectRatios[e.selIndex+n-1]||1,pivot:e.pivot,"limit-translation":e.limitTranslation},on:{"update:zoomed":function(o){e.currentZoomed=o},swipe:e.onImageSwipe}},[e.selIndex+n-1>-1&&e.selIndex+n-1<e.list.length?t("img",{staticStyle:{"object-fit":"contain",width:"100%",height:"100%"},attrs:{src:e.list[e.selIndex+n-1]},on:{load:function(o){return e.onImageLoad(e.selIndex+n-1,o)}}}):e._e()])}),1)},staticRenderFns:[],_compiled:!0,_scopeId:"data-v-822895",functional:void 0});})();
},{}],"Focm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./vue-zoomer.vue")),o=r(require("./vue-zoomer-gallery.vue"));function r(e){return e&&e.__esModule?e:{default:e}}var t={install:function(r){r.component("VZoomer",e.default),r.component("VZoomerGallery",o.default)}};exports.default=t;
},{"./vue-zoomer.vue":"7edH","./vue-zoomer-gallery.vue":"Twlx"}]},{},["Focm"], "VueZoomer")
{
"name": "vue-zoomer",
"version": "0.3.0",
"version": "0.3.1",
"description": "Zoom the image or other thing with mouse or touch",

@@ -5,0 +5,0 @@ "main": "dist/vue-zoomer.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc