Files

49 lines
1.9 KiB
Plaintext
Raw Permalink Normal View History

@page
@model StatiKosev.Pages.Gallery
@{
2026-10-28 13:23:35 +02:00
ViewData["Title"] = StringValues["Gallery"];
}
@section Head {
<link rel="stylesheet" href="~/styles/gallery.css" asp-append-version="true"/>
}
2026-10-28 13:23:35 +02:00
<section class="slideshow" aria-roledescription="carousel" aria-label="@StringValues["Gallery"]">
<h1>@StringValues["Gallery"]</h1>
@if (Model.Images.Count == 0)
{
<p>@StringValues["GalleryEmpty"]</p>
}
else
{
@* without JavaScript this is a swipeable scroll-snap strip; slideshow.js adds the buttons and autoplay *@
<div class="slides" tabindex="0">
@for (var i = 0; i < Model.Images.Count; i++)
{
<figure class="slide" role="group" aria-roledescription="slide"
aria-label="@StringValues["SlideOf", i + 1, Model.Images.Count]">
<img src="@Model.Images[i]" alt="@StringValues["GoToSlide", i + 1]" asp-append-version="true"
loading="@(i == 0 ? "eager" : "lazy")"/>
</figure>
}
</div>
2026-10-28 13:23:35 +02:00
<div class="slideshow-controls" hidden>
<button type="button" class="slide-prev" aria-label="@StringValues["Previous"]">&#8249;</button>
<div class="slide-dots">
@for (var i = 0; i < Model.Images.Count; i++)
{
<button type="button" data-index="@i" aria-label="@StringValues["GoToSlide", i + 1]"></button>
}
</div>
<button type="button" class="slide-toggle" data-pause="@StringValues["Pause"]" data-play="@StringValues["Play"]"
aria-label="@StringValues["Pause"]">&#10074;&#10074;</button>
<button type="button" class="slide-next" aria-label="@StringValues["Next"]">&#8250;</button>
</div>
}
</section>
@section Scripts {
<script src="~/scripts/slideshow.js" asp-append-version="true"></script>
}