| 5 | var x=0; |
| 6 | |
| 7 | class InputTimer extends React.Component{ |
| 8 | |
| 9 | constructor(params){ |
| 10 | |
| 11 | super(params); |
| 12 | this.state={selectedtime:''}; |
| 13 | this.Storetime= this.Storetime.bind(this); |
| 14 | } |
| 15 | componentDidMount(){ |
| 16 | |
| 17 | } |
| 18 | Storetime(){ |
| 19 | |
| 20 | audio.pause(); |
| 21 | audio.currentTime=0; |
| 22 | var n=this.timerID=setInterval(()=>{ |
| 23 | // let date=new Date(); |
| 24 | var y=this.state.selectedtime; |
| 25 | var t=((new Date()).toTimeString().substring(0,5)); |
| 26 | |
| 27 | x++; |
| 28 | if (y==(t)) { |
| 29 | //alert("hello bitches"); |
| 30 | // console.log("hey"); |
| 31 | audio.play(); |
| 32 | } |
| 33 | else if(x==300){ |
| 34 | audio.pause(); |
| 35 | audio.currentTime=0; |
| 36 | x=0; |
| 37 | clearInterval(n); |
| 38 | |
| 39 | }else { |
| 40 | |
| 41 | }},1000) |
| 42 | console.log(this.state.selectedtime); |
| 43 | } |
| 44 | |
| 45 | render(){ |
| 46 | |
| 47 | return(<> |
| 48 | |
| 49 | <input onChange={e => this.state.selectedtime=e.target.value} id={'Timertime'} value={this.state.selectedtime} type={"time"} ></input> |
| 50 | <br/> |
| 51 | <button onClick={this.Storetime}>select time</button> |
| 52 | </>) |
| 53 | } |
| 54 | } |
| 55 | export default App; |
| 56 | |
| 57 | class Clockclass extends React.Component{ |
nothing calls this directly
no outgoing calls
no test coverage detected