chore: link now playing track

This commit is contained in:
Cory Dransfeldt 2023-09-08 15:56:15 -07:00
parent 363c0b3daf
commit b59cbed552
No known key found for this signature in database
3 changed files with 3 additions and 1 deletions

View file

@ -58,6 +58,7 @@ export default async () => {
return Response.json({ return Response.json({
artist: track['artist']['#text'], artist: track['artist']['#text'],
title: track['name'], title: track['name'],
url: track['url'],
genre, genre,
emoji: emojiMap(genre, track['artist']['#text']), emoji: emojiMap(genre, track['artist']['#text']),
}) })

View file

@ -4,6 +4,6 @@
</span> </span>
<span id="now-playing-display" class="flex flex-row items-center"> <span id="now-playing-display" class="flex flex-row items-center">
<span id="now-playing-emoji" class="mr-1"></span> <span id="now-playing-emoji" class="mr-1"></span>
<span id="now-playing-content"></span> <a href id="now-playing-content"></a>
</span> </span>
</p> </p>

View file

@ -7,6 +7,7 @@
const populateNowPlaying = (data) => { const populateNowPlaying = (data) => {
loading.style.display = 'none' loading.style.display = 'none'
emoji.innerText = data.emoji emoji.innerText = data.emoji
content.href = data.url
content.innerText = `${data.title} by ${data.artist}` content.innerText = `${data.title} by ${data.artist}`
emoji.classList.remove('hidden') emoji.classList.remove('hidden')
content.classList.remove('hidden') content.classList.remove('hidden')