js/css cleanup
This commit is contained in:
parent
c4feb35c45
commit
06c649de7b
2 changed files with 115 additions and 132 deletions
37
js/app.js
37
js/app.js
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
//js/app.js
|
||||
import { LosslessAPI } from './api.js';
|
||||
import { apiSettings, themeManager, nowPlayingSettings, trackListSettings } from './storage.js';
|
||||
|
|
@ -350,16 +349,17 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
btn.disabled = false;
|
||||
btn.innerHTML = originalHTML;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (e.target.closest('#create-playlist-btn')) {
|
||||
const modal = document.getElementById('playlist-modal');
|
||||
document.getElementById('playlist-modal-title').textContent = 'Create Playlist';
|
||||
document.getElementById('playlist-name-input').value = '';
|
||||
modal.style.display = 'flex';
|
||||
document.getElementById('playlist-name-input').focus();
|
||||
}
|
||||
}
|
||||
|
||||
if (e.target.closest('#playlist-modal-save')) {
|
||||
if (e.target.closest('#playlist-modal-save')) {
|
||||
const name = document.getElementById('playlist-name-input').value.trim();
|
||||
if (name) {
|
||||
const modal = document.getElementById('playlist-modal');
|
||||
|
|
@ -385,14 +385,13 @@ if (e.target.closest('#playlist-modal-save')) {
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (e.target.closest('#playlist-modal-cancel')) {
|
||||
if (e.target.closest('#playlist-modal-cancel')) {
|
||||
document.getElementById('playlist-modal').style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
if (e.target.closest('.edit-playlist-btn')) {
|
||||
if (e.target.closest('.edit-playlist-btn')) {
|
||||
const card = e.target.closest('.user-playlist');
|
||||
const playlistId = card.dataset.playlistId;
|
||||
db.getPlaylist(playlistId).then(playlist => {
|
||||
|
|
@ -405,8 +404,9 @@ if (e.target.closest('.edit-playlist-btn')) {
|
|||
document.getElementById('playlist-name-input').focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
if (e.target.closest('.delete-playlist-btn')) {
|
||||
}
|
||||
|
||||
if (e.target.closest('.delete-playlist-btn')) {
|
||||
const card = e.target.closest('.user-playlist');
|
||||
const playlistId = card.dataset.playlistId;
|
||||
if (confirm('Are you sure you want to delete this playlist?')) {
|
||||
|
|
@ -415,9 +415,9 @@ if (e.target.closest('.delete-playlist-btn')) {
|
|||
ui.renderLibraryPage();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (e.target.closest('#edit-playlist-btn')) {
|
||||
if (e.target.closest('#edit-playlist-btn')) {
|
||||
const playlistId = window.location.hash.split('/')[1];
|
||||
db.getPlaylist(playlistId).then(playlist => {
|
||||
if (playlist) {
|
||||
|
|
@ -429,18 +429,16 @@ if (e.target.closest('#edit-playlist-btn')) {
|
|||
document.getElementById('playlist-name-input').focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (e.target.closest('#delete-playlist-btn')) {
|
||||
if (e.target.closest('#delete-playlist-btn')) {
|
||||
const playlistId = window.location.hash.split('/')[1];
|
||||
if (confirm('Are you sure you want to delete this playlist?')) {
|
||||
db.deletePlaylist(playlistId).then(() => {
|
||||
window.location.hash = '#library';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (e.target.closest('.remove-from-playlist-btn')) {
|
||||
const btn = e.target.closest('.remove-from-playlist-btn');
|
||||
|
|
@ -453,8 +451,7 @@ if (e.target.closest('#delete-playlist-btn')) {
|
|||
ui.renderPlaylistPage(playlistId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (e.target.closest('#play-playlist-btn')) {
|
||||
const btn = e.target.closest('#play-playlist-btn');
|
||||
|
|
|
|||
18
styles.css
18
styles.css
|
|
@ -1125,20 +1125,6 @@ body.has-page-background .track-item:hover {
|
|||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
#like-album-btn,
|
||||
#like-playlist-btn,
|
||||
#like-artist-btn {
|
||||
width: auto;
|
||||
height: auto;
|
||||
padding: 0.875rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
aspect-ratio: 1/1;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
padding: 0.5rem 1rem;
|
||||
background-color: var(--secondary);
|
||||
|
|
@ -2804,7 +2790,7 @@ input:checked + .slider::before {
|
|||
}
|
||||
|
||||
.track-item {
|
||||
grid-template-columns: 32px 1fr 40px 28px;
|
||||
grid-template-columns: 32px 1fr 40px auto;
|
||||
gap: 0.375rem;
|
||||
padding: var(--spacing-xs);
|
||||
}
|
||||
|
|
@ -2929,7 +2915,7 @@ input:checked + .slider::before {
|
|||
}
|
||||
|
||||
.track-item {
|
||||
grid-template-columns: 32px 1fr 40px 36px;
|
||||
grid-template-columns: 32px 1fr 32px auto;
|
||||
}
|
||||
|
||||
.player-controls .buttons button {
|
||||
|
|
|
|||
Loading…
Reference in a new issue