125 lines
5.5 KiB
Plaintext
125 lines
5.5 KiB
Plaintext
@page "/mixes/{Id:long}"
|
|
@using DeepDrftPublic.Client.Controls
|
|
@inherits ReleaseDetailBase
|
|
|
|
<PageTitle>@(ViewModel.Release?.Title ?? "Mix") - DeepDrft</PageTitle>
|
|
|
|
@if (ViewModel.IsLoading)
|
|
{
|
|
<div class="deepdrft-track-detail-container">
|
|
<div class="deepdrft-track-detail-masthead">
|
|
<MudSkeleton SkeletonType="SkeletonType.Text" Width="70%" Height="56px" />
|
|
<MudSkeleton SkeletonType="SkeletonType.Text" Width="40%" Height="32px" />
|
|
</div>
|
|
</div>
|
|
}
|
|
else if (ViewModel.NotFound || ViewModel.Release is null)
|
|
{
|
|
<div class="deepdrft-track-detail-container">
|
|
<div class="deepdrft-track-detail-masthead">
|
|
<MudText Typo="Typo.h4" Align="Align.Center">Mix not found.</MudText>
|
|
<div class="d-flex justify-center mt-4">
|
|
<MudButton Href="/mixes"
|
|
Variant="Variant.Text"
|
|
StartIcon="@Icons.Material.Filled.ArrowBack">
|
|
All mixes
|
|
</MudButton>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
var release = ViewModel.Release;
|
|
var hasGenre = release.Genre is not null;
|
|
var hasDate = release.ReleaseDate is not null;
|
|
|
|
@* Full-page waveform sits behind the scaffold content. The scaffold's container is positioned
|
|
above it via the mix-detail-foreground stacking context. TrackId lets the visualizer couple to
|
|
playback only when the player is on this mix's track. *@
|
|
<MixWaveformVisualizer ReleaseId="@release.Id" TrackId="@ViewModel.Track?.Id" />
|
|
|
|
<div class="mix-detail-foreground">
|
|
<MudContainer MaxWidth="MaxWidth.Large" Class="mix-detail-container">
|
|
<ReleaseDetailScaffold Title="@release.Title"
|
|
Artist="@release.Artist"
|
|
Track="@ViewModel.Track"
|
|
BackHref="/mixes"
|
|
BackLabel="All mixes"
|
|
ShowMeta="@(hasGenre || hasDate)">
|
|
<TopRightAction>
|
|
@* Lava-lamp button top-right, across from the back link. Toggles a popover holding the
|
|
four visualizer knobs (spec §7c/§7d). The controls themselves are unchanged — they
|
|
mutate the shared MixVisualizerControlState; the backdrop bridge pushes the uniforms.
|
|
The popover only progressively-discloses them off the always-visible row. *@
|
|
<MudTooltip Text="Visualizer settings">
|
|
<MudIconButton Icon="@DDIcons.LavaLamp"
|
|
Size="Size.Large"
|
|
Color="Color.Secondary"
|
|
Disabled="@(!RendererInfo.IsInteractive)"
|
|
OnClick="@ToggleSettings"
|
|
aria-label="Visualizer settings" />
|
|
</MudTooltip>
|
|
|
|
@* Outside-click close via MudOverlay (the SharePopover idiom). A knob drag never lands
|
|
on this overlay — the knob's own global capture overlay is a child of the popover
|
|
content above it — so dragging a knob does not dismiss the popover. *@
|
|
<MudOverlay Visible="@_settingsOpen" OnClick="@CloseSettings" AutoClose="true" />
|
|
|
|
<MudPopover Open="@_settingsOpen"
|
|
Fixed="false"
|
|
AnchorOrigin="Origin.BottomRight"
|
|
TransformOrigin="Origin.TopRight"
|
|
Class="mix-visualizer-popover">
|
|
<MixVisualizerControls />
|
|
</MudPopover>
|
|
</TopRightAction>
|
|
<Hero>
|
|
<div class="mix-detail-cover">
|
|
@if (!string.IsNullOrEmpty(release.ImagePath))
|
|
{
|
|
<MudPaper Elevation="2" Class="deepdrft-track-detail-cover-art"
|
|
Style="@($"background-image: url('api/image/{Uri.EscapeDataString(release.ImagePath)}');")" />
|
|
}
|
|
else
|
|
{
|
|
<MudPaper Elevation="2" Class="deepdrft-track-detail-cover-placeholder deepdrft-gradient-soft-secondary">
|
|
<MudIcon Icon="@Icons.Material.Filled.Album" Color="Color.Primary" />
|
|
</MudPaper>
|
|
}
|
|
</div>
|
|
</Hero>
|
|
<MetaContent>
|
|
@if (hasGenre)
|
|
{
|
|
<div>
|
|
<MudChip T="string" Variant="Variant.Outlined" Color="Color.Tertiary" Class="deepdrft-genre-chip">
|
|
@release.Genre
|
|
</MudChip>
|
|
</div>
|
|
}
|
|
@if (hasDate)
|
|
{
|
|
<div>
|
|
<MudText Typo="Typo.overline">Released</MudText>
|
|
<MudText Typo="Typo.body1">@release.ReleaseDate!.Value.ToString("MMMM yyyy")</MudText>
|
|
</div>
|
|
}
|
|
</MetaContent>
|
|
</ReleaseDetailScaffold>
|
|
</MudContainer>
|
|
</div>
|
|
}
|
|
|
|
@code {
|
|
protected override string PersistKey => "mix-detail";
|
|
|
|
// Lava-lamp settings popover open state. Pure presentation over MixVisualizerControlState — the
|
|
// popover discloses the four knobs; toggling it touches no control value or bridge push.
|
|
private bool _settingsOpen;
|
|
|
|
private void ToggleSettings() => _settingsOpen = !_settingsOpen;
|
|
|
|
private void CloseSettings() => _settingsOpen = false;
|
|
}
|