33 lines
1023 B
Plaintext
33 lines
1023 B
Plaintext
@using Shared.Services
|
|
@implements IDisposable
|
|
@inject CardPreviewService PreviewService
|
|
@namespace Shared.Components
|
|
|
|
@if (PreviewService.IsVisible && PreviewService.HoveredCard != null)
|
|
{
|
|
<div class="card-preview-popup" style="left: @(PreviewService.X + 20)px; top: @(PreviewService.Y)px;">
|
|
<div class="preview-content">
|
|
<img src="@PreviewService.HoveredCard.ImagePath" alt="@PreviewService.HoveredCard.Name" />
|
|
<div class="preview-info">
|
|
<strong>@PreviewService.HoveredCard.Name</strong>
|
|
@if (PreviewService.HoveredCard.Cost.HasValue)
|
|
{
|
|
<span class="preview-cost"><i class="bi bi-lightning-fill"></i> @PreviewService.HoveredCard.Cost</span>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
|
|
@code {
|
|
protected override void OnInitialized()
|
|
{
|
|
PreviewService.OnChange += StateHasChanged;
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
PreviewService.OnChange -= StateHasChanged;
|
|
}
|
|
}
|