feat(phase4.5): implement Artist-style navigation bar
- Replaced button-style tabs with underlined navigation links - Sticky navigation bar on scroll (top: 0, z-index: 4) - Integrated searchbar in nav-right (icon → expandable input) - Tab order respects user preferences (favoritesPreferences.tab_order) - Active tab shows accent-colored bottom border (2px) - Removed redundant search container section - Matches Artist page and Settings page nav styles cp
This commit is contained in:
1 parent
9269458d77
commit
88e0ef8e01
1 file changed
+137
-102
@@ -743,98 +743,48 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Tabs -->
|
<!-- Navigation Bar (Artist-style) -->
|
||||||
<div class="tabs">
|
<div class="favorites-nav">
|
||||||
<button
|
<div class="nav-left">
|
||||||
class="tab"
|
{#each favoritesPreferences.tab_order as tab}
|
||||||
class:active={activeTab === 'tracks'}
|
<button
|
||||||
onclick={() => handleTabChange('tracks')}
|
class="nav-link"
|
||||||
>
|
class:active={activeTab === tab}
|
||||||
<Music size={16} />
|
onclick={() => handleTabChange(tab as TabType)}
|
||||||
<span>Tracks</span>
|
>
|
||||||
</button>
|
<svelte:component this={getTabIcon(tab as TabType)} size={16} />
|
||||||
<button
|
<span>{getTabLabel(tab as TabType)}</span>
|
||||||
class="tab"
|
</button>
|
||||||
class:active={activeTab === 'albums'}
|
{/each}
|
||||||
onclick={() => handleTabChange('albums')}
|
</div>
|
||||||
>
|
<div class="nav-right">
|
||||||
<Disc3 size={16} />
|
{#if !searchExpanded}
|
||||||
<span>Albums</span>
|
<button class="search-icon-btn" onclick={() => searchExpanded = true} title="Search">
|
||||||
</button>
|
<Search size={16} />
|
||||||
<button
|
</button>
|
||||||
class="tab"
|
|
||||||
class:active={activeTab === 'artists'}
|
|
||||||
onclick={() => handleTabChange('artists')}
|
|
||||||
>
|
|
||||||
<Mic2 size={16} />
|
|
||||||
<span>Artists</span>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="tab"
|
|
||||||
class:active={activeTab === 'playlists'}
|
|
||||||
onclick={() => handleTabChange('playlists')}
|
|
||||||
>
|
|
||||||
<ListMusic size={16} />
|
|
||||||
<span>Playlists</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Toolbar with search and actions -->
|
|
||||||
<div class="toolbar">
|
|
||||||
<!-- Search input -->
|
|
||||||
<div class="search-container">
|
|
||||||
<Search size={16} class="search-icon" />
|
|
||||||
{#if activeTab === 'tracks'}
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
placeholder="Search tracks..."
|
|
||||||
bind:value={trackSearch}
|
|
||||||
class="search-input"
|
|
||||||
/>
|
|
||||||
{#if trackSearch}
|
|
||||||
<button class="search-clear" onclick={() => trackSearch = ''}>
|
|
||||||
<X size={14} />
|
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
{:else if activeTab === 'albums'}
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
placeholder="Search albums..."
|
|
||||||
bind:value={albumSearch}
|
|
||||||
class="search-input"
|
|
||||||
/>
|
|
||||||
{#if albumSearch}
|
|
||||||
<button class="search-clear" onclick={() => albumSearch = ''}>
|
|
||||||
<X size={14} />
|
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
{:else if activeTab === 'artists'}
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
placeholder="Search artists..."
|
|
||||||
bind:value={artistSearch}
|
|
||||||
class="search-input"
|
|
||||||
/>
|
|
||||||
{#if artistSearch}
|
|
||||||
<button class="search-clear" onclick={() => artistSearch = ''}>
|
|
||||||
<X size={14} />
|
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
{:else}
|
{:else}
|
||||||
<input
|
<div class="search-expanded">
|
||||||
type="text"
|
<Search size={16} class="search-icon-inline" />
|
||||||
placeholder="Search playlists..."
|
<input
|
||||||
bind:value={playlistSearch}
|
type="text"
|
||||||
class="search-input"
|
placeholder={`Search ${getTabLabel(activeTab).toLowerCase()}...`}
|
||||||
/>
|
value={getCurrentSearchValue()}
|
||||||
{#if playlistSearch}
|
oninput={(e) => setCurrentSearchValue(e.currentTarget.value)}
|
||||||
<button class="search-clear" onclick={() => playlistSearch = ''}>
|
class="search-input-inline"
|
||||||
<X size={14} />
|
autofocus
|
||||||
</button>
|
/>
|
||||||
{/if}
|
{#if getCurrentSearchValue()}
|
||||||
|
<button class="search-clear-btn" onclick={clearCurrentSearch} title="Clear">
|
||||||
|
<X size={14} />
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Toolbar with actions -->
|
||||||
|
<div class="toolbar">
|
||||||
{#if activeTab === 'albums'}
|
{#if activeTab === 'albums'}
|
||||||
<div class="toolbar-controls">
|
<div class="toolbar-controls">
|
||||||
<div class="dropdown-container">
|
<div class="dropdown-container">
|
||||||
@@ -1486,37 +1436,122 @@
|
|||||||
color: var(--accent-primary);
|
color: var(--accent-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabs {
|
.favorites-nav {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 4;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
justify-content: space-between;
|
||||||
margin-bottom: 24px;
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 12px 0;
|
||||||
|
background-color: var(--bg-primary);
|
||||||
border-bottom: 1px solid var(--bg-tertiary);
|
border-bottom: 1px solid var(--bg-tertiary);
|
||||||
padding-bottom: 16px;
|
margin: 0 0 16px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab {
|
.nav-left {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-link {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 4px 0;
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-size: 13px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-bottom: 2px solid transparent;
|
||||||
|
transition: color 150ms ease, border-color 150ms ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-link:hover {
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-link.active {
|
||||||
|
color: var(--text-primary);
|
||||||
|
border-bottom-color: var(--accent-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-right {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
padding: 10px 20px;
|
}
|
||||||
background: none;
|
|
||||||
|
.search-icon-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 8px;
|
background: none;
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 500;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
border-radius: 6px;
|
||||||
transition: all 150ms ease;
|
transition: all 150ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab:hover {
|
.search-icon-btn:hover {
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
background-color: var(--bg-tertiary);
|
background: var(--bg-tertiary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab.active {
|
.search-expanded {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 6px 12px;
|
||||||
|
background: var(--bg-secondary);
|
||||||
|
border: 1px solid var(--bg-tertiary);
|
||||||
|
border-radius: 8px;
|
||||||
|
min-width: 240px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-icon-inline {
|
||||||
|
color: var(--text-muted);
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input-inline {
|
||||||
|
flex: 1;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
background-color: var(--bg-tertiary);
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input-inline::placeholder {
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-clear-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
color: var(--text-muted);
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: all 150ms ease;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-clear-btn:hover {
|
||||||
|
color: var(--text-primary);
|
||||||
|
background: var(--bg-tertiary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbar {
|
.toolbar {
|
||||||
|
|||||||
Reference in new issue
Block a user