-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
1282 lines (1039 loc) · 40.4 KB
/
script.js
File metadata and controls
1282 lines (1039 loc) · 40.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// STOPWATCH-1 VARIABLES
const stopwatch_1 = document.getElementById("stopwatch_1");
const playPauseButton_1 = document.getElementById("play-pause_1");
const stopButton_1 = document.getElementById("stop_1");
let stopwatchInterval_1;
let runningTime_1 = 0;
// STOPWATCH-1 DATA VARIABLES
const convStart_1 = document.getElementById("conv-start-1");
const convEnd_1 = document.getElementById("conv-end-1");
const expEnd_1 = document.getElementById("exp-end-1");
// STOPWATCH-1 EVENT LISTENERS
playPauseButton_1.addEventListener("click", playPauseOne);
stopButton_1.addEventListener("click", stopOne);
// STOPWATCH-1 DATA EVENT LISTENERS
convStart_1.addEventListener("click", addDataConv_1);
convEnd_1.addEventListener("click", addDataFconv_1);
// STOPWATCH-1 ADD DATA CONVULSION FUNCTION
function addDataConv_1() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_1.textContent);
node.appendChild(textnode);
document.getElementById("row-1_s1").appendChild(node);
}
// STOPWATCH-1 ADD DATA FINAL CONVULSION FUNCTION
function addDataFconv_1() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_1.textContent);
node.appendChild(textnode);
document.getElementById("row-2_s1").appendChild(node);
}
// STOPWATCH-1 START FUNCTION
function startOne() {
let startTime = Date.now() - runningTime_1;
stopwatchInterval_1 = setInterval(() => {
runningTime_1 = Date.now() - startTime;
stopwatch_1.textContent = calculateTimeOne(runningTime_1);
}, 1000);
}
// STOPWATCH-1 PLAY-PAUSE FUNCTION
function playPauseOne() {
const isPaused = !playPauseButton_1.classList.contains("running");
if (isPaused) {
playPauseButton_1.classList.add("running");
startOne();
} else {
playPauseButton_1.classList.remove("running");
pauseOne();
}
}
// STOPWATCH-1 PAUSE FUNCTION
function pauseOne() {
clearInterval(stopwatchInterval_1);
}
// STOPWATCH-1 STOP FUNCTION
function stopOne() {
playPauseButton_1.classList.remove("running");
runningTime_1 = 0;
clearInterval(stopwatchInterval_1);
stopwatch_1.textContent = "00:00";
}
// STOPWATCH-1 CALCULATE TIME FUNCTION
function calculateTimeOne(runningTime_1) {
const total_seconds = Math.floor(runningTime_1 / 1000);
const total_minutes = Math.floor(total_seconds / 60);
const display_seconds = (total_seconds % 60).toString().padStart(2, "0");
const display_minutes = total_minutes.toString().padStart(2, "0");
return `${display_minutes}:${display_seconds}`;
}
//-----------------2--------------------------------------
// STOPWATCH-2 VARIABLES
const stopwatch_2 = document.getElementById("stopwatch_2");
const playPauseButton_2 = document.getElementById("play-pause_2");
const stopButton_2 = document.getElementById("stop_2");
let stopwatchInterval_2;
let runningTime_2 = 0;
// STOPWATCH-2 DATA VARIABLES
const convStart_2 = document.getElementById("conv-start-2");
const convEnd_2 = document.getElementById("conv-end-2");
const expEnd_2 = document.getElementById("exp-end-2");
// STOPWATCH-2 EVENT LISTENERS
playPauseButton_2.addEventListener("click", playPauseTwo);
stopButton_2.addEventListener("click", stopTwo);
// STOPWATCH-2 DATA EVENT LISTENERS
convStart_2.addEventListener("click", addDataConv_2);
convEnd_2.addEventListener("click", addDataFconv_2);
// STOPWATCH-2 ADD DATA CONVULSION FUNCTION
function addDataConv_2() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_2.textContent);
node.appendChild(textnode);
document.getElementById("row-1_s2").appendChild(node);
}
// STOPWATCH-2 ADD DATA FINAL CONVULSION FUNCTION
function addDataFconv_2() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_2.textContent);
node.appendChild(textnode);
document.getElementById("row-2_s2").appendChild(node);
}
// STOPWATCH-2 START FUNCTION
function startTwo() {
let startTime = Date.now() - runningTime_2;
stopwatchInterval_2 = setInterval(() => {
runningTime_2 = Date.now() - startTime;
stopwatch_2.textContent = calculateTimeTwo(runningTime_2);
}, 1000);
}
// STOPWATCH-2 PLAY-PAUSE FUNCTION
function playPauseTwo() {
const isPaused = !playPauseButton_2.classList.contains("running");
if (isPaused) {
playPauseButton_2.classList.add("running");
startTwo();
} else {
playPauseButton_2.classList.remove("running");
pauseTwo();
}
}
// STOPWATCH-2 PAUSE FUNCTION
function pauseTwo() {
clearInterval(stopwatchInterval_2);
}
// STOPWATCH-2 STOP FUNCTION
function stopTwo() {
playPauseButton_2.classList.remove("running");
runningTime_2 = 0;
clearInterval(stopwatchInterval_2);
stopwatch_2.textContent = "00:00";
}
// STOPWATCH-2 CALCULATE TIME FUNCTION
function calculateTimeTwo(runningTime_2) {
const total_seconds = Math.floor(runningTime_2 / 1000);
const total_minutes = Math.floor(total_seconds / 60);
const display_seconds = (total_seconds % 60).toString().padStart(2, "0");
const display_minutes = total_minutes.toString().padStart(2, "0");
return `${display_minutes}:${display_seconds}`;
}
//-------------------------------3--------------------------
// STOPWATCH-3 VARIABLES
const stopwatch_3 = document.getElementById("stopwatch_3");
const playPauseButton_3 = document.getElementById("play-pause_3");
const stopButton_3 = document.getElementById("stop_3");
let stopwatchInterval_3;
let runningTime_3 = 0;
// STOPWATCH-3 DATA VARIABLES
const convStart_3 = document.getElementById("conv-start-3");
const convEnd_3 = document.getElementById("conv-end-3");
const expEnd_3 = document.getElementById("exp-end-3");
// STOPWATCH-3 EVENT LISTENERS
playPauseButton_3.addEventListener("click", playPauseThree);
stopButton_3.addEventListener("click", stopThree);
// STOPWATCH-3 DATA EVENT LISTENERS
convStart_3.addEventListener("click", addDataConv_3);
convEnd_3.addEventListener("click", addDataFconv_3);
// STOPWATCH-3 ADD DATA CONVULSION FUNCTION
function addDataConv_3() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_3.textContent);
node.appendChild(textnode);
document.getElementById("row-1_s3").appendChild(node);
}
// STOPWATCH-3 ADD DATA FINAL CONVULSION FUNCTION
function addDataFconv_3() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_3.textContent);
node.appendChild(textnode);
document.getElementById("row-2_s3").appendChild(node);
}
// STOPWATCH-3 START FUNCTION
function startThree() {
let startTime = Date.now() - runningTime_3;
stopwatchInterval_3 = setInterval(() => {
runningTime_3 = Date.now() - startTime;
stopwatch_3.textContent = calculateTimeThree(runningTime_3);
}, 1000);
}
// STOPWATCH-3 PLAY-PAUSE FUNCTION
function playPauseThree() {
const isPaused = !playPauseButton_3.classList.contains("running");
if (isPaused) {
playPauseButton_3.classList.add("running");
startThree();
} else {
playPauseButton_3.classList.remove("running");
pauseThree();
}
}
// STOPWATCH-3 PAUSE FUNCTION
function pauseThree() {
clearInterval(stopwatchInterval_3);
}
// STOPWATCH-3 STOP FUNCTION
function stopThree() {
playPauseButton_3.classList.remove("running");
runningTime_3 = 0;
clearInterval(stopwatchInterval_3);
stopwatch_3.textContent = "00:00";
}
// STOPWATCH-3 CALCULATE TIME FUNCTION
function calculateTimeThree(runningTime_3) {
const total_seconds = Math.floor(runningTime_3 / 1000);
const total_minutes = Math.floor(total_seconds / 60);
const display_seconds = (total_seconds % 60).toString().padStart(2, "0");
const display_minutes = total_minutes.toString().padStart(2, "0");
return `${display_minutes}:${display_seconds}`;
}
// FINAL BOX ONE ------------------------------------------------------------
// START BOX TWO ------------------------------4-----------------------------
// STOPWATCH-4 VARIABLES
const stopwatch_4 = document.getElementById("stopwatch_4");
const playPauseButton_4 = document.getElementById("play-pause_4");
const stopButton_4 = document.getElementById("stop_4");
let stopwatchInterval_4;
let runningTime_4 = 0;
// STOPWATCH-4 DATA VARIABLES
const convStart_4 = document.getElementById("conv-start-4");
const convEnd_4 = document.getElementById("conv-end-4");
const expEnd_4 = document.getElementById("exp-end-4");
// STOPWATCH-4 EVENT LISTENERS
playPauseButton_4.addEventListener("click", playPauseFour);
stopButton_4.addEventListener("click", stopFour);
// STOPWATCH-4 DATA EVENT LISTENERS
convStart_4.addEventListener("click", addDataConv_4);
convEnd_4.addEventListener("click", addDataFconv_4);
// STOPWATCH-4 ADD DATA CONVULSION FUNCTION
function addDataConv_4() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_4.textContent);
node.appendChild(textnode);
document.getElementById("row-1_s4").appendChild(node);
}
// STOPWATCH-4 ADD DATA FINAL CONVULSION FUNCTION
function addDataFconv_4() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_4.textContent);
node.appendChild(textnode);
document.getElementById("row-2_s4").appendChild(node);
}
// STOPWATCH-4 START FUNCTION
function startFour() {
let startTime = Date.now() - runningTime_4;
stopwatchInterval_4 = setInterval(() => {
runningTime_4 = Date.now() - startTime;
stopwatch_4.textContent = calculateTimeFour(runningTime_4);
}, 1000);
}
// STOPWATCH-4 PLAY-PAUSE FUNCTION
function playPauseFour() {
const isPaused = !playPauseButton_4.classList.contains("running");
if (isPaused) {
playPauseButton_4.classList.add("running");
startFour();
} else {
playPauseButton_4.classList.remove("running");
pauseFour();
}
}
// STOPWATCH-4 PAUSE FUNCTION
function pauseFour() {
clearInterval(stopwatchInterval_4);
}
// STOPWATCH-4 STOP FUNCTION
function stopFour() {
playPauseButton_4.classList.remove("running");
runningTime_4 = 0;
clearInterval(stopwatchInterval_4);
stopwatch_4.textContent = "00:00";
}
// STOPWATCH-4 CALCULATE TIME FUNCTION
function calculateTimeFour(runningTime_4) {
const total_seconds = Math.floor(runningTime_4 / 1000);
const total_minutes = Math.floor(total_seconds / 60);
const display_seconds = (total_seconds % 60).toString().padStart(2, "0");
const display_minutes = total_minutes.toString().padStart(2, "0");
return `${display_minutes}:${display_seconds}`;
}
//-------------------------------------5------------------------------------
// STOPWATCH-5 VARIABLES
const stopwatch_5 = document.getElementById("stopwatch_5");
const playPauseButton_5 = document.getElementById("play-pause_5");
const stopButton_5 = document.getElementById("stop_5");
let stopwatchInterval_5;
let runningTime_5 = 0;
// STOPWATCH-5 DATA VARIABLES
const convStart_5 = document.getElementById("conv-start-5");
const convEnd_5 = document.getElementById("conv-end-5");
const expEnd_5 = document.getElementById("exp-end-5");
// STOPWATCH-5 EVENT LISTENERS
playPauseButton_5.addEventListener("click", playPauseFive);
stopButton_5.addEventListener("click", stopFive);
// STOPWATCH-5 DATA EVENT LISTENERS
convStart_5.addEventListener("click", addDataConv_5);
convEnd_5.addEventListener("click", addDataFconv_5);
// STOPWATCH-5 ADD DATA CONVULSION FUNCTION
function addDataConv_5() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_5.textContent);
node.appendChild(textnode);
document.getElementById("row-1_s5").appendChild(node);
}
// STOPWATCH-5 ADD DATA FINAL CONVULSION FUNCTION
function addDataFconv_5() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_5.textContent);
node.appendChild(textnode);
document.getElementById("row-2_s5").appendChild(node);
}
// STOPWATCH-5 START FUNCTION
function startFive() {
let startTime = Date.now() - runningTime_5;
stopwatchInterval_5 = setInterval(() => {
runningTime_5 = Date.now() - startTime;
stopwatch_5.textContent = calculateTimeFive(runningTime_5);
}, 1000);
}
// STOPWATCH-5 PLAY-PAUSE FUNCTION
function playPauseFive() {
const isPaused = !playPauseButton_5.classList.contains("running");
if (isPaused) {
playPauseButton_5.classList.add("running");
startFive();
} else {
playPauseButton_5.classList.remove("running");
pauseFive();
}
}
// STOPWATCH-5 PAUSE FUNCTION
function pauseFive() {
clearInterval(stopwatchInterval_5);
}
// STOPWATCH-5 STOP FUNCTION
function stopFive() {
playPauseButton_5.classList.remove("running");
runningTime_5 = 0;
clearInterval(stopwatchInterval_5);
stopwatch_5.textContent = "00:00";
}
// STOPWATCH-5 CALCULATE TIME FUNCTION
function calculateTimeFive(runningTime_5) {
const total_seconds = Math.floor(runningTime_5 / 1000);
const total_minutes = Math.floor(total_seconds / 60);
const display_seconds = (total_seconds % 60).toString().padStart(2, "0");
const display_minutes = total_minutes.toString().padStart(2, "0");
return `${display_minutes}:${display_seconds}`;
}
//----------------------------------6---------------------------------------
// STOPWATCH-6 VARIABLES
const stopwatch_6 = document.getElementById("stopwatch_6");
const playPauseButton_6 = document.getElementById("play-pause_6");
const stopButton_6 = document.getElementById("stop_6");
let stopwatchInterval_6;
let runningTime_6 = 0;
// STOPWATCH-6 DATA VARIABLES
const convStart_6 = document.getElementById("conv-start-6");
const convEnd_6 = document.getElementById("conv-end-6");
const expEnd_6 = document.getElementById("exp-end-6");
// STOPWATCH-6 EVENT LISTENERS
playPauseButton_6.addEventListener("click", playPauseSix);
stopButton_6.addEventListener("click", stopSix);
// STOPWATCH-6 DATA EVENT LISTENERS
convStart_6.addEventListener("click", addDataConv_6);
convEnd_6.addEventListener("click", addDataFconv_6);
// STOPWATCH-6 ADD DATA CONVULSION FUNCTION
function addDataConv_6() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_6.textContent);
node.appendChild(textnode);
document.getElementById("row-1_s6").appendChild(node);
}
// STOPWATCH-6 ADD DATA FINAL CONVULSION FUNCTION
function addDataFconv_6() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_6.textContent);
node.appendChild(textnode);
document.getElementById("row-2_s6").appendChild(node);
}
// STOPWATCH-6 START FUNCTION
function startSix() {
let startTime = Date.now() - runningTime_6;
stopwatchInterval_6 = setInterval(() => {
runningTime_6 = Date.now() - startTime;
stopwatch_6.textContent = calculateTimeSix(runningTime_6);
}, 1000);
}
// STOPWATCH-6 PLAY-PAUSE FUNCTION
function playPauseSix() {
const isPaused = !playPauseButton_6.classList.contains("running");
if (isPaused) {
playPauseButton_6.classList.add("running");
startSix();
} else {
playPauseButton_6.classList.remove("running");
pauseSix();
}
}
// STOPWATCH-6 PAUSE FUNCTION
function pauseSix() {
clearInterval(stopwatchInterval_6);
}
// STOPWATCH-6 STOP FUNCTION
function stopSix() {
playPauseButton_6.classList.remove("running");
runningTime_6 = 0;
clearInterval(stopwatchInterval_6);
stopwatch_6.textContent = "00:00";
}
// STOPWATCH-6 CALCULATE TIME FUNCTION
function calculateTimeSix(runningTime_6) {
const total_seconds = Math.floor(runningTime_6 / 1000);
const total_minutes = Math.floor(total_seconds / 60);
const display_seconds = (total_seconds % 60).toString().padStart(2, "0");
const display_minutes = total_minutes.toString().padStart(2, "0");
return `${display_minutes}:${display_seconds}`;
}
// FINAL BOX TWO ----------------------------------------------------------------
// START BOX THREE ----------------7-------------------------
// STOPWATCH-7 VARIABLES
const stopwatch_7 = document.getElementById("stopwatch_7");
const playPauseButton_7 = document.getElementById("play-pause_7");
const stopButton_7 = document.getElementById("stop_7");
let stopwatchInterval_7;
let runningTime_7 = 0;
// STOPWATCH-7 DATA VARIABLES
const convStart_7 = document.getElementById("conv-start-7");
const convEnd_7 = document.getElementById("conv-end-7");
const expEnd_7 = document.getElementById("exp-end-7");
// STOPWATCH-7 EVENT LISTENERS
playPauseButton_7.addEventListener("click", playPauseSeven);
stopButton_7.addEventListener("click", stopSeven);
// STOPWATCH-7 DATA EVENT LISTENERS
convStart_7.addEventListener("click", addDataConv_7);
convEnd_7.addEventListener("click", addDataFconv_7);
// STOPWATCH-7 ADD DATA CONVULSION FUNCTION
function addDataConv_7() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_7.textContent);
node.appendChild(textnode);
document.getElementById("row-1_s7").appendChild(node);
}
// STOPWATCH-7 ADD DATA FINAL CONVULSION FUNCTION
function addDataFconv_7() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_7.textContent);
node.appendChild(textnode);
document.getElementById("row-2_s7").appendChild(node);
}
// STOPWATCH-7 START FUNCTION
function startSeven() {
let startTime = Date.now() - runningTime_7;
stopwatchInterval_7 = setInterval(() => {
runningTime_7 = Date.now() - startTime;
stopwatch_7.textContent = calculateTimeSeven(runningTime_7);
}, 1000);
}
// STOPWATCH-7 PLAY-PAUSE FUNCTION
function playPauseSeven() {
const isPaused = !playPauseButton_7.classList.contains("running");
if (isPaused) {
playPauseButton_7.classList.add("running");
startSeven();
} else {
playPauseButton_7.classList.remove("running");
pauseSeven();
}
}
// STOPWATCH-7 PAUSE FUNCTION
function pauseSeven() {
clearInterval(stopwatchInterval_7);
}
// STOPWATCH-7 STOP FUNCTION
function stopSeven() {
playPauseButton_7.classList.remove("running");
runningTime_7 = 0;
clearInterval(stopwatchInterval_7);
stopwatch_7.textContent = "00:00";
}
// STOPWATCH-7 CALCULATE TIME FUNCTION
function calculateTimeSeven(runningTime_7) {
const total_seconds = Math.floor(runningTime_7 / 1000);
const total_minutes = Math.floor(total_seconds / 60);
const display_seconds = (total_seconds % 60).toString().padStart(2, "0");
const display_minutes = total_minutes.toString().padStart(2, "0");
return `${display_minutes}:${display_seconds}`;
}
//---------------------------8-------------------------------
// STOPWATCH-8 VARIABLES
const stopwatch_8 = document.getElementById("stopwatch_8");
const playPauseButton_8 = document.getElementById("play-pause_8");
const stopButton_8 = document.getElementById("stop_8");
let stopwatchInterval_8;
let runningTime_8 = 0;
// STOPWATCH-8 DATA VARIABLES
const convStart_8 = document.getElementById("conv-start-8");
const convEnd_8 = document.getElementById("conv-end-8");
const expEnd_8 = document.getElementById("exp-end-8");
// STOPWATCH-8 EVENT LISTENERS
playPauseButton_8.addEventListener("click", playPauseEight);
stopButton_8.addEventListener("click", stopEight);
// STOPWATCH-8 DATA EVENT LISTENERS
convStart_8.addEventListener("click", addDataConv_8);
convEnd_8.addEventListener("click", addDataFconv_8);
// STOPWATCH-8 ADD DATA CONVULSION FUNCTION
function addDataConv_8() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_8.textContent);
node.appendChild(textnode);
document.getElementById("row-1_s8").appendChild(node);
}
// STOPWATCH-8 ADD DATA FINAL CONVULSION FUNCTION
function addDataFconv_8() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_8.textContent);
node.appendChild(textnode);
document.getElementById("row-2_s8").appendChild(node);
}
// STOPWATCH-8 START FUNCTION
function startEight() {
let startTime = Date.now() - runningTime_8;
stopwatchInterval_8 = setInterval(() => {
runningTime_8 = Date.now() - startTime;
stopwatch_8.textContent = calculateTimeEight(runningTime_8);
}, 1000);
}
// STOPWATCH-8 PLAY-PAUSE FUNCTION
function playPauseEight() {
const isPaused = !playPauseButton_8.classList.contains("running");
if (isPaused) {
playPauseButton_8.classList.add("running");
startEight();
} else {
playPauseButton_8.classList.remove("running");
pauseEight();
}
}
// STOPWATCH-8 PAUSE FUNCTION
function pauseEight() {
clearInterval(stopwatchInterval_8);
}
// STOPWATCH-8 STOP FUNCTION
function stopEight() {
playPauseButton_8.classList.remove("running");
runningTime_8 = 0;
clearInterval(stopwatchInterval_8);
stopwatch_8.textContent = "00:00";
}
// STOPWATCH-8 CALCULATE TIME FUNCTION
function calculateTimeEight(runningTime_8) {
const total_seconds = Math.floor(runningTime_8 / 1000);
const total_minutes = Math.floor(total_seconds / 60);
const display_seconds = (total_seconds % 60).toString().padStart(2, "0");
const display_minutes = total_minutes.toString().padStart(2, "0");
return `${display_minutes}:${display_seconds}`;
}
//-----------------------------9------------------------
// STOPWATCH-9 VARIABLES
const stopwatch_9 = document.getElementById("stopwatch_9");
const playPauseButton_9 = document.getElementById("play-pause_9");
const stopButton_9 = document.getElementById("stop_9");
let stopwatchInterval_9;
let runningTime_9 = 0;
// STOPWATCH-9 DATA VARIABLES
const convStart_9 = document.getElementById("conv-start-9");
const convEnd_9 = document.getElementById("conv-end-9");
const expEnd_9 = document.getElementById("exp-end-9");
// STOPWATCH-9 EVENT LISTENERS
playPauseButton_9.addEventListener("click", playPauseNine);
stopButton_9.addEventListener("click", stopNine);
// STOPWATCH-9 DATA EVENT LISTENERS
convStart_9.addEventListener("click", addDataConv_9);
convEnd_9.addEventListener("click", addDataFconv_9);
// STOPWATCH-9 ADD DATA CONVULSION FUNCTION
function addDataConv_9() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_9.textContent);
node.appendChild(textnode);
document.getElementById("row-1_s9").appendChild(node);
}
// STOPWATCH-9 ADD DATA FINAL CONVULSION FUNCTION
function addDataFconv_9() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_9.textContent);
node.appendChild(textnode);
document.getElementById("row-2_s9").appendChild(node);
}
// STOPWATCH-9 START FUNCTION
function startNine() {
let startTime = Date.now() - runningTime_9;
stopwatchInterval_9 = setInterval(() => {
runningTime_9 = Date.now() - startTime;
stopwatch_9.textContent = calculateTimeNine(runningTime_9);
}, 1000);
}
// STOPWATCH-9 PLAY-PAUSE FUNCTION
function playPauseNine() {
const isPaused = !playPauseButton_9.classList.contains("running");
if (isPaused) {
playPauseButton_9.classList.add("running");
startNine();
} else {
playPauseButton_9.classList.remove("running");
pauseNine();
}
}
// STOPWATCH-9 PAUSE FUNCTION
function pauseNine() {
clearInterval(stopwatchInterval_9);
}
// STOPWATCH-9 STOP FUNCTION
function stopNine() {
playPauseButton_9.classList.remove("running");
runningTime_9 = 0;
clearInterval(stopwatchInterval_9);
stopwatch_9.textContent = "00:00";
}
// STOPWATCH-9 CALCULATE TIME FUNCTION
function calculateTimeNine(runningTime_9) {
const total_seconds = Math.floor(runningTime_9 / 1000);
const total_minutes = Math.floor(total_seconds / 60);
const display_seconds = (total_seconds % 60).toString().padStart(2, "0");
const display_minutes = total_minutes.toString().padStart(2, "0");
return `${display_minutes}:${display_seconds}`;
}
// FINAL BOX THREE -------------------------------------------------------------
// START BOX FOUR ------------------10-----------------
// STOPWATCH-10 VARIABLES
const stopwatch_10 = document.getElementById("stopwatch_10");
const playPauseButton_10 = document.getElementById("play-pause_10");
const stopButton_10 = document.getElementById("stop_10");
let stopwatchInterval_10;
let runningTime_10 = 0;
// STOPWATCH-10 DATA VARIABLES
const convStart_10 = document.getElementById("conv-start-10");
const convEnd_10 = document.getElementById("conv-end-10");
const expEnd_10 = document.getElementById("exp-end-10");
// STOPWATCH-10 EVENT LISTENERS
playPauseButton_10.addEventListener("click", playPauseTen);
stopButton_10.addEventListener("click", stopTen);
// STOPWATCH-10 DATA EVENT LISTENERS
convStart_10.addEventListener("click", addDataConv_10);
convEnd_10.addEventListener("click", addDataFconv_10);
// STOPWATCH-10 ADD DATA CONVULSION FUNCTION
function addDataConv_10() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_10.textContent);
node.appendChild(textnode);
document.getElementById("row-1_s10").appendChild(node);
}
// STOPWATCH-10 ADD DATA FINAL CONVULSION FUNCTION
function addDataFconv_10() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_10.textContent);
node.appendChild(textnode);
document.getElementById("row-2_s10").appendChild(node);
}
// STOPWATCH-10 START FUNCTION
function startTen() {
let startTime = Date.now() - runningTime_10;
stopwatchInterval_10 = setInterval(() => {
runningTime_10 = Date.now() - startTime;
stopwatch_10.textContent = calculateTimeTen(runningTime_10);
}, 1000);
}
// STOPWATCH-10 PLAY-PAUSE FUNCTION
function playPauseTen() {
const isPaused = !playPauseButton_10.classList.contains("running");
if (isPaused) {
playPauseButton_10.classList.add("running");
startTen();
} else {
playPauseButton_10.classList.remove("running");
pauseTen();
}
}
// STOPWATCH-10 PAUSE FUNCTION
function pauseTen() {
clearInterval(stopwatchInterval_10);
}
// STOPWATCH-10 STOP FUNCTION
function stopTen() {
playPauseButton_10.classList.remove("running");
runningTime_10 = 0;
clearInterval(stopwatchInterval_10);
stopwatch_10.textContent = "00:00";
}
// STOPWATCH-10 CALCULATE TIME FUNCTION
function calculateTimeTen(runningTime_10) {
const total_seconds = Math.floor(runningTime_10 / 1000);
const total_minutes = Math.floor(total_seconds / 60);
const display_seconds = (total_seconds % 60).toString().padStart(2, "0");
const display_minutes = total_minutes.toString().padStart(2, "0");
return `${display_minutes}:${display_seconds}`;
}
//-----------------------11--------------------------
// STOPWATCH-11 VARIABLES
const stopwatch_11 = document.getElementById("stopwatch_11");
const playPauseButton_11 = document.getElementById("play-pause_11");
const stopButton_11 = document.getElementById("stop_11");
let stopwatchInterval_11;
let runningTime_11 = 0;
// STOPWATCH-11 DATA VARIABLES
const convStart_11 = document.getElementById("conv-start-11");
const convEnd_11 = document.getElementById("conv-end-11");
const expEnd_11 = document.getElementById("exp-end-11");
// STOPWATCH-11 EVENT LISTENERS
playPauseButton_11.addEventListener("click", playPauseEleven);
stopButton_11.addEventListener("click", stopEleven);
// STOPWATCH-11 DATA EVENT LISTENERS
convStart_11.addEventListener("click", addDataConv_11);
convEnd_11.addEventListener("click", addDataFconv_11);
// STOPWATCH-11 ADD DATA CONVULSION FUNCTION
function addDataConv_11() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_11.textContent);
node.appendChild(textnode);
document.getElementById("row-1_s11").appendChild(node);
}
// STOPWATCH-11 ADD DATA FINAL CONVULSION FUNCTION
function addDataFconv_11() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_11.textContent);
node.appendChild(textnode);
document.getElementById("row-2_s11").appendChild(node);
}
// STOPWATCH-11 START FUNCTION
function startEleven() {
let startTime = Date.now() - runningTime_11;
stopwatchInterval_11 = setInterval(() => {
runningTime_11 = Date.now() - startTime;
stopwatch_11.textContent = calculateTimeEleven(runningTime_11);
}, 1000);
}
// STOPWATCH-11 PLAY-PAUSE FUNCTION
function playPauseEleven() {
const isPaused = !playPauseButton_11.classList.contains("running");
if (isPaused) {
playPauseButton_11.classList.add("running");
startEleven();
} else {
playPauseButton_11.classList.remove("running");
pauseEleven();
}
}
// STOPWATCH-11 PAUSE FUNCTION
function pauseEleven() {
clearInterval(stopwatchInterval_11);
}
// STOPWATCH-11 STOP FUNCTION
function stopEleven() {
playPauseButton_11.classList.remove("running");
runningTime_11 = 0;
clearInterval(stopwatchInterval_11);
stopwatch_11.textContent = "00:00";
}
// STOPWATCH-11 CALCULATE TIME FUNCTION
function calculateTimeEleven(runningTime_11) {
const total_seconds = Math.floor(runningTime_11 / 1000);
const total_minutes = Math.floor(total_seconds / 60);
const display_seconds = (total_seconds % 60).toString().padStart(2, "0");
const display_minutes = total_minutes.toString().padStart(2, "0");
return `${display_minutes}:${display_seconds}`;
}
//------------------------12------------------------------
// STOPWATCH-12 VARIABLES
const stopwatch_12 = document.getElementById("stopwatch_12");
const playPauseButton_12 = document.getElementById("play-pause_12");
const stopButton_12 = document.getElementById("stop_12");
let stopwatchInterval_12;
let runningTime_12 = 0;
// STOPWATCH-12 DATA VARIABLES
const convStart_12 = document.getElementById("conv-start-12");
const convEnd_12 = document.getElementById("conv-end-12");
const expEnd_12 = document.getElementById("exp-end-12");
// STOPWATCH-12 EVENT LISTENERS
playPauseButton_12.addEventListener("click", playPauseTwelve);
stopButton_12.addEventListener("click", stopTwelve);
// STOPWATCH-12 DATA EVENT LISTENERS
convStart_12.addEventListener("click", addDataConv_12);
convEnd_12.addEventListener("click", addDataFconv_12);
// STOPWATCH-12 ADD DATA CONVULSION FUNCTION
function addDataConv_12() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_12.textContent);
node.appendChild(textnode);
document.getElementById("row-1_s12").appendChild(node);
}
// STOPWATCH-12 ADD DATA FINAL CONVULSION FUNCTION
function addDataFconv_12() {
const node = document.createElement("td");
const textnode = document.createTextNode(stopwatch_12.textContent);
node.appendChild(textnode);
document.getElementById("row-2_s12").appendChild(node);
}
// STOPWATCH-12 START FUNCTION
function startTwelve() {
let startTime = Date.now() - runningTime_12;
stopwatchInterval_12 = setInterval(() => {
runningTime_12 = Date.now() - startTime;
stopwatch_12.textContent = calculateTimeTwelve(runningTime_12);
}, 1000);
}
// STOPWATCH-12 PLAY-PAUSE FUNCTION
function playPauseTwelve() {
const isPaused = !playPauseButton_12.classList.contains("running");
if (isPaused) {
playPauseButton_12.classList.add("running");
startTwelve();
} else {
playPauseButton_12.classList.remove("running");
pauseTwelve();
}
}