Skip to content

Commit

Permalink
feat: display artist and title tags on lyrics
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanam committed Jul 22, 2024
1 parent 6820475 commit 237120a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ <h1 class="topbar__title">Liricle</h1>

<main class="lyric" id="$lyric">
<div class="lyric__cursor" id="$lyric_cursor"></div>
<div class="lyric__line" id="$lyric_artist"></div>
<div class="lyric__line" id="$lyric_title"></div>
<div class="lyric__content" id="$lyric_content"></div>
</main>

Expand Down
4 changes: 4 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ function main(Liricle) {
$menu_lyric_offset.value = tags.offset;
}

// set artist and title
$lyric_artist.innerText = ("ar" in tags) ? `Artist: ${tags.ar}` : "";
$lyric_title.innerText = ("ti" in tags) ? `Title: ${tags.ti}` : "";

lines.forEach(line => {
const $line = document.createElement("div");
$line.className = "lyric__line";
Expand Down

0 comments on commit 237120a

Please sign in to comment.