Skip to content

Commit 7fe5409

Browse files
Make the text in the currently playing playlist item bold
1 parent 53f0723 commit 7fe5409

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

script.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,19 @@ document.addEventListener("DOMContentLoaded", () => {
7676
videoPlayer.insertAdjacentElement("afterend", episodeLink);
7777
}
7878
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+
}
7992
}
8093

8194
// Initialize the application

style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ video {
9393
background-color: var(--hover-color); /* Use variable for hover color */
9494
}
9595

96+
#playlist li.playing {
97+
font-weight: bold; /* Make text bold */
98+
}
99+
96100
#playlist a {
97101
color: var(--text-color); /* Use variable for text color */
98102
text-decoration: none; /* Remove underline */

0 commit comments

Comments
 (0)