Замена div на компоненты
This commit is contained in:
@@ -1,29 +1,24 @@
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@inject IAudioPlayerService AudioPlayerService
|
||||
|
||||
<div class="track-cover-container"
|
||||
@onmouseenter="HandleMouseEnter"
|
||||
@onmouseleave="HandleMouseLeave"
|
||||
style="position: relative; display: inline-block; cursor: pointer;">
|
||||
<MudPaper Elevation="0"
|
||||
@onmouseenter="HandleMouseEnter"
|
||||
@onmouseleave="HandleMouseLeave"
|
||||
style="position: relative; display: inline-block; cursor: pointer; border-radius: 4px; overflow: hidden;">
|
||||
|
||||
<MudImage Src="@CoverUrl.FormatCoverUrl(Width, Height)" Height="@Height" Width="@Width" Class="rounded" Style="display: block;" />
|
||||
|
||||
@if (_isHovered || IsCurrentTrackPlaying)
|
||||
{
|
||||
<div class="play-overlay"
|
||||
style="position: absolute; top: 0; left: 0; right: 0; bottom: 0;
|
||||
background: rgba(0,0,0,0.6);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 4px;">
|
||||
<MudPaper class="play-overlay"
|
||||
style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; border-radius: 4px;">
|
||||
<MudIconButton Icon="@(IsCurrentTrackPlaying? Icons.Material.Filled.Pause : Icons.Material.Filled.PlayArrow)"
|
||||
Color="Color.Inherit"
|
||||
Size="Size.Large"
|
||||
OnClick="OnPlayClick" />
|
||||
</div>
|
||||
</MudPaper>
|
||||
}
|
||||
</div>
|
||||
</MudPaper>
|
||||
|
||||
@code {
|
||||
[Parameter] public string CoverUrl { get; set; } = string.Empty;
|
||||
@@ -56,9 +51,9 @@
|
||||
else
|
||||
{
|
||||
await AudioPlayerService.LoadAndPlayAsync(
|
||||
trackId: TrackId,
|
||||
playlistShareToken: playlistShareToken,
|
||||
title: TrackTitle,
|
||||
trackId: TrackId,
|
||||
playlistShareToken: playlistShareToken,
|
||||
title: TrackTitle,
|
||||
coverUrl: CoverUrl);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user