mirror of
https://github.com/TrentSPalmer/fcc-challenges.git
synced 2024-11-24 12:21:29 -08:00
2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
|
(this["webpackJsonppomodoro-clock-react"]=this["webpackJsonppomodoro-clock-react"]||[]).push([[0],{20:function(e,t,n){e.exports=n.p+"static/media/BeepSound.049fe0d0.ogg"},21:function(e,t,n){e.exports=n(34)},30:function(e,t,n){},34: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(4),c=n(11),h=function(e){return{type:"SETBREAKLENGTH",breakLength:e}},u=function(e){return{type:"SETSESSIONLENGTH",sessionLength:e}},l=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),m=(n(30),n(5)),f=n(6),w=n(2),v=n(8),E=n(7),y=n(9),g="#0b3c5d",b="#328cc1",k="#d9b310",S="#1d2731",M=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())},A=n(10),C=n(3),O=function(e){Object(v.a)(n,e);var t=Object(E.a)(n);function n(e){var o;return Object(m.a)(this,n),(o=t.call(this,e)).handleDownArrowMouseEvent=o.handleDownArrowMouseEvent.bind(Object(w.a)(o)),o.handleUpArrowMouseEvent=o.handleUpArrowMouseEvent.bind(Object(w.a)(o)),o.incrementBreak=o.incrementBreak.bind(Object(w.a)(o)),o.decrementBreak=o.decrementBreak.bind(Object(w.a)(o)),o.state={downColor:S,upColor:S},o}return Object(f.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(M(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(M(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(A.a,{icon:C.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(A.a,{icon:C.b})))}}]),n}(i.a.Component),j=Object(a.b)((function(e){return Object(y.a)({},e)}),(functio
|
||
|
//# sourceMappingURL=main.157adc9f.chunk.js.map
|