diff --git a/dist/ripple.css b/dist/ripple.css deleted file mode 100644 index e2a7394..0000000 --- a/dist/ripple.css +++ /dev/null @@ -1,2 +0,0 @@ -.ripple{position:absolute;box-sizing:border-box;overflow:hidden;pointer-events:none;border-color:transparent;border-style:solid}.ripple__effect{position:relative;box-sizing:border-box;border-radius:50%;transition-property:transform}.ripple__effect.ripple__effect--hidden{opacity:0!important;transform:scale(0)}.ripple__effect.ripple__effect--hide{transition-property:opacity,transform;opacity:0!important}.ripple--mouseout-protected *{pointer-events:none} -/*# sourceMappingURL=ripple.css.map*/ \ No newline at end of file diff --git a/dist/ripple.css.map b/dist/ripple.css.map deleted file mode 100644 index 7d9f1b3..0000000 --- a/dist/ripple.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","file":"ripple.css","sourceRoot":""} \ No newline at end of file diff --git a/dist/ripple.js b/dist/ripple.js index e256519..55eade2 100644 --- a/dist/ripple.js +++ b/dist/ripple.js @@ -1 +1 @@ -var ripple=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].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,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},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="",t(t.s=5)}([function(e,t,n){"use strict";function r(e,t){return function(){var n=[],r=void 0,o=function(o,i){var a=i||e;r=Date.now(),n.push({effect:t.create(),state:"shown"}),n[n.length-1].effect.show(a,o)},i=function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:"*",n=arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,i=r(o,n),a=function(e){for(var n=e.target;n!==o;){if(n.matches(t)){n.classList.add("ripple--mouseout-protected"),i.start(e,n);break}n=n.parentNode}},u=function(e,n){e.target.matches(t)&&(i.end(e,e.target),e.target.classList.remove("ripple--mouseout-protected"))};return o.addEventListener("mousedown",a),o.addEventListener("mouseup",u),o.addEventListener("mouseout",u),e}Object.defineProperty(t,"__esModule",{value:!0});var a={bind:o,watch:i};t.default=a},function(e,t,n){"use strict";function r(e){a=i(a,e)}function o(){return a}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t',this.$effect=this.$.querySelector(".ripple__effect"),this.$.style.zIndex=t.zIndex,document.body.appendChild(this.$)}return i(e,[{key:"show",value:function(e,t){var n=this,r=this.getRect(e),o=0,i=0;t instanceof TouchEvent?(o=t.touches[0].pageX,i=t.touches[0].pageY):(o=t.pageX,i=t.pageY);var a={left:Math.abs(r.left-o),top:Math.abs(r.top-i)},u=void 0,c=void 0;this.radius=this.calcRadius(a,r);var d=this.calcTransition(),l=this.$.style,f=this.$effect.style;c="auto"===this.props.borderRadius?parseInt((0,s.getStyle)(e,"border-radius"),10):this.props.borderRadius,u="auto"===this.props.borderWidth?parseInt((0,s.getStyle)(e,"border-width"),10):this.props.borderWidth,l.left=r.left+"px",l.top=r.top+"px",l.width=r.width+"px",l.height=r.height+"px",f.width=2*this.radius+"px",f.height=2*this.radius+"px",f.left=a.left-this.radius-u+"px",f.top=a.top-this.radius-u+"px",l.borderRadius=c+"px",l.borderWidth=u+"px",f.transitionTimingFunction=this.props.timingFunction,f.transitionDuration=d+"ms",f.background=this.props.color,f.opacity=this.props.opacity,setTimeout(function(){n.$effect.classList.remove("ripple__effect--hidden")},1)}},{key:"hide",value:function(e){var t=this,n=this.calcTransition();this.$effect.style.transitionDuration=n+"ms",this.$effect.classList.add("ripple__effect--hide"),setTimeout(function(){return t.$.remove(),delete t.$,e()},n)}},{key:"calcTransition",value:function(){return this.props.constant?this.props.transitionDuration:this.props.transitionDuration+1.1*this.radius}},{key:"calcRadius",value:function(e,t){var n=Math.max(e.top,t.height-e.top),r=Math.max(e.left,t.width-e.left);return Math.sqrt(n*n+r*r)}},{key:"getRect",value:function(e){var t=document.body.getBoundingClientRect(),n=e.getBoundingClientRect(),r=parseInt((0,s.getStyle)(document.body,"margin-top")),o=parseInt((0,s.getStyle)(document.body,"margin-left"));return{top:n.top-t.top+r,left:n.left-t.left+o,width:n.width,height:n.height}}}]),e}();t.RippleFactory=function(){function e(t){r(this,e),t=t||{},this.rippleProps=o({},(0,u.getDefaults)(),t)}return i(e,[{key:"create",value:function(){return new c(this.rippleProps)}}]),e}()},function(e,t,n){"use strict";function r(e,t){var n="";return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,null).getPropertyValue(t):e.currentStyle&&(t=t.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()}),n=e.currentStyle[t]),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getStyle=r,window.Element&&function(e){e.matches=e.matches||e.matchesSelector||e.webkitMatchesSelector||e.msMatchesSelector||function(e){for(var t=this,n=(t.parentNode||t.document).querySelectorAll(e),r=-1;n[++r]&&n[r]!=t;);return!!n[r]}}(Element.prototype),"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)})},function(e,t,n){"use strict";var r=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.bindTo=o.default.bindTo,t.watch=o.default.watch,t.setDefaults=o.default.setDefaults},function(e,t){}]); \ No newline at end of file +var ripple=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].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,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},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="",t(t.s=5)}([function(e,t,n){"use strict";function r(e,t){return function(){var n=[],r=void 0,o=function(o,i){var a=i||e;r=Date.now(),n.push({effect:t.create(),state:"shown"}),n[n.length-1].effect.show(a,o)},i=function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:"*",n=arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,i=r(o,n),a=function(e){for(var n=e.target;n!==o;){if(n.matches(t)){n.classList.add("ripple--mouseout-protected"),i.start(e,n);break}n=n.parentNode}},u=function(e,n){e.target.matches(t)&&(i.end(e,e.target),e.target.classList.remove("ripple--mouseout-protected"))};return o.addEventListener("mousedown",a),o.addEventListener("mouseup",u),o.addEventListener("mouseout",u),e}Object.defineProperty(t,"__esModule",{value:!0});var a={bind:o,watch:i};t.default=a},function(e,t,n){"use strict";function r(e){a=i(a,e)}function o(){return a}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t',this.$effect=this.$.querySelector(".ripple__effect"),this.$.style.zIndex=t.zIndex,document.body.appendChild(this.$)}return i(e,[{key:"show",value:function(e,t){var n=this,r=this.getRect(e),o=0,i=0;t instanceof TouchEvent?(o=t.touches[0].pageX,i=t.touches[0].pageY):(o=t.pageX,i=t.pageY);var a={left:Math.abs(r.left-o),top:Math.abs(r.top-i)},u=void 0,c=void 0;this.radius=this.calcRadius(a,r);var d=this.calcTransition(),l=this.$.style,f=this.$effect.style;c="auto"===this.props.borderRadius?parseInt((0,s.getStyle)(e,"border-radius"),10):this.props.borderRadius,u="auto"===this.props.borderWidth?parseInt((0,s.getStyle)(e,"border-width"),10):this.props.borderWidth,l.left=r.left+"px",l.top=r.top+"px",l.width=r.width+"px",l.height=r.height+"px",f.width=2*this.radius+"px",f.height=2*this.radius+"px",f.left=a.left-this.radius-u+"px",f.top=a.top-this.radius-u+"px",l.borderRadius=c+"px",l.borderWidth=u+"px",f.transitionTimingFunction=this.props.timingFunction,f.transitionDuration=d+"ms",f.background=this.props.color,f.opacity=this.props.opacity,setTimeout(function(){n.$effect.classList.remove("ripple__effect--hidden")},1)}},{key:"hide",value:function(e){var t=this,n=this.calcTransition();this.$effect.style.transitionDuration=n+"ms",this.$effect.classList.add("ripple__effect--hide"),setTimeout(function(){return t.$.remove(),delete t.$,e()},n)}},{key:"calcTransition",value:function(){return this.props.constant?this.props.transitionDuration:this.props.transitionDuration+1.1*this.radius}},{key:"calcRadius",value:function(e,t){var n=Math.max(e.top,t.height-e.top),r=Math.max(e.left,t.width-e.left);return Math.sqrt(n*n+r*r)}},{key:"getRect",value:function(e){var t=document.body.getBoundingClientRect(),n=e.getBoundingClientRect(),r=parseInt((0,s.getStyle)(document.body,"margin-top"),10),o=parseInt((0,s.getStyle)(document.body,"margin-left"),10);return{top:n.top-t.top+r,left:n.left-t.left+o,width:n.width,height:n.height}}}]),e}();t.RippleFactory=function(){function e(t){r(this,e),t=t||{},this.rippleProps=o({},(0,u.getDefaults)(),t)}return i(e,[{key:"create",value:function(){return new c(this.rippleProps)}}]),e}()},function(e,t,n){"use strict";function r(e,t){var n="";return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,null).getPropertyValue(t):e.currentStyle&&(t=t.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()}),n=e.currentStyle[t]),n}Object.defineProperty(t,"__esModule",{value:!0}),t.getStyle=r,window.Element&&function(e){e.matches=e.matches||e.matchesSelector||e.webkitMatchesSelector||e.msMatchesSelector||function(e){for(var t=this,n=(t.parentNode||t.document).querySelectorAll(e),r=-1;n[++r]&&n[r]!=t;);return!!n[r]}}(Element.prototype),"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)})},function(e,t,n){"use strict";var r=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(r);t.bindTo=o.default.bindTo,t.watch=o.default.watch,t.setDefaults=o.default.setDefaults},function(e,t){}]); \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index c786eb1..14753d4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -37,5 +37,5 @@ module.exports = { new ExtractTextPlugin('ripple.css'), new webpack.optimize.UglifyJsPlugin() ], - devtool: 'source-map', + // devtool: 'source-map', }