Hero-admin: meerdere foto's tegelijk, slepen, niet-opgeslagen waarschuwing, begrijpelijke teksten, rustige wachtanimatie

- Meerdere bestanden kiezen of slepen (2 tegelijk, per bestand voortgang en reden bij falen, volgorde van kiezen), uploadlimiet standaard 100 per uur
- Volgorde ook met slepen (greepje, toetsenbord), pijltjes blijven
- Waarschuwing bij niet-opgeslagen wijzigingen (badge, beforeunload, bevestiging bij navigeren, vergelijking met laatst opgeslagen stand)
- Teksten zonder vakjargon, uitleg per onderdeel, formaten en limieten van de host (GET /hero/images/limits)
- Shimmer (CSS, reduced-motion) op foto's die nog verwerkt worden

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 21:56:10 +01:00
co-authored by Claude Sonnet 5.5
parent 49302c3228
commit 9d647bb049
20 changed files with 900 additions and 98 deletions
@@ -33,6 +33,20 @@ public static class HeroMapping
{
public const string Area = "hero";
/// <summary>The accepted upload formats (as the host allows them right now) and limits, in the words an administrator knows.</summary>
public static HeroUploadLimitsDto UploadLimits(MediaStatus status, MediaOptions limits)
=> new(
status.AcceptedInput.OrderBy(f => f).Select(DisplayName).ToList(),
limits.MaxUploadBytes,
(int)Math.Max(1, limits.MaxPixels / 1_000_000));
private static string DisplayName(ImageFormat format) => format switch
{
ImageFormat.Jpeg => "JPEG",
ImageFormat.WebP => "WebP",
_ => format.ToString().ToUpperInvariant(),
};
/// <summary>The set hash the image should have at its current focus.</summary>
public static string TargetSetHash(HeroImage image)
=> MediaPaths.SetHash(image.OriginalSha256, [("wide", image.FocusFor("wide")), ("tall", image.FocusFor("tall"))]);