feat: build compact BO2 grind companion with cumulative ranks
Some checks failed
Test and deploy staging / staging (push) Failing after 2m50s
Some checks failed
Test and deploy staging / staging (push) Failing after 2m50s
This commit is contained in:
34
src/lib/game-tracker/PlayerRankBadge.svelte
Normal file
34
src/lib/game-tracker/PlayerRankBadge.svelte
Normal file
@@ -0,0 +1,34 @@
|
||||
<script lang="ts">
|
||||
import { base } from '$app/paths';
|
||||
import ChevronsUp from 'lucide-svelte/icons/chevrons-up';
|
||||
import Award from 'lucide-svelte/icons/award';
|
||||
let { game, level, prestige }: { game: string; level: number; prestige: number } = $props();
|
||||
const master = $derived(game === 'black-ops-2' && prestige === 10 && level === 55);
|
||||
</script>
|
||||
|
||||
<div class="flex items-center gap-4" aria-label="Player level and prestige">
|
||||
<div class="flex items-center gap-2">
|
||||
<ChevronsUp class="size-7 text-amber-500" aria-label="Level icon" role="img" />
|
||||
<div>
|
||||
<span class="block text-[9px] tracking-widest text-muted-foreground">LEVEL</span><strong
|
||||
class="text-sm tabular-nums">{level}</strong
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
{#if game === 'black-ops-2' && prestige > 0 && prestige <= 10}
|
||||
<img
|
||||
src={`${base}/game-art/call-of-duty/ranks/black-ops-2-prestige-${master ? 11 : prestige}.webp`}
|
||||
alt={master ? 'Prestige Master emblem' : `Prestige ${prestige} emblem`}
|
||||
width="36"
|
||||
height="36"
|
||||
class="size-9 object-contain"
|
||||
/>
|
||||
{:else}<Award class="size-7 text-muted-foreground" aria-label="Prestige icon" role="img" />{/if}
|
||||
<div>
|
||||
<span class="block text-[9px] tracking-widest text-muted-foreground">PRESTIGE</span><strong
|
||||
class="text-sm tabular-nums">{master ? 'Master' : prestige}</strong
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user