feat: Enhance group display with hover effect for team visibility
All checks were successful
SteamWarCI Build successful

This commit is contained in:
2025-12-31 13:25:10 +01:00
parent 1ed1901311
commit f507dce94a

View File

@@ -5,6 +5,7 @@
import EventCardOutline from "./EventCardOutline.svelte"; import EventCardOutline from "./EventCardOutline.svelte";
import EventTeamChip from "./EventTeamChip.svelte"; import EventTeamChip from "./EventTeamChip.svelte";
import EventFightChip from "./EventFightChip.svelte"; import EventFightChip from "./EventFightChip.svelte";
import { teamHoverService } from "./team-hover.svelte";
const { const {
event, event,
@@ -39,6 +40,8 @@
if (currentRound.length) rounds.push(currentRound); if (currentRound.length) rounds.push(currentRound);
return rounds; return rounds;
} }
const hover = $teamHoverService;
</script> </script>
{#each config.groups as groupId} {#each config.groups as groupId}
@@ -58,7 +61,8 @@
</EventCard> </EventCard>
</div> </div>
{#each rounds as round, index} {#each rounds as round, index}
<div> {@const teams = Array.from(new Set(round.flatMap((f) => [f.redTeam, f.blueTeam])))}
<div class="{hover.currentHover && !teams.some((t) => t?.id === hover.currentHover) ? 'opacity-30' : ''} transition-opacity">
<EventCard title="Runde {index + 1}"> <EventCard title="Runde {index + 1}">
{#each round as fight} {#each round as fight}
<EventFightChip {event} {fight} {group} /> <EventFightChip {event} {fight} {group} />