Some checks failed
Test and deploy staging / staging (push) Failing after 14s
- run sv migrate sveltekit-3: config moves into vite.config.ts, $lib becomes #lib, $env/dynamic becomes $app/env/private via src/env.ts, $app/environment becomes $app/env, hook types move to @sveltejs/kit/hooks - env vars stay optional (the migrator defaulted them to ''), and BANCHO_MODE, which it missed, is declared and passed to simulatorEnabled - handleError only logs and masks unknown errors; Kit 3 now routes 404s and error(...) through it too - json()/text() become Response.json()/new Response(); goto keepFocus/noScroll becomes reset: false; invalidateAll becomes refreshAll; page.url is copied before mutating - replace adapter-node with @sveltejs/adapter-bun; prod-server.ts wraps Bun.serve to add native WebSockets (bunSockets) for /ws paths, since the generated server has no websocket option - drop the Kit readdir patch: Kit 3 sorts route entries itself - match view and broadcast pages use the live score modules BREAKING CHANGE: requires SvelteKit 3, TypeScript 6 and Bun 1.4; the build output is build/index.js from adapter-bun, started through prod-server.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47 lines
1.6 KiB
Svelte
47 lines
1.6 KiB
Svelte
<script lang="ts">
|
|
import { fly } from 'svelte/transition';
|
|
import { SIDE_COLORS, modColor } from '#lib/components/match/theme.js';
|
|
import { numberFormat, type OverlayProps } from './context';
|
|
import Panel from './Panel.svelte';
|
|
|
|
const { data, accent }: OverlayProps = $props();
|
|
const view = $derived(data.view);
|
|
</script>
|
|
|
|
{#if view}
|
|
<Panel {accent} edge="top">
|
|
<div class="flex h-full flex-col gap-2 overflow-hidden p-5">
|
|
<div class="text-sm font-bold tracking-[0.25em] text-zinc-400 uppercase">Maps</div>
|
|
{#each view.maps as map (map.index)}
|
|
{@const slot = view.slots.find((each) => each.id === map.slotId)}
|
|
{@const winner = view.sides.find((side) => side.id === map.winner)}
|
|
<div
|
|
in:fly={{ x: -30, duration: 400 }}
|
|
class="flex items-center gap-3 rounded-lg bg-white/5 px-3 py-2 text-lg"
|
|
>
|
|
<span
|
|
class="rounded px-2 text-base font-black text-zinc-950"
|
|
style="background:{modColor(slot?.category ?? '')}">{slot?.label ?? '?'}</span
|
|
>
|
|
<span class="min-w-0 flex-1 truncate text-zinc-300">{slot?.title ?? ''}</span>
|
|
{#each view.sides as side (side.id)}
|
|
<span
|
|
class="w-28 text-right tabular-nums {map.winner === side.id
|
|
? 'font-bold'
|
|
: 'text-zinc-500'}"
|
|
style={map.winner === side.id ? `color:${SIDE_COLORS[side.color].text}` : ''}
|
|
>{numberFormat.format(map.totals[side.id] ?? 0)}</span
|
|
>
|
|
{/each}
|
|
{#if winner}<span
|
|
class="size-3 rounded-full"
|
|
style="background:{SIDE_COLORS[winner.color].solid}"
|
|
></span>{/if}
|
|
</div>
|
|
{:else}
|
|
<div class="text-lg text-zinc-500">No maps played yet.</div>
|
|
{/each}
|
|
</div>
|
|
</Panel>
|
|
{/if}
|