From c65b006bb6d1d63fba064412e14cf43ca903456a Mon Sep 17 00:00:00 2001 From: beo3000 Date: Sun, 11 Jan 2026 11:59:44 +0100 Subject: [PATCH] gif fullscreen v1 --- .../Components/Game/FoxHunt/FoxSetup.razor | 6 +- .../Components/Game/GifPlayer.razor | 116 +++++---- .../Components/Game/GifPlayer_copilot.razor | 220 ++++++++++++++++++ .../Components/Game/GifPlayer_gemini.razor | 201 ++++++++++++++++ 4 files changed, 491 insertions(+), 52 deletions(-) create mode 100644 src/Koogle.Web/Components/Game/GifPlayer_copilot.razor create mode 100644 src/Koogle.Web/Components/Game/GifPlayer_gemini.razor diff --git a/src/Koogle.Web/Components/Game/FoxHunt/FoxSetup.razor b/src/Koogle.Web/Components/Game/FoxHunt/FoxSetup.razor index edffb94..babc5ec 100644 --- a/src/Koogle.Web/Components/Game/FoxHunt/FoxSetup.razor +++ b/src/Koogle.Web/Components/Game/FoxHunt/FoxSetup.razor @@ -22,8 +22,8 @@ Label="Ziel-Punkte" Variant="Variant.Outlined" Min="12" - Max="50" - HelperText="Vorsprung bei dem Fuchs entkommen erfolgreich ist (12-50)" /> + Max="60" + HelperText="Vorsprung bei dem Fuchs entkommen erfolgreich ist (12-60)" /> @@ -76,7 +76,7 @@ { public int LeadingThrows { get; set; } = 2; - public int PinCountGoal { get; set; } = 21; + public int PinCountGoal { get; set; } = 41; public ParticipantsMode ParticipantsMode { get; set; } = ParticipantsMode.GameLogic; } diff --git a/src/Koogle.Web/Components/Game/GifPlayer.razor b/src/Koogle.Web/Components/Game/GifPlayer.razor index 3fd384d..79b121f 100644 --- a/src/Koogle.Web/Components/Game/GifPlayer.razor +++ b/src/Koogle.Web/Components/Game/GifPlayer.razor @@ -1,23 +1,23 @@ @inherits Fluxor.Blazor.Web.Components.FluxorComponent - @using Fluxor @using Koogle.Application.DTOs @using Koogle.Application.Interfaces @using Koogle.Domain.Enums @using Koogle.Web.Store.GifState @inject IClubTerminologyService Terms - @inject IState GifState @inject IDispatcher Dispatcher @if (GifState.Value.IsPlaying && GifState.Value.CurrentGif != null) { - +
+ + @* Video/Image Bereich: Nimmt den verfügbaren Platz ein *@
@if (IsVideo) { -
-
- - @GetEventDisplayName(GifState.Value.TriggerEvent) - - - @GifState.Value.CurrentGif.Name - -
- + @* Controls *@ - - + +
} @@ -60,64 +56,86 @@ } diff --git a/src/Koogle.Web/Components/Game/GifPlayer_copilot.razor b/src/Koogle.Web/Components/Game/GifPlayer_copilot.razor new file mode 100644 index 0000000..a38e0f5 --- /dev/null +++ b/src/Koogle.Web/Components/Game/GifPlayer_copilot.razor @@ -0,0 +1,220 @@ +@inherits Fluxor.Blazor.Web.Components.FluxorComponent + +@using Fluxor +@using Koogle.Application.DTOs +@using Koogle.Application.Interfaces +@using Koogle.Domain.Enums +@using Koogle.Web.Store.GifState + +@inject IClubTerminologyService Terms +@inject IState GifState +@inject IDispatcher Dispatcher + +@if (GifState.Value.IsPlaying && GifState.Value.CurrentGif != null) +{ + + +
+
+ @if (IsVideo) + { + + } + else + { + @GifState.Value.CurrentGif.Name + } +
+ +
+ + @GetEventDisplayName(GifState.Value.TriggerEvent) + + + @GifState.Value.CurrentGif.Name + +
+ + + + @if (ShowRating) + { +
+ + +
+ } +
+
+} + + + +@code { + private ElementReference _videoElement; + + [Parameter] + public bool ShowRating { get; set; } = true; + + [Parameter] + public Guid? UserProfileId { get; set; } + + private bool IsVideo => GifState.Value.CurrentGif?.ContentType.StartsWith("video/") ?? false; + + private void DismissGif() + { + Dispatcher.Dispatch(new EndGifPlaybackAction()); + } + + private void RateGif(int value) + { + if (UserProfileId.HasValue && GifState.Value.CurrentGif != null) + { + Dispatcher.Dispatch(new RateCurrentGifAction(UserProfileId.Value, value)); + } + DismissGif(); + } + + private string _termNoWood = "PUDEL!"; + private string _termGutter = "RINNE!"; + private string _termBell = "GLOCKE!"; + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + var noWood = await Terms.GetTermAsync(TermKey.NoWood); + _termNoWood = $"{noWood.ToUpper()}!"; + + var gutter = await Terms.GetTermAsync(TermKey.Gutter); + _termGutter = $"{gutter.ToUpper()}!"; + + var bell = await Terms.GetTermAsync(TermKey.Gutter); + _termBell = $"{bell.ToUpper()}!"; + + StateHasChanged(); + } + } + + private string GetEventDisplayName(ThrowEventType? eventType) => eventType switch + { + ThrowEventType.Strike => "ALLE NEUNE!", + ThrowEventType.Circle => "KRANZ!", + ThrowEventType.Bell => _termBell, + ThrowEventType.Gutter => _termGutter, + ThrowEventType.NoWood => _termNoWood, + ThrowEventType.Cleared => "ABGERÄUMT!", + _ => "" + }; +} diff --git a/src/Koogle.Web/Components/Game/GifPlayer_gemini.razor b/src/Koogle.Web/Components/Game/GifPlayer_gemini.razor new file mode 100644 index 0000000..79b121f --- /dev/null +++ b/src/Koogle.Web/Components/Game/GifPlayer_gemini.razor @@ -0,0 +1,201 @@ +@inherits Fluxor.Blazor.Web.Components.FluxorComponent +@using Fluxor +@using Koogle.Application.DTOs +@using Koogle.Application.Interfaces +@using Koogle.Domain.Enums +@using Koogle.Web.Store.GifState +@inject IClubTerminologyService Terms +@inject IState GifState +@inject IDispatcher Dispatcher + +@if (GifState.Value.IsPlaying && GifState.Value.CurrentGif != null) +{ + +
+ + @* Video/Image Bereich: Nimmt den verfügbaren Platz ein *@ +
+ @if (IsVideo) + { + + } + else + { + @GifState.Value.CurrentGif.Name + } + + @* Overlay-Texte direkt auf dem Medium für maximale Platzersparnis *@ +
+ + @GetEventDisplayName(GifState.Value.TriggerEvent) + + + @GifState.Value.CurrentGif.Name + +
+
+ + @* Controls *@ + + + @if (ShowRating) + { +
+ + +
+ } +
+
+} + + + +@code { + private ElementReference _videoElement; + + [Parameter] + public bool ShowRating { get; set; } = true; + + [Parameter] + public Guid? UserProfileId { get; set; } + + private bool IsVideo => GifState.Value.CurrentGif?.ContentType.StartsWith("video/") ?? false; + + private void DismissGif() + { + Dispatcher.Dispatch(new EndGifPlaybackAction()); + } + + private void RateGif(int value) + { + if (UserProfileId.HasValue && GifState.Value.CurrentGif != null) + { + Dispatcher.Dispatch(new RateCurrentGifAction(UserProfileId.Value, value)); + } + DismissGif(); + } + + private string _termNoWood = "PUDEL!"; + + private string _termGutter = "RINNE!"; + + private string _termBell = "GLOCKE!"; + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + var noWood = await Terms.GetTermAsync(TermKey.NoWood); + _termNoWood = $"{noWood.ToUpper()}!"; + + var gutter = await Terms.GetTermAsync(TermKey.Gutter); + _termGutter = $"{gutter.ToUpper()}!"; + + var bell = await Terms.GetTermAsync(TermKey.Gutter); + _termBell = $"{bell.ToUpper()}!"; + + + StateHasChanged(); + } + } + + private string GetEventDisplayName(ThrowEventType? eventType) => eventType switch + { + ThrowEventType.Strike => "ALLE NEUNE!", + ThrowEventType.Circle => "KRANZ!", + ThrowEventType.Bell => _termBell, + ThrowEventType.Gutter => _termGutter, + ThrowEventType.NoWood => _termNoWood, + ThrowEventType.Cleared => "ABGERÄUMT!", + _ => "" + }; +}