sync page design

pull/15/head
Broque Thomas 9 months ago
parent cd9a466e9e
commit 2c9f19137b

@ -297,24 +297,79 @@
</div>
</div>
<!-- Sync Page -->
<!-- Main container for the Sync page -->
<div class="page" id="sync-page">
<div class="page-header">
<h2>Sync</h2>
<!-- Header -->
<div class="sync-header">
<h2 class="sync-title">Playlist Sync</h2>
<p class="sync-subtitle">Synchronize your Spotify, Tidal, and YouTube playlists with your media server</p>
</div>
<div class="sync-content">
<div class="playlist-section">
<h3>Select Playlist</h3>
<select class="playlist-selector" id="playlist-selector">
<option value="">Loading playlists...</option>
</select>
<button class="sync-button" id="sync-button">Start Sync</button>
<!-- Main two-column content area -->
<div class="sync-content-area">
<!-- Left Panel: Tabbed Playlist Section -->
<div class="sync-main-panel">
<div class="sync-tabs">
<button class="sync-tab-button active" data-tab="spotify">
<span class="tab-icon spotify-icon"></span> Spotify
</button>
<button class="sync-tab-button" data-tab="tidal">
<span class="tab-icon tidal-icon"></span> Tidal
</button>
<button class="sync-tab-button" data-tab="youtube">
<span class="tab-icon youtube-icon"></span> YouTube
</button>
</div>
<!-- Spotify Tab Content -->
<div class="sync-tab-content active" id="spotify-tab-content">
<div class="playlist-header">
<h3>Your Spotify Playlists</h3>
<button class="refresh-button" id="spotify-refresh-btn">🔄 Refresh</button>
</div>
<div class="playlist-scroll-container" id="spotify-playlist-container">
<div class="playlist-placeholder">Click 'Refresh' to load your Spotify playlists.</div>
</div>
</div>
<!-- Tidal Tab Content -->
<div class="sync-tab-content" id="tidal-tab-content">
<div class="playlist-header">
<h3>Your Tidal Playlists</h3>
<button class="refresh-button tidal" id="tidal-refresh-btn">🔄 Refresh</button>
</div>
<div class="playlist-scroll-container" id="tidal-playlist-container">
<div class="playlist-placeholder">Click 'Refresh' to load your Tidal playlists.</div>
</div>
</div>
<!-- YouTube Tab Content -->
<div class="sync-tab-content" id="youtube-tab-content">
<div class="youtube-input-section">
<input type="text" id="youtube-url-input" placeholder="Paste YouTube Music Playlist URL...">
<button id="youtube-parse-btn">Parse Playlist</button>
</div>
<div class="playlist-scroll-container" id="youtube-playlist-container">
<div class="playlist-placeholder">Parsed YouTube playlists will appear here.</div>
</div>
</div>
</div>
<div class="sync-progress hidden" id="sync-progress">
<div class="progress-bar">
<div class="progress-fill"></div>
<!-- Right Panel: Sidebar with Options & Logging -->
<div class="sync-sidebar">
<div class="sidebar-section">
<h4>Sync Actions</h4>
<div id="selection-info">Select playlists to sync</div>
<button id="start-sync-btn" class="neo-button" disabled>Start Sync</button>
</div>
<div class="sidebar-section progress-section">
<h4>Sync Progress</h4>
<div class="progress-bar-container">
<div class="progress-bar-fill" id="sync-progress-bar" style="width: 0%;"></div>
</div>
<div id="sync-progress-text">Ready to sync...</div>
<textarea id="sync-log-area" readonly>Waiting for sync to start...</textarea>
</div>
<div class="progress-text">0% Complete</div>
</div>
</div>
</div>

@ -129,6 +129,7 @@ async function loadPageData(pageId) {
break;
case 'sync':
stopDownloadPolling();
initializeSyncPage();
await loadSyncData();
break;
case 'downloads':
@ -3364,6 +3365,29 @@ function updateDbProgressUI(state) {
}
}
// ===============================
// SYNC PAGE FUNCTIONALITY (REDESIGNED)
// ===============================
function initializeSyncPage() {
const tabButtons = document.querySelectorAll('.sync-tab-button');
tabButtons.forEach(button => {
button.addEventListener('click', () => {
const tabId = button.dataset.tab;
// Update button active state
tabButtons.forEach(btn => btn.classList.remove('active'));
button.classList.add('active');
// Update content active state
document.querySelectorAll('.sync-tab-content').forEach(content => {
content.classList.remove('active');
});
document.getElementById(`${tabId}-tab-content`).classList.add('active');
});
});
}
// --- Event Handlers ---

