-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.js
More file actions
19 lines (19 loc) · 684 Bytes
/
ui.js
File metadata and controls
19 lines (19 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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';
}