fcc-challenges/pomodoro-clock-react/build/static/js/main.4e34ae4f.chunk.js

2 lines
17 KiB
JavaScript
Raw Permalink Normal View History

(this["webpackJsonppomodoro-clock-react"]=this["webpackJsonppomodoro-clock-react"]||[]).push([[0],{21:function(e,t,n){e.exports=n.p+"static/media/BeepSound.049fe0d0.ogg"},22:function(e,t,n){e.exports=n(38)},31:function(e,t,n){},38:function(e,t,n){"use strict";n.r(t);var o=n(0),i=n.n(o),r=n(13),s=n.n(r),a=n(5),c=n(11),l=function(e){return{type:"SETBREAKLENGTH",breakLength:e}},u=function(e){return{type:"SETSESSIONLENGTH",sessionLength:e}},h=function(e){return{type:"SETCLOCK",time:e}},p=Object(c.b)({innerWindowWidth:function(e,t){switch(e||(e=window.innerWidth),t.type){case"SETWINDOWINNERWIDTH":return t.windowInnerWidth;default:return e}},innerWindowHeight:function(e,t){switch(e||(e=window.innerHeight),t.type){case"SETWINDOWINNERHEIGHT":return t.windowInnerHeight;default:return e}},breakLength:function(e,t){switch(e||(e=5),t.type){case"SETBREAKLENGTH":return t.breakLength;default:return e}},sessionLength:function(e,t){switch(e||(e=25),t.type){case"SETSESSIONLENGTH":return t.sessionLength;default:return e}},timer:function(e,t){switch(e||(e="Session"),t.type){case"SETTIMER":return t.timer;default:return e}},clock:function(e,t){switch(e||(e="25:00"),t.type){case"SETCLOCK":return t.time;default:return e}},clockIsRunning:function(e,t){switch(e||(e=!1),t.type){case"SETCLOCKISRUNNING":return t.clockIsRunning;default:return e}},zeroTime:function(e,t){switch(e||(e=0),t.type){case"SETZEROTIME":return t.zeroTime;default:return e}}}),d=Object(c.c)(p),f=(n(31),n(3)),m=n(4),v=n(2),b=n(7),w=n(6),y=n(8),g="#0b3c5d",E="#328cc1",k="#d9b310",S="#1d2731",O=function(e){var t=e%60,n=Math.floor(e/60);return(n>9?n.toString():"0"+n.toString())+":"+(t>9?t.toString():"0"+t.toString())},j=n(10),M=n(9),A=function(e){Object(b.a)(n,e);var t=Object(w.a)(n);function n(e){var o;return Object(f.a)(this,n),(o=t.call(this,e)).handleDownArrowMouseEvent=o.handleDownArrowMouseEvent.bind(Object(v.a)(o)),o.handleUpArrowMouseEvent=o.handleUpArrowMouseEvent.bind(Object(v.a)(o)),o.incrementBreak=o.incrementBreak.bind(Object(v.a)(o)),o.decrementBreak=o.decrementBreak.bind(Object(v.a)(o)),o.state={downColor:S,upColor:S},o}return Object(m.a)(n,[{key:"incrementBreak",value:function(){if(this.props.breakLength<60){var e=this.props.breakLength+1;this.props.clockIsRunning?"Session"===this.props.timer&&this.props.breakLengthAction(e):(this.props.breakLengthAction(e),"Break"===this.props.timer&&this.props.clockAction(O(60*e)))}}},{key:"decrementBreak",value:function(){if(this.props.breakLength>1){var e=this.props.breakLength-1;this.props.clockIsRunning?"Session"===this.props.timer&&this.props.breakLengthAction(e):(this.props.breakLengthAction(e),"Break"===this.props.timer&&this.props.clockAction(O(60*e)))}}},{key:"handleDownArrowMouseEvent",value:function(e){"mousedown"===e.type||"touchstart"===e.type?this.setState({downColor:k}):"mouseup"!==e.type&&"touchend"!==e.type||this.setState({downColor:S})}},{key:"handleUpArrowMouseEvent",value:function(e){"mousedown"===e.type||"touchstart"===e.type?this.setState({upColor:k}):"mouseup"!==e.type&&"touchend"!==e.type||this.setState({upColor:S})}},{key:"render",value:function(){var e={color:this.state.downColor},t={color:this.state.upColor};return i.a.createElement("div",{style:{height:"50%",width:"75%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",marginRight:"25%",fontSize:32}},i.a.createElement("div",{id:"break-decrement",style:e,onClick:this.decrementBreak,onTouchStart:this.handleDownArrowMouseEvent,onTouchEnd:this.handleDownArrowMouseEvent,onMouseDown:this.handleDownArrowMouseEvent,onMouseUp:this.handleDownArrowMouseEvent},i.a.createElement(j.a,{icon:M.a})),i.a.createElement("p",{id:"break-length",style:{width:50}},this.props.breakLength),i.a.createElement("div",{id:"break-increment",style:t,onClick:this.incrementBreak,onTouchStart:this.handleUpArrowMouseEvent,onTouchEnd:this.handleUpArrowMouseEvent,onMouseDown:this.handleUpArrowMouseEvent,onMouseUp:this.handleUpArrowMouseEvent},i.a.createElement(j.a,{icon:M.b})))}}]),n}(i.a.Component),C=Object(a.b)((function(e){return Object(y.a)({},e)}),(functio
//# sourceMappingURL=main.4e34ae4f.chunk.js.map