Remove "add-module-exports"

This commit is contained in:
micku7zu 2017-01-30 21:22:56 +02:00
parent 443b271382
commit bb6fdc33d0
4 changed files with 3 additions and 5 deletions

View file

@ -4,7 +4,6 @@
],
"plugins": [
"transform-class-properties",
"add-module-exports"
"transform-class-properties"
]
}

View file

@ -83,7 +83,7 @@ rollup({
main: true
}),
babel(babelrc()),
commonjs(),
commonjs()
],
external: external
}).then((bundle) => {

View file

@ -211,7 +211,6 @@ if (typeof document !== "undefined") {
*/
VanillaTilt.init(document.querySelectorAll("[data-tilt]"));
}
module.exports = exports["default"];
return VanillaTilt;

View file

@ -1 +1 @@
var VanillaTilt=function(){"use strict";var t=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},VanillaTilt=function(){function VanillaTilt(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,VanillaTilt),!(e instanceof Node))throw"Can't initialize VanillaTilt because "+e+" is not a Node.";this.width=null,this.height=null,this.left=null,this.top=null,this.transitionTimeout=null,this.updateCall=null,this.updateBind=this.update.bind(this),this.element=e,this.settings=this.extendSettings(i),this.addEventListeners()}return VanillaTilt.prototype.addEventListeners=function(){this.onMouseEnterBind=this.onMouseEnter.bind(this),this.onMouseMoveBind=this.onMouseMove.bind(this),this.onMouseLeaveBind=this.onMouseLeave.bind(this),this.element.addEventListener("mouseenter",this.onMouseEnterBind),this.element.addEventListener("mousemove",this.onMouseMoveBind),this.element.addEventListener("mouseleave",this.onMouseLeaveBind)},VanillaTilt.prototype.removeEventListeners=function(){this.element.removeEventListener("mouseenter",this.onMouseEnterBind),this.element.removeEventListener("mousemove",this.onMouseMoveBind),this.element.removeEventListener("mouseleave",this.onMouseLeaveBind)},VanillaTilt.prototype.destroy=function(){this.removeEventListeners(),this.element.vanillaTilt=null,delete this.element.vanillaTilt,this.element=null},VanillaTilt.prototype.onMouseEnter=function(t){this.updateElementPosition(),this.element.style.willChange="transform",this.setTransition()},VanillaTilt.prototype.onMouseMove=function(t){null!==this.updateCall&&cancelAnimationFrame(this.updateCall),this.event=t,this.updateCall=requestAnimationFrame(this.updateBind)},VanillaTilt.prototype.onMouseLeave=function(t){this.setTransition(),this.settings.reset&&this.reset()},VanillaTilt.prototype.reset=function(){var t=this;requestAnimationFrame(function(){t.event={pageX:t.left+t.width/2,pageY:t.top+t.height/2},t.element.style.transform="perspective("+t.settings.perspective+"px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)"})},VanillaTilt.prototype.getValues=function(){var t=(this.event.clientX-this.left)/this.width,e=(this.event.clientY-this.top)/this.height;t=Math.min(Math.max(t,0),1),e=Math.min(Math.max(e,0),1);var i=(this.settings.max/2-t*this.settings.max).toFixed(2),n=(e*this.settings.max-this.settings.max/2).toFixed(2);return{tiltX:i,tiltY:n,percentageX:100*t,percentageY:100*e}},VanillaTilt.prototype.updateElementPosition=function(){var t=this.element.getBoundingClientRect();this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.left=t.left,this.top=t.top},VanillaTilt.prototype.update=function(){var t=this.getValues();this.element.style.transform="perspective("+this.settings.perspective+"px) rotateX("+("x"===this.settings.axis?0:t.tiltY)+"deg) rotateY("+("y"===this.settings.axis?0:t.tiltX)+"deg) scale3d("+this.settings.scale+", "+this.settings.scale+", "+this.settings.scale+")",this.element.dispatchEvent(new CustomEvent("tiltChange",{detail:t})),this.updateCall=null},VanillaTilt.prototype.setTransition=function(){var t=this;clearTimeout(this.transitionTimeout),this.element.style.transition=this.settings.speed+"ms "+this.settings.easing,this.transitionTimeout=setTimeout(function(){return t.element.style.transition=""},this.settings.speed)},VanillaTilt.prototype.extendSettings=function(t){var e={max:35,perspective:1e3,easing:"cubic-bezier(.03,.98,.52,.99)",scale:"1",speed:"300",transition:!0,axis:null,reset:!0},i={};for(var n in e)if(n in t)i[n]=t[n];else if(this.element.hasAttribute("data-tilt-"+n)){var s=this.element.getAttribute("data-tilt-"+n);try{i[n]=JSON.parse(s)}catch(t){i[n]=s}}else i[n]=e[n];return i},VanillaTilt.init=function(t,e){t instanceof Node&&(t=[t]),t instanceof NodeList&&(t=[].slice.call(t)),t instanceof Array&&t.forEach(function(t){"vanillaTilt"in t||(t.vanillaTilt=new VanillaTilt(t,e))})},VanillaTilt}();return"undefined"!=typeof document&&(window.VanillaTilt=VanillaTilt,VanillaTilt.init(document.querySelectorAll("[data-tilt]"))),module.exports=exports.default,VanillaTilt}();
var VanillaTilt=function(){"use strict";var t=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},VanillaTilt=function(){function VanillaTilt(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t(this,VanillaTilt),!(e instanceof Node))throw"Can't initialize VanillaTilt because "+e+" is not a Node.";this.width=null,this.height=null,this.left=null,this.top=null,this.transitionTimeout=null,this.updateCall=null,this.updateBind=this.update.bind(this),this.element=e,this.settings=this.extendSettings(i),this.addEventListeners()}return VanillaTilt.prototype.addEventListeners=function(){this.onMouseEnterBind=this.onMouseEnter.bind(this),this.onMouseMoveBind=this.onMouseMove.bind(this),this.onMouseLeaveBind=this.onMouseLeave.bind(this),this.element.addEventListener("mouseenter",this.onMouseEnterBind),this.element.addEventListener("mousemove",this.onMouseMoveBind),this.element.addEventListener("mouseleave",this.onMouseLeaveBind)},VanillaTilt.prototype.removeEventListeners=function(){this.element.removeEventListener("mouseenter",this.onMouseEnterBind),this.element.removeEventListener("mousemove",this.onMouseMoveBind),this.element.removeEventListener("mouseleave",this.onMouseLeaveBind)},VanillaTilt.prototype.destroy=function(){this.removeEventListeners(),this.element.vanillaTilt=null,delete this.element.vanillaTilt,this.element=null},VanillaTilt.prototype.onMouseEnter=function(t){this.updateElementPosition(),this.element.style.willChange="transform",this.setTransition()},VanillaTilt.prototype.onMouseMove=function(t){null!==this.updateCall&&cancelAnimationFrame(this.updateCall),this.event=t,this.updateCall=requestAnimationFrame(this.updateBind)},VanillaTilt.prototype.onMouseLeave=function(t){this.setTransition(),this.settings.reset&&this.reset()},VanillaTilt.prototype.reset=function(){var t=this;requestAnimationFrame(function(){t.event={pageX:t.left+t.width/2,pageY:t.top+t.height/2},t.element.style.transform="perspective("+t.settings.perspective+"px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)"})},VanillaTilt.prototype.getValues=function(){var t=(this.event.clientX-this.left)/this.width,e=(this.event.clientY-this.top)/this.height;t=Math.min(Math.max(t,0),1),e=Math.min(Math.max(e,0),1);var i=(this.settings.max/2-t*this.settings.max).toFixed(2),n=(e*this.settings.max-this.settings.max/2).toFixed(2);return{tiltX:i,tiltY:n,percentageX:100*t,percentageY:100*e}},VanillaTilt.prototype.updateElementPosition=function(){var t=this.element.getBoundingClientRect();this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this.left=t.left,this.top=t.top},VanillaTilt.prototype.update=function(){var t=this.getValues();this.element.style.transform="perspective("+this.settings.perspective+"px) rotateX("+("x"===this.settings.axis?0:t.tiltY)+"deg) rotateY("+("y"===this.settings.axis?0:t.tiltX)+"deg) scale3d("+this.settings.scale+", "+this.settings.scale+", "+this.settings.scale+")",this.element.dispatchEvent(new CustomEvent("tiltChange",{detail:t})),this.updateCall=null},VanillaTilt.prototype.setTransition=function(){var t=this;clearTimeout(this.transitionTimeout),this.element.style.transition=this.settings.speed+"ms "+this.settings.easing,this.transitionTimeout=setTimeout(function(){return t.element.style.transition=""},this.settings.speed)},VanillaTilt.prototype.extendSettings=function(t){var e={max:35,perspective:1e3,easing:"cubic-bezier(.03,.98,.52,.99)",scale:"1",speed:"300",transition:!0,axis:null,reset:!0},i={};for(var n in e)if(n in t)i[n]=t[n];else if(this.element.hasAttribute("data-tilt-"+n)){var s=this.element.getAttribute("data-tilt-"+n);try{i[n]=JSON.parse(s)}catch(t){i[n]=s}}else i[n]=e[n];return i},VanillaTilt.init=function(t,e){t instanceof Node&&(t=[t]),t instanceof NodeList&&(t=[].slice.call(t)),t instanceof Array&&t.forEach(function(t){"vanillaTilt"in t||(t.vanillaTilt=new VanillaTilt(t,e))})},VanillaTilt}();return"undefined"!=typeof document&&(window.VanillaTilt=VanillaTilt,VanillaTilt.init(document.querySelectorAll("[data-tilt]"))),VanillaTilt}();