mirror of
https://github.com/bckelley/spotify-player.git
synced 2026-08-24 03:24:12 -05:00
19 lines
684 B
JavaScript
19 lines
684 B
JavaScript
function showError(msg) {
|
|
document.getElementById('data').innerText = msg;
|
|
}
|
|
function updateTrackInfo(track) {
|
|
if (!track) {
|
|
document.getElementById('track-info').innerText = 'Nothing playing or no active device.';
|
|
return;
|
|
}
|
|
if (track.item) {
|
|
document.getElementById('track-info').innerText =
|
|
`Now Playing: ${track.item.name} by ${track.item.artists.map(a => a.name).join(", ")}`;
|
|
} else {
|
|
document.getElementById('track-info').innerText = 'Nothing playing.';
|
|
}
|
|
}
|
|
function showControls() {
|
|
document.getElementById('controls').style.display = '';
|
|
document.getElementById('login-btn').style.display = 'none';
|
|
} |