WEBVTT 00:00:07.500 --> 00:00:12.230 In this video we are going to go through the logic of our support up. 00:00:12.360 --> 00:00:18.210 So once we load the app if we click on the Start button we get to do three things. 00:00:18.810 --> 00:00:20.990 So we're going to start counting. 00:00:21.300 --> 00:00:29.240 Also we are going to show the top and lap buttons and we will change the mood of our app to on. 00:00:29.700 --> 00:00:34.310 Basically we're going to have two modes off and on once we load the app. 00:00:34.440 --> 00:00:36.420 The mode is going to be off. 00:00:36.480 --> 00:00:40.510 And once we click on the Start button it's going to change to on. 00:00:40.690 --> 00:00:41.550 OK. 00:00:41.910 --> 00:00:46.790 Now if we click on the stop button we can do two things. 00:00:46.940 --> 00:00:51.840 We will show the resume and reset buttons and we'll solve the count. 00:00:52.380 --> 00:01:01.410 If we click on the receive button then this is going to show the stop and lob buttons and we'll start 00:01:01.420 --> 00:01:03.040 to count again. 00:01:03.950 --> 00:01:09.130 But if we click on the Resume button would have to reload the page just like this. 00:01:09.770 --> 00:01:10.300 OK. 00:01:10.710 --> 00:01:12.240 Now let's toss the OP again. 00:01:12.480 --> 00:01:14.330 By clicking on the Start button. 00:01:15.270 --> 00:01:23.520 If we click on the flop button we are going to restart the lup counter and we are going to print the 00:01:23.520 --> 00:01:29.760 details of the previous flop and if we keep clicking on the love button we're going to keep printing 00:01:29.760 --> 00:01:33.760 details of previous laps just like this. 00:01:35.280 --> 00:01:42.630 So now we understood the logic of our up and we are ready to translate this logic into the equerry code 00:01:42.630 --> 00:01:45.780 structure. 00:01:45.810 --> 00:01:51.180 Now let's create a javascript's file where are we going to store our Jacqui recoat. 00:01:51.390 --> 00:02:03.600 So let's call it stopwatch days and let's make sure we link our index of HMO file to these javascript's 00:02:04.110 --> 00:02:05.480 file. 00:02:05.830 --> 00:02:14.910 If you're going to create a script at the end of the page and give us a source of abuse going to support 00:02:15.230 --> 00:02:20.050 bodies. 00:02:20.980 --> 00:02:22.620 OK. 00:02:24.210 --> 00:02:28.400 So I would say a query code structure is going to look like this. 00:02:28.410 --> 00:02:33.120 So on Bookman's load we are going to do all these steps. 00:02:33.300 --> 00:02:37.940 So first of all we can define all the variables we're going to need inside our code. 00:02:38.010 --> 00:02:40.160 So this includes the up mode. 00:02:40.260 --> 00:02:48.750 As mentioned earlier we're going to need a time counter for the accounting the time and a lot counter 00:02:49.020 --> 00:02:51.230 for counting the lab time. 00:02:51.270 --> 00:02:51.870 OK. 00:02:52.230 --> 00:02:58.300 Also going to need a variable for the set interval like we did in the first game. 00:02:58.860 --> 00:02:59.430 Okay. 00:02:59.640 --> 00:03:06.220 And also we're going to add another variable for the number of flops. 00:03:06.270 --> 00:03:12.670 So it is going to track the lup number that we're going to need when we print the lab details. 00:03:13.440 --> 00:03:14.020 Okay. 00:03:14.310 --> 00:03:19.380 And then we're going to need all these variables the minutes seconds and seconds. 00:03:19.440 --> 00:03:25.300 We're going to need two sets the values of all these elements. 00:03:26.070 --> 00:03:27.120 OK. 00:03:28.560 --> 00:03:29.820 All right. 00:03:29.820 --> 00:03:36.420 Now when we load the app we are going to do a few things. 00:03:36.510 --> 00:03:46.320 So we're going to start by hiding all the buttons and then we're going to show only two buttons and 00:03:46.320 --> 00:03:50.320 it's going to be the start button and the lock button. 00:03:50.820 --> 00:03:52.720 OK. 00:03:52.750 --> 00:03:54.690 Is that it again. 00:03:55.720 --> 00:03:57.220 OK. 00:03:58.110 --> 00:04:03.840 Then we are going to write some code to tell the browser what to do when we click on the Start button 00:04:03.860 --> 00:04:04.440 . 00:04:05.010 --> 00:04:10.240 So when we click on the Start button we are going to change the up mode to own. 00:04:10.320 --> 00:04:17.470 And also we are going to show the stop and lock buttons and also we're going to start the card. 00:04:17.880 --> 00:04:26.250 Now if we click on the stop button we are going to show another two ounces resumed resets and also we're 00:04:26.240 --> 00:04:27.830 going to stop the count. 00:04:28.290 --> 00:04:36.950 If we click on the receive button then we are going to show the stop and love buttons. 00:04:38.130 --> 00:04:38.550 OK 00:04:42.570 --> 00:04:50.350 and if we click on the reset button we are going to reload the page OK. 00:04:50.460 --> 00:04:59.950 Now if we click on the lock button if the OP mode is on we are going to stop the action. 00:05:00.270 --> 00:05:02.820 OK we'll explain what this is later. 00:05:03.030 --> 00:05:14.280 And we're going to print the lup details inside the law books just like this. 00:05:14.280 --> 00:05:14.820 OK. 00:05:15.090 --> 00:05:21.170 And we're going to recess the current lap which is going to start from zero. 00:05:21.900 --> 00:05:28.770 And finally we're going to have a piece of code where we can write all the functions we need to execute 00:05:29.100 --> 00:05:31.970 all the code we have covered so far. 00:05:32.490 --> 00:05:37.440 OK so in the next video we are going to translate this code structure into Jay Querrey code