File tree 4 files changed +35
-1
lines changed
4 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ <h1 id="my-heading" style="margin-bottom: -10px">
27
27
The Mo< span class ="highlight "> vieV</ span > erse
28
28
</ h1 >
29
29
30
+ < div >
31
+ < p id ="time-label "> Local Time:</ p >
32
+ < h1 id ="clock " class ="clock "> </ h1 >
33
+ </ div >
34
+
30
35
<!-- Create a button to toggle the side navigation bar -->
31
36
< button id ="nav-toggle " class ="nav-toggle " title ="Toggle Side Navbar " onclick ="toggleNav() ">
32
37
< i class ="fas fa-bars "> </ i >
Original file line number Diff line number Diff line change @@ -377,5 +377,4 @@ async function showMovieOfTheDay(){
377
377
console . error ( 'Error fetching movie:' , error ) ;
378
378
alert ( 'Failed to fetch the movie of the day. Please try again later.' ) ;
379
379
}
380
-
381
380
}
Original file line number Diff line number Diff line change @@ -1274,5 +1274,25 @@ function showMoviesDirectorSpotlight(movies) {
1274
1274
1275
1275
main20 . appendChild ( movieE1 ) ;
1276
1276
} ) ;
1277
+ }
1278
+
1279
+ function updateClock ( ) {
1280
+ var now = new Date ( ) ;
1281
+ var hours = now . getHours ( ) ;
1282
+ var minutes = now . getMinutes ( ) ;
1283
+
1284
+ // Add leading zero to minutes if less than 10
1285
+ minutes = minutes < 10 ? '0' + minutes : minutes ;
1277
1286
1287
+ // Format the time in HH:MM format
1288
+ var timeString = hours + ':' + minutes ;
1289
+
1290
+ // Update the clock element
1291
+ document . getElementById ( 'clock' ) . innerHTML = timeString ;
1278
1292
}
1293
+
1294
+ // Update the clock every second
1295
+ setInterval ( updateClock , 1000 ) ;
1296
+
1297
+ // Initialize the clock on page load
1298
+ window . onload = updateClock ;
Original file line number Diff line number Diff line change 705
705
margin : 10px auto;
706
706
}
707
707
708
+ .clock {
709
+ text-align : center;
710
+ font-size : 20px ;
711
+ color : # ff8623 ;
712
+ }
713
+
714
+ # time-label {
715
+ color : # ff8623 ;
716
+ }
717
+
708
718
.app-btn : hover {
709
719
background-color : # ff8623 ;
710
720
}
You can’t perform that action at this time.
0 commit comments