Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 84 additions & 25 deletions app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,27 @@
flex: 1;
min-width: 200px;
}
.step-card.collapsed {
cursor: pointer;
}
.step-card.collapsed .step-content {
display: none;
}
.step-card .collapsed-summary {
display: none;
color: #1db954;
font-size: 0.95rem;
margin-left: 42px;
}
.step-card.collapsed .collapsed-summary {
display: block;
}
.step-card.collapsed .step-header::after {
content: '(tap to change)';
font-size: 0.8rem;
color: #888;
margin-left: 10px;
}
#mood-profile {
display: none;
}
Expand Down Expand Up @@ -233,19 +254,22 @@ <h1>Magic Music Generator</h1>
<span class="step-number">1</span>
<h4>Select a Playlist</h4>
</div>
<p class="text-muted">Choose a playlist as your mood template</p>
<div class="collapsed-summary" id="step-1-summary"></div>
<div class="step-content">
<p class="text-muted">Choose a playlist as your mood template</p>

<div id="playlists-loading" class="text-center py-4">
<p>Loading your playlists...</p>
</div>
<div id="playlists-loading" class="text-center py-4">
<p>Loading your playlists...</p>
</div>

<div id="playlists-container" style="max-height: 350px; overflow-y: auto; -webkit-overflow-scrolling: touch;">
<!-- Playlists will be loaded here -->
</div>
<div id="playlists-container" style="max-height: 350px; overflow-y: auto; -webkit-overflow-scrolling: touch;">
<!-- Playlists will be loaded here -->
</div>

<button id="analyze-playlist-btn" class="btn btn-primary btn-block btn-lg mt-3" disabled>
Analyze Selected Playlist
</button>
<button id="analyze-playlist-btn" class="btn btn-primary btn-block btn-lg mt-3" disabled>
Analyze Selected Playlist
</button>
</div>
</div>

<!-- Step 2: Mood Profile -->
Expand All @@ -254,22 +278,25 @@ <h4>Select a Playlist</h4>
<span class="step-number">2</span>
<h4>Mood Profile</h4>
</div>
<p class="text-muted mb-3">Based on <strong id="analyzed-playlist-name"></strong></p>

<div class="row">
<div class="col-12 col-md-6 mood-scores-container">
<h5 class="mb-3">Mood Scores</h5>
<div id="mood-scores"></div>
</div>
<div class="col-12 col-md-6 mood-tags-container">
<h5 class="mb-3">Top Tags</h5>
<div id="mood-tags"></div>
<div class="collapsed-summary" id="step-2-summary"></div>
<div class="step-content">
<p class="text-muted mb-3">Based on <strong id="analyzed-playlist-name"></strong></p>

<div class="row">
<div class="col-12 col-md-6 mood-scores-container">
<h5 class="mb-3">Mood Scores</h5>
<div id="mood-scores"></div>
</div>
<div class="col-12 col-md-6 mood-tags-container">
<h5 class="mb-3">Top Tags</h5>
<div id="mood-tags"></div>
</div>
</div>
</div>

<button id="continue-to-generator" class="btn btn-success btn-block btn-lg mt-4">
Continue to Generator
</button>
<button id="continue-to-generator" class="btn btn-success btn-block btn-lg mt-4">
Continue to Generator
</button>
</div>
</div>

<!-- Step 3: Generator Settings -->
Expand Down Expand Up @@ -416,6 +443,10 @@ <h5 class="modal-title" style="color: white"><strong>Saved!</strong></h5>
$('#loading').hide();
$('#analyze-playlist-btn').prop('disabled', false).text('Analyze Selected Playlist');

// Collapse step 1 and set summary
$('#step-1').addClass('collapsed');
$('#step-1-summary').text(selectedPlaylistName);

// Show mood profile
$('#analyzed-playlist-name').text(selectedPlaylistName);

Expand All @@ -439,6 +470,9 @@ <h5 class="modal-title" style="color: white"><strong>Saved!</strong></h5>
$('#mood-tags').html(tagsHtml);

$('#mood-profile').slideDown();
$('html, body').animate({
scrollTop: $('#mood-profile').offset().top - 20
}, 300);
}).fail(function(xhr) {
$('#loading').hide();
$('#analyze-playlist-btn').prop('disabled', false).text('Analyze Selected Playlist');
Expand All @@ -453,10 +487,35 @@ <h5 class="modal-title" style="color: white"><strong>Saved!</strong></h5>

// Continue to generator
$('#continue-to-generator').click(function() {
// Collapse step 2 and set summary
$('#mood-profile').addClass('collapsed');
var topTags = [];
$('#mood-tags .mood-tag').slice(0, 3).each(function() {
topTags.push($(this).text());
});
$('#step-2-summary').text(topTags.join(', '));

$('#generator-settings').slideDown();
$('html, body').animate({
scrollTop: $('#generator-settings').offset().top - 20
}, 500);
}, 300);
});

// Click on collapsed step to expand it
$(document).on('click', '.step-card.collapsed', function() {
var $this = $(this);
var stepId = $this.attr('id');

// Expand this step
$this.removeClass('collapsed');

// Collapse following steps and hide them
if (stepId === 'step-1') {
$('#mood-profile').addClass('collapsed').hide();
$('#generator-settings').hide();
} else if (stepId === 'mood-profile') {
$('#generator-settings').hide();
}
});

// Generate playlist
Expand Down