Comparing version 7.2.0 to 7.2.1
/*! | ||
* zoom.ts v7.2.0 | ||
* zoom.ts v7.2.1 | ||
* https://www.michael-bull.com/projects/zoom.ts | ||
@@ -8,2 +8,2 @@ * | ||
*/ | ||
!function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="dist/",t(t.s=12)}([function(e,t,n){"use strict";function i(e){if("loading"!==document.readyState)return e();document.addEventListener("DOMContentLoaded",function(){return e()})}function o(){return(document.documentElement||document.body).clientWidth}function r(){return(document.documentElement||document.body).clientHeight}function s(){return void 0===window.pageYOffset?(document.documentElement||document.body).scrollTop:window.pageYOffset}function a(e){var t=document.createElement("div");return t.className=e,t}function c(e){var t=document.createElement("img");return t.className="zoom__clone",t.src=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.ready=i,t.viewportWidth=o,t.viewportHeight=r,t.scrollY=s,t.createDiv=a,t.createClone=c},function(e,t,n){"use strict";function i(e,t){return function(n,i,o,r){void 0!==n[e]?n[e](i,o,r):void 0!==n[t]?n[t]("on"+i,o,r):o(new Event(i))}}Object.defineProperty(t,"__esModule",{value:!0}),t.listeners={add:i("addEventListener","attachEvent"),remove:i("removeEventListener","detachEvent")}},function(e,t,n){"use strict";function i(){var e=r.vendorProperties("transform"),t=document.createElement("p"),n=t.style;return e.find(function(e){return void 0!==n[e]})}function o(e,n){e.style.setProperty(t.transformProperty,n)}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);t.transformProperty=i(),t.transform=o},function(e,t,n){"use strict";function i(e){var n=[e],i=""+e.charAt(0).toUpperCase()+e.substr(1);return t.vendorPrefixes.forEach(function(e){n.push(""+e+i)}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.vendorPrefixes=["Webkit","Moz","ms","O"],t.vendorProperties=i},function(e,t,n){"use strict";function i(e){N=e.cloneNode(!0),B=P.createDiv("zoom__container"),B.appendChild(N),S.replaceChild(B,e)}function o(e,t){H=!0,N=t,B=e,D=B.children.item(1)}function r(){a(),y(),g(),w(),l()}function s(){H=!1,u(),x(),_(),p(),c()}function a(){S.style.height=N.height+"px"}function c(){S.style.height=""}function l(){Y=P.scrollY(),M.listeners.add(window,"resize",I),M.listeners.add(window,"scroll",G),M.listeners.add(document,"keyup",K),M.listeners.add(B,"click",J)}function u(){M.listeners.remove(window,"resize",I),M.listeners.remove(window,"scroll",G),M.listeners.remove(document,"keyup",K),M.listeners.remove(B,"click",J)}function d(e){D=P.createClone(e),M.listeners.add(D,"load",V),B.appendChild(D)}function f(){N.classList.add("zoom__element--hidden"),D.classList.add("zoom__clone--visible")}function p(){N.classList.remove("zoom__element--hidden"),D.classList.remove("zoom__clone--visible")}function m(){B.style.transition="initial",v(),C.repaint(B),B.style.transition=""}function v(){var e,t,n,i,o=S.getBoundingClientRect(),r=+(S.getAttribute("data-width")||1/0),s=+(S.getAttribute("data-height")||1/0),a=Math.min(P.viewportWidth(),r)/o.width,c=Math.min(P.viewportHeight(),s)/o.height,l=Math.min(a,c),u=o.width*l,d=o.height*l,f=(P.viewportWidth()-u)/2,p=(P.viewportHeight()-d)/2,m=B.style;"expanding"===W||"collapsing"===W?(e=o.left+(o.width-u)/2,t=o.top+(o.height-d)/2,n=(f-e)/l,i=(p-t)/l,j.transform(B,"scale("+l+") "+T.translate(n,i))):(j.transform(B,""),m.left=f-o.left+"px",m.top=p-o.top+"px",m.width=u+"px",m.maxWidth=u+"px",m.height=d+"px")}function h(){var e=B.style;j.transform(B,""),e.left="",e.top="",e.width="",e.maxWidth="",e.height=""}function y(){document.body.appendChild(A)}function b(){document.body.removeChild(A)}function g(){C.repaint(A),A.classList.add("zoom__overlay--visible")}function _(){A.classList.remove("zoom__overlay--visible"),O.removeTransitionEndListener(B,q)}function w(){W="expanding",z(),O.addTransitionEndListener(B,q),v()}function x(){W="collapsing",O.addTransitionEndListener(B,Q),m(),h()}function z(){S.classList.add("zoom--active"),N.classList.add("zoom__element--active")}function L(){S.classList.remove("zoom--active"),N.classList.remove("zoom__element--active")}function E(){M.listeners.add(document.body,"click",F)}function k(){M.listeners.remove(document.body,"click",F)}var C,P,M,O,j,T,U,R,A,S,B,N,D,W,H,Y,I,G,K,F,J,V,q,Q;Object.defineProperty(t,"__esModule",{value:!0}),C=n(6),P=n(0),M=n(1),O=n(7),j=n(2),T=n(8),U=27,R=50,A=P.createDiv("zoom__overlay"),W="collapsed",H=!1,I=function(){v()},G=function(){Math.abs(Y-P.scrollY())>R&&s()},K=function(e){e.keyCode===U&&s()},F=function(e){var t,n,s,a,c,l=e.target;if(l instanceof HTMLImageElement&&l.classList.contains("zoom__element")){if(t=l.parentElement,null===t)return;if(n=t.parentElement,null===n)return;if(e.preventDefault(),s=t.classList.contains("zoom__container"),a=s?n:t,a.classList.contains("zoom--active"))return;if(c=C.srcAttribute(a,l),void 0===j.transformProperty||e.metaKey||e.ctrlKey)return void window.open(c,"_blank");S=a,s?o(t,l):(i(l),d(c)),r()}},J=function(){s()},V=function(){M.listeners.remove(D,"load",V),H=!0,"expanded"===W&&f()},q=function(){W="expanded",O.removeTransitionEndListener(B,q),m(),H&&f()},Q=function(){O.removeTransitionEndListener(B,Q),b(),L()},t.start=E,t.stop=k},function(e,t,n){var i=n(9);"string"==typeof i&&(i=[[e.i,i,""]]),n(11)(i,{}),i.locals&&(e.exports=i.locals)},function(e,t,n){"use strict";function i(e){e.offsetHeight}function o(e,t){var n=e.getAttribute("data-src");return null!==n?n:t.src}Object.defineProperty(t,"__esModule",{value:!0}),t.repaint=i,t.srcAttribute=o},function(e,t,n){"use strict";function i(e){var t,n,i=a.vendorProperties("transitionDuration").find(function(e){return e in document.body.style});return void 0===e?void 0!==i:(t=getComputedStyle(e),n=t[i],n.length>0&&0!==parseFloat(n))}function o(e,t){var n,o,r;if(i(e))for(n=0,o=c;n<o.length;n++)r=o[n],s.listeners.add(e,r,t);else t(new Event(c[0]))}function r(e,t){var n,i,o;for(n=0,i=c;n<i.length;n++)o=i[n],s.listeners.remove(e,o,t)}var s,a,c;Object.defineProperty(t,"__esModule",{value:!0}),s=n(1),a=n(3),c=["transitionend"].concat(a.vendorPrefixes.map(function(e){return e+"TransitionEnd"})),t.addTransitionEndListener=o,t.removeTransitionEndListener=r},function(e,t,n){"use strict";function i(e,t){return s?"translate3d("+e+"px, "+t+"px, 0)":"translate("+e+"px, "+t+"px)"}var o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),o=n(2),r=n(0),s=r.ready(function(){var e,t,n;return void 0!==o.transformProperty&&void 0!==window.getComputedStyle&&(e={WebkitTransform:"-webkit-transform",MozTransform:"-moz-transform",msTransform:"-ms-transform",OTransform:"-o-transform",transform:"transform"},t=document.createElement("div"),t.style.setProperty(o.transformProperty,"translate3d(1px,1px,1px)"),document.body.insertBefore(t,null),n=getComputedStyle(t).getPropertyValue(e[o.transformProperty]),document.body.removeChild(t),n.length>0&&"none"!==n)}),t.translate=i},function(e,t,n){t=e.exports=n(10)(),t.push([e.i,'.zoom{display:block;position:relative;width:100%;line-height:0;text-align:center}.zoom--active{z-index:2}.zoom__container{position:relative;-webkit-transition:-webkit-transform .3s cubic-bezier(.2,0,.2,1);transition:-webkit-transform .3s cubic-bezier(.2,0,.2,1);transition:transform .3s cubic-bezier(.2,0,.2,1);transition:transform .3s cubic-bezier(.2,0,.2,1),-webkit-transform .3s cubic-bezier(.2,0,.2,1);will-change:transform}.zoom__element{visibility:visible;opacity:1;-webkit-transition:visibility 0s linear 0s,opacity .4s 0s;transition:visibility 0s linear 0s,opacity .4s 0s;will-change:visibility,opacity;max-width:100%;cursor:pointer;cursor:-moz-zoom-in;cursor:-webkit-zoom-in}.zoom__element--active{width:100%}.zoom__clone,.zoom__element--hidden{visibility:hidden;opacity:0;-webkit-transition:visibility 0s linear .5s,opacity .1s .4s;transition:visibility 0s linear .5s,opacity .1s .4s}.zoom__clone{will-change:visibility,opacity;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;cursor:pointer;cursor:-moz-zoom-out;cursor:-webkit-zoom-out}.zoom__clone--visible{visibility:visible;opacity:1;-webkit-transition:visibility 0s linear 0s,opacity .4s 0s;transition:visibility 0s linear 0s,opacity .4s 0s}.zoom__overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1;background:#fff;opacity:0;filter:"alpha(opacity=0)";-webkit-transition:opacity .3s;transition:opacity .3s;will-change:opacity,filter}.zoom__overlay--visible{opacity:1;filter:"alpha(opacity=100)"}',""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){var e,t,n=[];for(e=0;e<this.length;e++)t=this[e],t[2]?n.push("@media "+t[2]+"{"+t[1]+"}"):n.push(t[1]);return n.join("")},e.i=function(t,n){var i,o,r,s;for("string"==typeof t&&(t=[[null,t,""]]),i={},o=0;o<this.length;o++)r=this[o][0],"number"==typeof r&&(i[r]=!0);for(o=0;o<t.length;o++)s=t[o],"number"==typeof s[0]&&i[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),e.push(s))},e}},function(e,t){function n(e,t){var n,i,o,r,s;for(n=0;n<e.length;n++)if(i=e[n],o=p[i.id]){for(o.refs++,r=0;r<o.parts.length;r++)o.parts[r](i.parts[r]);for(;r<i.parts.length;r++)o.parts.push(c(i.parts[r],t))}else{for(s=[],r=0;r<i.parts.length;r++)s.push(c(i.parts[r],t));p[i.id]={id:i.id,refs:1,parts:s}}}function i(e){var t,n,i,o,r,s,a,c=[],l={};for(t=0;t<e.length;t++)n=e[t],i=n[0],o=n[1],r=n[2],s=n[3],a={css:o,media:r,sourceMap:s},l[i]?l[i].parts.push(a):c.push(l[i]={id:i,parts:[a]});return c}function o(e,t){var n=h(),i=g[g.length-1];if("top"===e.insertAt)i?i.nextSibling?n.insertBefore(t,i.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),g.push(t);else{if("bottom"!==e.insertAt)throw Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function r(e){e.parentNode.removeChild(e);var t=g.indexOf(e);t>=0&&g.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",o(e,t),t}function a(e){var t=document.createElement("link");return t.rel="stylesheet",o(e,t),t}function c(e,t){var n,i,o,c;return t.singleton?(c=b++,n=y||(y=s(t)),i=l.bind(null,n,c,!1),o=l.bind(null,n,c,!0)):e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=a(t),i=d.bind(null,n),o=function(){r(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),i=u.bind(null,n),o=function(){r(n)}),i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else o()}}function l(e,t,n,i){var o,r,s=n?"":i.css;e.styleSheet?e.styleSheet.cssText=f(t,s):(o=document.createTextNode(s),r=e.childNodes,r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(o,r[t]):e.appendChild(o))}function u(e,t){var n=t.css,i=t.media;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function d(e,t){var n,i,o=t.css,r=t.sourceMap;r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),n=new Blob([o],{type:"text/css"}),i=e.href,e.href=URL.createObjectURL(n),i&&URL.revokeObjectURL(i)}var f,p={},m=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},v=m(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),h=m(function(){return document.head||document.getElementsByTagName("head")[0]}),y=null,b=0,g=[];e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw Error("The style-loader cannot be used in a non-browser environment");t=t||{},void 0===t.singleton&&(t.singleton=v()),void 0===t.insertAt&&(t.insertAt="bottom");var o=i(e);return n(o,t),function(e){var r,s,a,c,l,u=[];for(r=0;r<o.length;r++)s=o[r],a=p[s.id],a.refs--,u.push(a);for(e&&(c=i(e),n(c,t)),r=0;r<u.length;r++)if(a=u[r],0===a.refs){for(l=0;l<a.parts.length;l++)a.parts[l]();delete p[a.id]}}},f=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){"use strict";var i,o;Object.defineProperty(t,"__esModule",{value:!0}),n(5),i=n(0),o=n(4),i.ready(function(){return o.start()})}]); | ||
!function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="dist/",t(t.s=12)}([function(e,t,n){"use strict";function i(e){if("loading"!==document.readyState)return e();document.addEventListener("DOMContentLoaded",function(){return e()})}function o(){return(document.documentElement||document.body).clientWidth}function r(){return(document.documentElement||document.body).clientHeight}function s(){return void 0===window.pageYOffset?(document.documentElement||document.body).scrollTop:window.pageYOffset}function a(e){var t=document.createElement("div");return t.className=e,t}function c(e){var t=document.createElement("img");return t.className="zoom__clone",t.src=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.ready=i,t.viewportWidth=o,t.viewportHeight=r,t.scrollY=s,t.createDiv=a,t.createClone=c},function(e,t,n){"use strict";function i(e,t){return function(n,i,o,r){void 0!==n[e]?n[e](i,o,r):void 0!==n[t]?n[t]("on"+i,o,r):o(new Event(i))}}Object.defineProperty(t,"__esModule",{value:!0}),t.listeners={add:i("addEventListener","attachEvent"),remove:i("removeEventListener","detachEvent")}},function(e,t,n){"use strict";function i(){var e=r.vendorProperties("transform"),t=document.createElement("p"),n=t.style;return e.find(function(e){return void 0!==n[e]})}function o(e,n){e.style.setProperty(t.transformProperty,n)}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);t.transformProperty=i(),t.transform=o},function(e,t,n){"use strict";function i(e){var n=[e],i=""+e.charAt(0).toUpperCase()+e.substr(1);return t.vendorPrefixes.forEach(function(e){n.push(""+e+i)}),n}Object.defineProperty(t,"__esModule",{value:!0}),t.vendorPrefixes=["Webkit","Moz","ms","O"],t.vendorProperties=i},function(e,t,n){"use strict";function i(e){N=e.cloneNode(!0),B=P.createDiv("zoom__container"),B.appendChild(N),S.replaceChild(B,e)}function o(e,t){H=!0,N=t,B=e,D=B.children.item(1)}function r(){a(),y(),g(),w(),l()}function s(){H=!1,u(),x(),_(),p(),c()}function a(){S.style.height=N.height+"px"}function c(){S.style.height=""}function l(){Y=P.scrollY(),M.listeners.add(window,"resize",I),M.listeners.add(window,"scroll",G),M.listeners.add(document,"keyup",K),M.listeners.add(B,"click",J)}function u(){M.listeners.remove(window,"resize",I),M.listeners.remove(window,"scroll",G),M.listeners.remove(document,"keyup",K),M.listeners.remove(B,"click",J)}function d(e){D=P.createClone(e),M.listeners.add(D,"load",V),B.appendChild(D)}function f(){N.classList.add("zoom__element--hidden"),D.classList.add("zoom__clone--visible")}function p(){N.classList.remove("zoom__element--hidden"),D.classList.remove("zoom__clone--visible")}function m(){B.style.transition="initial",v(),C.repaint(B),B.style.transition=""}function v(){var e,t,n,i,o,r=S.getBoundingClientRect(),s=+(S.getAttribute("data-width")||1/0),a=+(S.getAttribute("data-height")||1/0),c=Math.min(P.viewportWidth(),s)/r.width,l=Math.min(P.viewportHeight(),a)/r.height,u=Math.min(c,l),d=r.width*u,f=r.height*u,p=(P.viewportWidth()-d)/2,m=(P.viewportHeight()-f)/2;"expanding"===W||"collapsing"===W?(e=r.left+(r.width-d)/2,t=r.top+(r.height-f)/2,n=(p-e)/u,i=(m-t)/u,j.transform(B,"scale("+u+") "+T.translate(n,i))):(j.transform(B,""),o=B.style,o.left=p-r.left+"px",o.top=m-r.top+"px",o.width=d+"px",o.maxWidth=d+"px",o.height=f+"px")}function h(){j.transform(B,"");var e=B.style;e.left="",e.top="",e.width="",e.maxWidth="",e.height=""}function y(){document.body.appendChild(A)}function b(){document.body.removeChild(A)}function g(){C.repaint(A),A.classList.add("zoom__overlay--visible")}function _(){A.classList.remove("zoom__overlay--visible"),O.removeTransitionEndListener(B,q)}function w(){W="expanding",z(),O.addTransitionEndListener(B,q),v()}function x(){W="collapsing",O.addTransitionEndListener(B,Q),m(),h()}function z(){S.classList.add("zoom--active"),N.classList.add("zoom__element--active")}function L(){S.classList.remove("zoom--active"),N.classList.remove("zoom__element--active")}function E(){M.listeners.add(document.body,"click",F)}function k(){M.listeners.remove(document.body,"click",F)}var C,P,M,O,j,T,U,R,A,S,B,N,D,W,H,Y,I,G,K,F,J,V,q,Q;Object.defineProperty(t,"__esModule",{value:!0}),C=n(6),P=n(0),M=n(1),O=n(7),j=n(2),T=n(8),U=27,R=50,A=P.createDiv("zoom__overlay"),W="collapsed",H=!1,I=function(){Y=P.scrollY(),v()},G=function(){Math.abs(Y-P.scrollY())>R&&s()},K=function(e){e.keyCode===U&&s()},F=function(e){var t,n,s,a,c,l=e.target;if(l instanceof HTMLImageElement&&l.classList.contains("zoom__element")){if(t=l.parentElement,null===t)return;if(n=t.parentElement,null===n)return;if(e.preventDefault(),s=t.classList.contains("zoom__container"),a=s?n:t,a.classList.contains("zoom--active"))return;if(c=C.srcAttribute(a,l),void 0===j.transformProperty||e.metaKey||e.ctrlKey)return void window.open(c,"_blank");S=a,s?o(t,l):(i(l),d(c)),r()}},J=function(){s()},V=function(){M.listeners.remove(D,"load",V),H=!0,"expanded"===W&&f()},q=function(){W="expanded",O.removeTransitionEndListener(B,q),m(),H&&f()},Q=function(){O.removeTransitionEndListener(B,Q),b(),L()},t.start=E,t.stop=k},function(e,t,n){var i=n(9);"string"==typeof i&&(i=[[e.i,i,""]]),n(11)(i,{}),i.locals&&(e.exports=i.locals)},function(e,t,n){"use strict";function i(e){e.offsetHeight}function o(e,t){var n=e.getAttribute("data-src");return null!==n?n:t.src}Object.defineProperty(t,"__esModule",{value:!0}),t.repaint=i,t.srcAttribute=o},function(e,t,n){"use strict";function i(e){var t,n,i=a.vendorProperties("transitionDuration").find(function(e){return e in document.body.style});return void 0===e?void 0!==i:(t=getComputedStyle(e),n=t[i],n.length>0&&0!==parseFloat(n))}function o(e,t){var n,o,r;if(i(e))for(n=0,o=c;n<o.length;n++)r=o[n],s.listeners.add(e,r,t);else t(new Event(c[0]))}function r(e,t){var n,i,o;for(n=0,i=c;n<i.length;n++)o=i[n],s.listeners.remove(e,o,t)}var s,a,c;Object.defineProperty(t,"__esModule",{value:!0}),s=n(1),a=n(3),c=["transitionend"].concat(a.vendorPrefixes.map(function(e){return e+"TransitionEnd"})),t.addTransitionEndListener=o,t.removeTransitionEndListener=r},function(e,t,n){"use strict";function i(e,t){return s?"translate3d("+e+"px, "+t+"px, 0)":"translate("+e+"px, "+t+"px)"}var o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),o=n(2),r=n(0),s=r.ready(function(){var e,t,n;return void 0!==o.transformProperty&&void 0!==window.getComputedStyle&&(e={WebkitTransform:"-webkit-transform",MozTransform:"-moz-transform",msTransform:"-ms-transform",OTransform:"-o-transform",transform:"transform"},t=document.createElement("div"),t.style.setProperty(o.transformProperty,"translate3d(1px,1px,1px)"),document.body.insertBefore(t,null),n=getComputedStyle(t).getPropertyValue(e[o.transformProperty]),document.body.removeChild(t),n.length>0&&"none"!==n)}),t.translate=i},function(e,t,n){t=e.exports=n(10)(),t.push([e.i,'.zoom{display:block;position:relative;width:100%;line-height:0;text-align:center}.zoom--active{z-index:2}.zoom__container{position:relative;-webkit-transition:-webkit-transform .3s cubic-bezier(.2,0,.2,1);transition:-webkit-transform .3s cubic-bezier(.2,0,.2,1);transition:transform .3s cubic-bezier(.2,0,.2,1);transition:transform .3s cubic-bezier(.2,0,.2,1),-webkit-transform .3s cubic-bezier(.2,0,.2,1);will-change:transform}.zoom__element{visibility:visible;opacity:1;-webkit-transition:visibility 0s linear 0s,opacity .4s 0s;transition:visibility 0s linear 0s,opacity .4s 0s;will-change:visibility,opacity;max-width:100%;cursor:pointer;cursor:-moz-zoom-in;cursor:-webkit-zoom-in}.zoom__element--active{width:100%}.zoom__clone,.zoom__element--hidden{visibility:hidden;opacity:0;-webkit-transition:visibility 0s linear .5s,opacity .1s .4s;transition:visibility 0s linear .5s,opacity .1s .4s}.zoom__clone{will-change:visibility,opacity;position:absolute;top:0;right:0;bottom:0;left:0;width:100%;cursor:pointer;cursor:-moz-zoom-out;cursor:-webkit-zoom-out}.zoom__clone--visible{visibility:visible;opacity:1;-webkit-transition:visibility 0s linear 0s,opacity .4s 0s;transition:visibility 0s linear 0s,opacity .4s 0s}.zoom__overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1;background:#fff;opacity:0;filter:"alpha(opacity=0)";-webkit-transition:opacity .3s;transition:opacity .3s;will-change:opacity,filter}.zoom__overlay--visible{opacity:1;filter:"alpha(opacity=100)"}',""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){var e,t,n=[];for(e=0;e<this.length;e++)t=this[e],t[2]?n.push("@media "+t[2]+"{"+t[1]+"}"):n.push(t[1]);return n.join("")},e.i=function(t,n){var i,o,r,s;for("string"==typeof t&&(t=[[null,t,""]]),i={},o=0;o<this.length;o++)r=this[o][0],"number"==typeof r&&(i[r]=!0);for(o=0;o<t.length;o++)s=t[o],"number"==typeof s[0]&&i[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),e.push(s))},e}},function(e,t){function n(e,t){var n,i,o,r,s;for(n=0;n<e.length;n++)if(i=e[n],o=p[i.id]){for(o.refs++,r=0;r<o.parts.length;r++)o.parts[r](i.parts[r]);for(;r<i.parts.length;r++)o.parts.push(c(i.parts[r],t))}else{for(s=[],r=0;r<i.parts.length;r++)s.push(c(i.parts[r],t));p[i.id]={id:i.id,refs:1,parts:s}}}function i(e){var t,n,i,o,r,s,a,c=[],l={};for(t=0;t<e.length;t++)n=e[t],i=n[0],o=n[1],r=n[2],s=n[3],a={css:o,media:r,sourceMap:s},l[i]?l[i].parts.push(a):c.push(l[i]={id:i,parts:[a]});return c}function o(e,t){var n=h(),i=g[g.length-1];if("top"===e.insertAt)i?i.nextSibling?n.insertBefore(t,i.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),g.push(t);else{if("bottom"!==e.insertAt)throw Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(t)}}function r(e){e.parentNode.removeChild(e);var t=g.indexOf(e);t>=0&&g.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",o(e,t),t}function a(e){var t=document.createElement("link");return t.rel="stylesheet",o(e,t),t}function c(e,t){var n,i,o,c;return t.singleton?(c=b++,n=y||(y=s(t)),i=l.bind(null,n,c,!1),o=l.bind(null,n,c,!0)):e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=a(t),i=d.bind(null,n),o=function(){r(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),i=u.bind(null,n),o=function(){r(n)}),i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else o()}}function l(e,t,n,i){var o,r,s=n?"":i.css;e.styleSheet?e.styleSheet.cssText=f(t,s):(o=document.createTextNode(s),r=e.childNodes,r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(o,r[t]):e.appendChild(o))}function u(e,t){var n=t.css,i=t.media;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function d(e,t){var n,i,o=t.css,r=t.sourceMap;r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),n=new Blob([o],{type:"text/css"}),i=e.href,e.href=URL.createObjectURL(n),i&&URL.revokeObjectURL(i)}var f,p={},m=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},v=m(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),h=m(function(){return document.head||document.getElementsByTagName("head")[0]}),y=null,b=0,g=[];e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw Error("The style-loader cannot be used in a non-browser environment");t=t||{},void 0===t.singleton&&(t.singleton=v()),void 0===t.insertAt&&(t.insertAt="bottom");var o=i(e);return n(o,t),function(e){var r,s,a,c,l,u=[];for(r=0;r<o.length;r++)s=o[r],a=p[s.id],a.refs--,u.push(a);for(e&&(c=i(e),n(c,t)),r=0;r<u.length;r++)if(a=u[r],0===a.refs){for(l=0;l<a.parts.length;l++)a.parts[l]();delete p[a.id]}}},f=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){"use strict";var i,o;Object.defineProperty(t,"__esModule",{value:!0}),n(5),i=n(0),o=n(4),i.ready(function(){return o.start()})}]); |
@@ -39,2 +39,3 @@ import { | ||
let resizeListener: EventListener = (): void => { | ||
initialScrollY = scrollY(); | ||
scaleContainer(); | ||
@@ -222,4 +223,2 @@ }; | ||
let style: CSSStyleDeclaration = container.style; | ||
if (state === 'expanding' || state === 'collapsing') { | ||
@@ -235,2 +234,4 @@ let offsetX: number = rect.left + (rect.width - scaledWidth) / 2; | ||
transform(container, ''); | ||
let style: CSSStyleDeclaration = container.style; | ||
style.left = `${centreX - rect.left}px`; | ||
@@ -245,4 +246,5 @@ style.top = `${centreY - rect.top}px`; | ||
function resetScale(): void { | ||
transform(container, ''); | ||
let style: CSSStyleDeclaration = container.style; | ||
transform(container, ''); | ||
style.left = ''; | ||
@@ -249,0 +251,0 @@ style.top = ''; |
{ | ||
"name": "zoom.ts", | ||
"version": "7.2.0", | ||
"version": "7.2.1", | ||
"description": "A lightweight TypeScript library for image zooming, as seen on Medium.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2341704
746