From 59db1ec0545d5cc89bbde2bdf13af75a00acda5a Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 6 Jan 2026 00:58:54 -0800 Subject: [PATCH] fix empty summon placeholder sizing with transparent svg --- src/lib/components/reps/SummonRep.svelte | 35 ++++++++++++++---------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/lib/components/reps/SummonRep.svelte b/src/lib/components/reps/SummonRep.svelte index 31991be2..361d7f40 100644 --- a/src/lib/components/reps/SummonRep.svelte +++ b/src/lib/components/reps/SummonRep.svelte @@ -20,9 +20,14 @@ Array.from({ length: 6 }, (_, i) => summons.find((s: GridSummon) => s?.position === i)) ) + // Transparent SVG placeholders with correct aspect ratios for grid sizing + // Main/friend: 56x97, Grid: 184x138 + const mainPlaceholder = `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 97'%3E%3C/svg%3E` + const gridPlaceholder = `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 184 138'%3E%3C/svg%3E` + function summonImageUrl(s?: GridSummon, isMain = false): string { const id = s?.summon?.granblueId - if (!id) return '' + if (!id) return isMain ? mainPlaceholder : gridPlaceholder const size = isMain ? 'main' : 'grid' return getSummonImage(id, size) } @@ -30,27 +35,27 @@
- {#if main}Main Summon{/if} + {main
- {#if friend}Friend Summon{/if} + {friend
@@ -67,6 +72,7 @@ // Layout: main summon | 6 grid summons (3x2) | friend summon grid-template-columns: auto 1fr auto; + grid-template-rows: 1fr; .summon, .mainSummon, @@ -90,7 +96,6 @@ .mainSummon, .friendSummon { @include rep.aspect(rep.$summon-main-w, rep.$summon-main-h); - display: grid; height: calc(100% - 6px); align-self: center; }