@ -3801,3 +3801,246 @@ body {
border-radius: 4px;
padding: 2px 6px;
}
/* ======================================================= */
/* == STYLES FOR SYNC PAGE (REDESIGNED) == */
/* ======================================================= */
/* Main Sync Page Layout */
.sync-header {
margin-bottom: 25px;
}
.sync-title {
font-size: 28px;
font-weight: 700;
color: #ffffff;
}
.sync-subtitle {
font-size: 14px;
color: #b3b3b3;
margin-top: 5px;
}
.sync-content-area {
display: grid;
grid-template-columns: 2fr 1fr; /* 2/3 for main panel, 1/3 for sidebar */
gap: 25px;
height: calc(100vh - 200px); /* Adjust height to fit within the page */
}
.sync-main-panel, .sync-sidebar {
background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(18, 18, 18, 0.98));
backdrop-filter: blur(10px);
border-radius: 16px;
border: 1px solid rgba(255, 255, 255, 0.08);
padding: 20px;
display: flex;
flex-direction: column;
overflow: hidden;
box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}
/* Tab System */
.sync-tabs {
display: flex;
gap: 2px;
margin-bottom: 15px;
background: rgba(0,0,0,0.2);
border-radius: 12px;
padding: 4px;
}
.sync-tab-button {
flex: 1;
padding: 12px;
background: transparent;
color: #b3b3b3;
border: none;
border-radius: 10px;
font-size: 13px;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.sync-tab-button.active {
background: #1db954;
color: #000000;
box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
}
.sync-tab-button[data-tab="tidal"].active { background: #ff6600; color: #fff; box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3); }
.sync-tab-button[data-tab="youtube"].active { background: #ff0000; color: #fff; box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3); }
.sync-tab-button:hover:not(.active) {
background: rgba(255, 255, 255, 0.1);
color: #ffffff;
}
.tab-icon {
width: 16px;
height: 16px;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
.spotify-icon { background-image: url('https://storage.googleapis.com/pr-newsroom-wp/1/2018/11/Spotify_Icon_RGB_White.png'); filter: invert(1); }
.tidal-icon { background-image: url('https://tidal.com/favicon.ico'); } /* Simple fallback */
.youtube-icon { background-image: url('https://www.youtube.com/s/desktop/014da055/img/favicon_32x32.png'); }
.sync-tab-button.active .tab-icon { filter: none; }
.sync-tab-content {
display: none;
flex-direction: column;
gap: 15px;
flex-grow: 1;
overflow: hidden;
}
.sync-tab-content.active {
display: flex;
}
/* Playlist Section Styling */
.playlist-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.playlist-header h3 {
font-size: 16px;
font-weight: bold;
color: #ffffff;
}
.refresh-button {
background: #1db954;
border: none;
border-radius: 17px;
color: #000000;
font-size: 11px;
font-weight: bold;
padding: 8px 16px;
cursor: pointer;
transition: all 0.2s ease;
}
.refresh-button:hover { transform: scale(1.05); }
.refresh-button.tidal { background: #ff6600; color: #fff; }
.refresh-button.tidal:hover { background: #ff7700; }
.playlist-scroll-container {
flex-grow: 1;
overflow-y: auto;
background: rgba(0,0,0,0.2);
border-radius: 8px;
padding: 10px;
}
.playlist-placeholder {
text-align: center;
color: #b3b3b3;
font-size: 14px;
padding: 40px;
}
.youtube-input-section {
display: flex;
gap: 10px;
}
#youtube-url-input {
flex-grow: 1;
background: #3a3a3a;
border: 1px solid #555555;
border-radius: 6px;
padding: 10px;
color: #ffffff;
}
#youtube-parse-btn {
width: 150px;
background: #ff0000;
color: #fff;
border: none;
border-radius: 6px;
font-weight: bold;
cursor: pointer;
}
/* Right Sidebar */
.sync-sidebar {
gap: 20px;
}
.sidebar-section {
display: flex;
flex-direction: column;
gap: 10px;
}
.sidebar-section h4 {
font-size: 14px;
font-weight: bold;
color: #ffffff;
}
#selection-info {
font-size: 12px;
color: #b3b3b3;
text-align: center;
}
.neo-button {
width: 100%;
padding: 12px;
background: #1db954;
border: none;
border-radius: 22px;
color: #000000;
font-size: 14px;
font-weight: bold;
cursor: pointer;
transition: all 0.2s ease;
box-shadow: 0 5px 15px rgba(29, 185, 84, 0.2);
}
.neo-button:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(29, 185, 84, 0.3);
}
.neo-button:disabled {
background: #404040;
color: #666666;
cursor: not-allowed;
box-shadow: none;
}
.progress-section {
flex-grow: 1;
overflow: hidden;
display: flex;
flex-direction: column;
}
#sync-progress-text {
font-size: 11px;
color: #b3b3b3;
}
#sync-log-area {
flex-grow: 1;
background: #181818;
border: 1px solid #404040;
border-radius: 4px;
color: #b3b3b3;
font-size: 10px;
font-family: monospace;
padding: 8px;
resize: none;
}
Loading…
Cancel
Save