1 line
1.7 KiB
JavaScript
1 line
1.7 KiB
JavaScript
"use strict";(function(){var t,e,r,n=function(t,e){return function(){return t.apply(e,arguments)}},i=function(t,e){function r(){this.constructor=t}for(var n in e)o.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},o={}.hasOwnProperty;e=require("react"),r=require("reactcss"),module.exports=t=function(t){function o(){return this.handleClick=n(this.handleClick,this),o.__super__.constructor.apply(this,arguments)}return i(o,t),o.defaultProps={color:"dark"},o.prototype.handleClick=function(t){var e,r,n,i;return e=Math.round(t.clientX-t.currentTarget.getBoundingClientRect().left),i=Math.round(t.clientY-t.currentTarget.getBoundingClientRect().top),n=Math.max(t.currentTarget.clientWidth,t.currentTarget.clientHeight),r=this.refs.ripple,r.style.left=e,r.style.top=i,r.style.width=2*n,r.style.height=2*n,r.style.transform="translate(-50%, -50%) scale(1)",r.style.opacity="0",setTimeout(function(t){return function(){return r.style.transform="translate(-50%, -50%) scale(0)",setTimeout(function(){return r.style.opacity=1},400)}}(this),400)},o.prototype.render=function(){var t;return t=r["default"]({"default":{ink:{position:"relative",cursor:"pointer",overflow:"hidden"},ripple:{position:"absolute",width:"10px",height:"10px",transform:"translate(-50%, -50%) scale(0)",transition:"transform 400ms cubic-bezier(.55,0,.3,1), opacity 200ms 200ms linear",borderRadius:"50%",opacity:"1"}},"color-dark":{ripple:{background:"rgba(0,0,0,.1)"}},"color-light":{ripple:{background:"rgba(255,255,255,.15)"}}},this.props),e.createElement("div",{style:t.ink,onClick:this.handleClick},e.createElement("div",{style:t.ripple,ref:"ripple"}),this.props.children)},o}(e.Component)}).call(void 0); |