You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
decrease value of time remaining by 1 sec for each sec that passes
41
+
*/
2
42
3
43
// DO NOT EDIT BELOW HERE
4
44
@@ -23,3 +63,31 @@ function pauseAlarm() {
23
63
}
24
64
25
65
window.onload=setup;
66
+
67
+
/*
68
+
Given the user has entered a number in the input field When the user clicks the “Set Alarm” button Then the “Time Remaining” title should update to show the entered number in mm:ss format
69
+
take value from in input field and store it in a variable inputTime
70
+
check inputTime value is within the accepted range?
71
+
take variable inputTime and display it in time remaining section
72
+
73
+
74
+
Given the alarm is set with a valid time When one second passes Then the “Time Remaining” title should decrement by 1 second
75
+
the the value for time remaining
76
+
check its a valid time (greater than 00:00)
77
+
decrease value of time remaining by 1 sec for each sec that passes
78
+
79
+
Given the alarm is set with a time of 00:00 When the timer reaches 00:00 Then the alarm sound should play continuously
80
+
check time remaining, if it is equal to 00:00 then sound alarm
81
+
82
+
83
+
Given the alarm sound is currently playing When the user clicks the “Stop Alarm” button Then the alarm sound should stop playing
84
+
check if stop alarm button has been pressed
85
+
if true then check if alarm sound is playing then stop alarm sound if true
86
+
87
+
Given the alarm is set with a time of 00:10 When the timer reaches 00:00 Then the background color should change And the alarm sound should play
88
+
if inputTime is 00:10 and timer reaches 0 the change background color
89
+
play alarm sound
90
+
91
+
Given the user has not set an alarm When the page first loads Then the “Time Remaining” title should show 00:00 And no alarm sound should play
92
+
when page loads time remaining should 0 and no alarm sound should play
0 commit comments