-
Notifications
You must be signed in to change notification settings - Fork 0
/
9175de84.js
1 lines (1 loc) · 1.9 KB
/
9175de84.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{phew:function(C,o,e){"use strict";e.r(o),e.d(o,"default",function(){return P});var s=e("nKUr"),b=e.n(s),U=e("y8nQ"),m=e("Vl3Y"),W=e("OaEy"),v=e("2fM7"),O=e("XKWP"),D=e("N7Kx"),f=e("kFHX"),M=e("4jIl"),j=e("q1tI"),g=e.n(j),i=e("VphZ"),P=function(p){Object(f.a)(_,p);var h=Object(M.a)(_);function _(){var t;Object(O.a)(this,_);for(var r=arguments.length,l=new Array(r),n=0;n<r;n++)l[n]=arguments[n];return t=h.call.apply(h,[this].concat(l)),t.eases=Object.keys(i).filter(function(a){return a.startsWith("ease")}).map(function(a){return{label:a,value:i[a]}}),t.svgWidth=900,t.svgHeight=600,t.drawSvg=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=a.easeType,d=c===void 0?0:c,E=i.select(".transition-test");E.selectAll("svg").remove();var u=E.append("svg").attr("width",t.svgWidth).attr("height",t.svgHeight).style("border","1px solid black");u.append("rect").attr("fill","#3baf94").attr("x",100).attr("y",100).transition().duration(1e3).ease(t.eases[d].value).attr("width",100).attr("height",100),u.append("rect").attr("fill","#8b4be7").attr("y",250).attr("width",100).attr("height",100).transition().duration(1e3).ease(t.eases[d].value).attr("x",500),u.append("circle").attr("fill","#e74ba9").attr("cx",t.svgWidth-150).attr("cy",150).transition().duration(1e3).ease(t.eases[d].value).attr("r",100)},t.handChange=function(a){t.drawSvg({easeType:a})},t}return Object(D.a)(_,[{key:"componentDidMount",value:function(){this.drawSvg()}},{key:"render",value:function(){return Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)(m.a,{children:Object(s.jsx)(m.a.Item,{label:"\u52A8\u753B\u7C7B\u578B",children:Object(s.jsx)(v.a,{defaultValue:0,onChange:this.handChange,children:this.eases.map(function(r,l){var n=r.label;return Object(s.jsx)(v.a.Option,{value:l,children:n},n)})})})}),Object(s.jsx)("div",{className:"transition-test"})]})}}]),_}(g.a.Component)}}]);