first push
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
@using MudBlazor
|
||||
|
||||
@if (IsOpen && !string.IsNullOrWhiteSpace(CurrentImage))
|
||||
{
|
||||
<MudOverlay Visible="true" DarkBackground="true" ZIndex="1300" @onclick="CloseFromOverlay">
|
||||
<MudPaper Class="pa-4 mx-auto"
|
||||
@onclick:stopPropagation="true"
|
||||
Style="
|
||||
width:95%;
|
||||
max-width:1200px;
|
||||
margin-top:5vh;
|
||||
background-color:#1e1e1e;
|
||||
color:white;
|
||||
position:relative;
|
||||
border-radius:16px;">
|
||||
|
||||
<div class="text-center">
|
||||
|
||||
<MudImage Src="@CurrentImage"
|
||||
Fluid="true"
|
||||
Class="mb-3"
|
||||
Style="max-height:75vh; object-fit:contain;" />
|
||||
|
||||
<MudStack Row="true"
|
||||
Justify="Justify.SpaceBetween"
|
||||
AlignItems="AlignItems.Center"
|
||||
Class="mt-2">
|
||||
|
||||
<MudButton Variant="Variant.Outlined"
|
||||
Color="Color.Inherit"
|
||||
OnClick="OnPrevious"
|
||||
Disabled="@(!CanPrevious)">
|
||||
⬅ Précédent
|
||||
</MudButton>
|
||||
|
||||
<MudButton Variant="Variant.Outlined"
|
||||
Color="Color.Inherit"
|
||||
Disabled="@(SelectedImages.Count() >= MaxSelect && !SelectedImages.Contains(CurrentImage))"
|
||||
OnClick="Toggle">
|
||||
@(IsSelector ? (IsSelected ? "Retirer" : "Choisir") : "Télécharger")
|
||||
</MudButton>
|
||||
|
||||
<MudButton Variant="Variant.Outlined"
|
||||
Color="Color.Inherit"
|
||||
OnClick="OnNext"
|
||||
Disabled="@(!CanNext)">
|
||||
Suivant ➡
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
|
||||
<MudText Class="mt-3" Align="Align.Center" Typo="Typo.body1">
|
||||
@(CurrentIndex + 1) / @Total
|
||||
</MudText>
|
||||
</div>
|
||||
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Close"
|
||||
Color="Color.Inherit"
|
||||
OnClick="OnClose"
|
||||
Style="position:absolute; top:10px; right:10px;" />
|
||||
</MudPaper>
|
||||
</MudOverlay>
|
||||
}
|
||||
|
||||
@code {
|
||||
[Parameter] public bool IsOpen { get; set; }
|
||||
[Parameter] public string? CurrentImage { get; set; }
|
||||
[Parameter] public bool IsSelector { get; set; }
|
||||
[Parameter] public int CurrentIndex { get; set; }
|
||||
[Parameter] public int Total { get; set; }
|
||||
[Parameter] public HashSet<string> SelectedImages { get; set; }
|
||||
[Parameter] public int MaxSelect { get; set; }
|
||||
|
||||
[Parameter] public bool CanNext { get; set; }
|
||||
[Parameter] public bool CanPrevious { get; set; }
|
||||
|
||||
[Parameter] public bool IsSelected { get; set; }
|
||||
|
||||
[Parameter] public EventCallback OnClose { get; set; }
|
||||
[Parameter] public EventCallback OnNext { get; set; }
|
||||
[Parameter] public EventCallback OnPrevious { get; set; }
|
||||
[Parameter] public EventCallback Toggle { get; set; }
|
||||
|
||||
private async Task CloseFromOverlay()
|
||||
{
|
||||
await OnClose.InvokeAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
|
||||
.gallery {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.gallery-thumb {
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
|
||||
.gallery-thumb:hover {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.header-selection {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.gallery-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.gallery-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.titles {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.image-container {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
overflow: hidden; /* cache le dépassement */
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.image-container img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
background-color: #000;
|
||||
transition: opacity 0.2s, border 0.2s, transform 0.2s;
|
||||
}
|
||||
|
||||
/* Image sélectionnée */
|
||||
.image-container.selected img {
|
||||
opacity: 0.6;
|
||||
border: 3px solid limegreen;
|
||||
}
|
||||
/* Bouton overlay */
|
||||
.select-btn {
|
||||
position: absolute;
|
||||
bottom: 8px;
|
||||
right: 8px;
|
||||
background-color: rgba(0, 0, 0, 0.6);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
font-size: 18px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.select-btn:hover {
|
||||
background-color: rgba(0, 128, 0, 0.8);
|
||||
}
|
||||
Reference in New Issue
Block a user