Skip to content

Commit

Permalink
'Load default playlist' button
Browse files Browse the repository at this point in the history
  • Loading branch information
jacbz committed Mar 10, 2023
1 parent fd3e16d commit 90baf0e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@
<div id="playlist-header-text" class="header-text">PLAYLIST</div>
<button id="export-button" class="plain" title="Share this playlist"></button>
</div>
<div id="playlist-tracks"></div>
<div id="playlist-content">
<button id="load-playlist-button" class="flat">Load default playlist</button>
<div id="playlist-tracks">
</div>
</div>
</div>
</div>
<div id="slider-panel" class="panel">
Expand Down
6 changes: 6 additions & 0 deletions client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ const vinyl = document.getElementById('vinyl');
const vinylColor = document.getElementById('vinyl-color');
const vinylBottomText1 = document.getElementById('vinyl-bottom-text1');
const vinylBottomText2 = document.getElementById('vinyl-bottom-text2');
const loadPlaylistButton = document.getElementById('load-playlist-button');
const playlistContainer = document.getElementById('playlist-tracks');
const updateTrackClasses = () => {
player.playlist.forEach((track, i) => {
Expand All @@ -244,8 +245,13 @@ const onTrackChange = () => {
};
player.onTrackChange = onTrackChange;

loadPlaylistButton.addEventListener('click', () => {
window.location.href = '?default';
});

// Playlist
const updatePlaylistDisplay = () => {
loadPlaylistButton.style.display = player.playlist.length > 0 ? 'none' : null;
playlistContainer.innerHTML = '';
player.playlist.forEach((track, i) => {
const template = document.getElementById('playlist-track') as HTMLTemplateElement;
Expand Down
11 changes: 11 additions & 0 deletions client/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,19 @@ $panel-border-radius: 6px;
}
}

#playlist-content {
display: flex;
justify-content: center;
align-items: center;
}

#load-playlist-button {
position: absolute;
}

#playlist-tracks {
height: $height;
width: 100%;
overflow-y: auto;
}

Expand Down

0 comments on commit 90baf0e

Please sign in to comment.