chore: link now playing track
This commit is contained in:
parent
363c0b3daf
commit
b59cbed552
3 changed files with 3 additions and 1 deletions
|
@ -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']),
|
||||||
})
|
})
|
||||||
|
|
|
@ -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>
|
|
@ -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')
|
||||||
|
|
Reference in a new issue