File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,19 @@ document.addEventListener("DOMContentLoaded", () => {
76
76
videoPlayer . insertAdjacentElement ( "afterend" , episodeLink ) ;
77
77
}
78
78
episodeLink . href = video . release_url ;
79
+
80
+ // Remove 'playing' class from all playlist items
81
+ document . querySelectorAll ( "#playlist li" ) . forEach ( ( li ) => {
82
+ li . classList . remove ( "playing" ) ;
83
+ } ) ;
84
+
85
+ // Add 'playing' class to the current playlist item
86
+ const currentItem = Array . from ( playlist . children ) . find ( ( li ) =>
87
+ li . querySelector ( `a[href="#${ video . tag_name } "]` )
88
+ ) ;
89
+ if ( currentItem ) {
90
+ currentItem . classList . add ( "playing" ) ;
91
+ }
79
92
}
80
93
81
94
// Initialize the application
Original file line number Diff line number Diff line change @@ -93,6 +93,10 @@ video {
93
93
background-color : var (--hover-color ); /* Use variable for hover color */
94
94
}
95
95
96
+ # playlist li .playing {
97
+ font-weight : bold; /* Make text bold */
98
+ }
99
+
96
100
# playlist a {
97
101
color : var (--text-color ); /* Use variable for text color */
98
102
text-decoration : none; /* Remove underline */
You can’t perform that action at this time.
0 commit comments