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:
@@ -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"))]);
|
||||
|
||||
Reference in New Issue
Block a user