Skip to content

Commit cac3cfa

Browse files
committed
redesign import button
1 parent d674b99 commit cac3cfa

File tree

3 files changed

+88
-5
lines changed

3 files changed

+88
-5
lines changed

webui/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ <h2 class="header-title">System Dashboard</h2>
195195
</div>
196196
</div>
197197
</div>
198-
<button class="header-button import-button" id="import-button" onclick="openImportModal()">📥 Import</button>
198+
<button class="import-button" id="import-button" onclick="openImportModal()" title="Import Music from Staging">
199+
<img src="https://cdn-icons-png.flaticon.com/512/8765/8765164.png" alt="Import" class="import-logo">
200+
</button>
199201
<button class="header-button watchlist-button" id="watchlist-button">👁️ Watchlist
200202
(0)</button>
201203
<button class="header-button wishlist-button" id="wishlist-button">🎵 Wishlist (0)</button>
@@ -3302,6 +3304,7 @@ <h2 class="import-modal-title">Import Music</h2>
33023304
<div class="import-search-bar">
33033305
<input type="text" id="import-album-search-input" placeholder="Search for an album..." onkeydown="if(event.key==='Enter')searchImportAlbum()">
33043306
<button class="import-search-btn" onclick="searchImportAlbum()">Search</button>
3307+
<button class="import-clear-btn hidden" id="import-album-clear-btn" onclick="clearImportAlbumSearch()" title="Clear search"></button>
33053308
</div>
33063309
<div class="import-album-grid" id="import-album-results"></div>
33073310
</div>

webui/static/script.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34568,11 +34568,24 @@ async function searchImportAlbum() {
3456834568
</div>
3456934569
</div>
3457034570
`).join('');
34571+
// Show clear button
34572+
document.getElementById('import-album-clear-btn').classList.remove('hidden');
3457134573
} catch (err) {
3457234574
grid.innerHTML = `<div style="color:#ef4444;text-align:center;padding:20px;">Error: ${err.message}</div>`;
3457334575
}
3457434576
}
3457534577

34578+
function clearImportAlbumSearch() {
34579+
document.getElementById('import-album-search-input').value = '';
34580+
document.getElementById('import-album-results').innerHTML = '';
34581+
document.getElementById('import-album-clear-btn').classList.add('hidden');
34582+
// Re-show suggestions
34583+
const sugGrid = document.getElementById('import-suggestions-grid');
34584+
if (sugGrid && sugGrid.children.length > 0) {
34585+
document.getElementById('import-suggestions-section').classList.remove('hidden');
34586+
}
34587+
}
34588+
3457634589
async function selectImportAlbum(albumId) {
3457734590
// Show match section, hide search
3457834591
document.getElementById('import-album-search-section').classList.add('hidden');
@@ -34652,9 +34665,10 @@ function resetImportAlbumSearch() {
3465234665
}
3465334666
// Refresh suggestions since files may have changed
3465434667
loadImportSuggestions();
34655-
// Clear search results
34668+
// Clear search results and hide clear button
3465634669
document.getElementById('import-album-results').innerHTML = '';
3465734670
document.getElementById('import-album-search-input').value = '';
34671+
document.getElementById('import-album-clear-btn').classList.add('hidden');
3465834672
}
3465934673

3466034674
async function processImportAlbum() {

webui/static/style.css

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21791,11 +21791,54 @@ body {
2179121791
/* ============================= */
2179221792

2179321793
.import-button {
21794-
background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%) !important;
21795-
color: #fff !important;
21794+
position: relative;
21795+
width: 44px;
21796+
height: 44px;
21797+
background: linear-gradient(135deg,
21798+
rgba(124, 58, 237, 0.12) 0%,
21799+
rgba(99, 39, 196, 0.18) 100%);
21800+
backdrop-filter: blur(20px) saturate(1.4);
21801+
-webkit-backdrop-filter: blur(20px) saturate(1.4);
21802+
border: 1.5px solid rgba(124, 58, 237, 0.25);
21803+
border-radius: 50%;
21804+
cursor: pointer;
21805+
display: flex;
21806+
align-items: center;
21807+
justify-content: center;
21808+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
21809+
box-shadow:
21810+
0 4px 16px rgba(124, 58, 237, 0.2),
21811+
0 2px 8px rgba(0, 0, 0, 0.15),
21812+
inset 0 1px 0 rgba(255, 255, 255, 0.08);
21813+
padding: 0;
2179621814
}
2179721815
.import-button:hover {
21798-
background: linear-gradient(135deg, #a855f7 0%, #c084fc 100%) !important;
21816+
background: linear-gradient(135deg,
21817+
rgba(124, 58, 237, 0.18) 0%,
21818+
rgba(99, 39, 196, 0.25) 100%);
21819+
border-color: rgba(124, 58, 237, 0.4);
21820+
transform: scale(1.05);
21821+
box-shadow:
21822+
0 6px 20px rgba(124, 58, 237, 0.3),
21823+
0 3px 12px rgba(0, 0, 0, 0.2),
21824+
inset 0 1px 0 rgba(255, 255, 255, 0.12);
21825+
}
21826+
.import-button:active {
21827+
transform: scale(0.95);
21828+
box-shadow:
21829+
0 2px 8px rgba(124, 58, 237, 0.15),
21830+
inset 0 1px 0 rgba(255, 255, 255, 0.06);
21831+
}
21832+
.import-logo {
21833+
width: 22px;
21834+
height: 22px;
21835+
object-fit: contain;
21836+
opacity: 0.85;
21837+
transition: opacity 0.3s ease;
21838+
filter: invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
21839+
}
21840+
.import-button:hover .import-logo {
21841+
opacity: 1;
2179921842
}
2180021843

2180121844
/* Modal container — matches wishlist/playlist modal vibe */
@@ -21988,6 +22031,29 @@ body {
2198822031
transform: translateY(-1px);
2198922032
box-shadow: 0 4px 16px rgba(29, 185, 84, 0.3);
2199022033
}
22034+
.import-clear-btn {
22035+
width: 40px;
22036+
height: 40px;
22037+
border-radius: 10px;
22038+
border: 1px solid rgba(255, 255, 255, 0.12);
22039+
background: rgba(255, 255, 255, 0.06);
22040+
color: rgba(255, 255, 255, 0.5);
22041+
font-size: 14px;
22042+
cursor: pointer;
22043+
transition: all 0.3s ease;
22044+
flex-shrink: 0;
22045+
display: flex;
22046+
align-items: center;
22047+
justify-content: center;
22048+
}
22049+
.import-clear-btn:hover {
22050+
background: rgba(239, 68, 68, 0.15);
22051+
border-color: rgba(239, 68, 68, 0.3);
22052+
color: #ef4444;
22053+
}
22054+
.import-clear-btn.hidden {
22055+
display: none;
22056+
}
2199122057

2199222058
/* Album grid */
2199322059
.import-album-grid {

0 commit comments

Comments
 (0)