From a858877545a0862940f49e46cfabe93abac6b7f0 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 30 Nov 2025 20:06:31 -0800 Subject: [PATCH] sidebar: refactor details components --- .../components/sidebar/DetailsSidebar.svelte | 43 ++- .../sidebar/details/BasicInfoSection.svelte | 145 +++++------ .../sidebar/details/ItemHeader.svelte | 4 + .../sidebar/details/StatsSection.svelte | 198 +++----------- .../sidebar/details/TeamView.svelte | 134 +++++----- .../modifications/WeaponKeysList.svelte | 246 ++++++++---------- 6 files changed, 307 insertions(+), 463 deletions(-) diff --git a/src/lib/components/sidebar/DetailsSidebar.svelte b/src/lib/components/sidebar/DetailsSidebar.svelte index 973fcad3..d0669d9d 100644 --- a/src/lib/components/sidebar/DetailsSidebar.svelte +++ b/src/lib/components/sidebar/DetailsSidebar.svelte @@ -1,6 +1,8 @@ -
-

Basic Information

-
- Rarity - {getRarityLabel(itemData?.rarity)} -
-
- Element - {getElementLabel(itemData?.element)} -
+ + + + + {#if type === 'character'} {#if itemData?.race && itemData.race.length > 0} -
- Race - - {itemData.race - .map((r: any) => getRaceLabel(r)) - .filter(Boolean) - .join(', ') || '—'} - -
+ getRaceLabel(r)) + .filter(Boolean) + .join(', ') || '—'} + /> {/if} -
- Gender - {getGenderLabel(itemData?.gender)} -
+ {#if itemData?.proficiency && itemData.proficiency.length > 0} -
- Proficiencies - - {itemData.proficiency - .map((p: any) => getProficiencyLabel(p)) - .filter(Boolean) - .join(', ') || '—'} - -
+ + {#each itemData.proficiency as prof} + + {/each} + {/if} {:else if type === 'weapon'} -
- Proficiency - {getProficiencyLabel(itemData?.proficiency)} -
+ + + {/if} -
- + + + + diff --git a/src/lib/components/sidebar/details/ItemHeader.svelte b/src/lib/components/sidebar/details/ItemHeader.svelte index 586d3682..7ba78b9a 100644 --- a/src/lib/components/sidebar/details/ItemHeader.svelte +++ b/src/lib/components/sidebar/details/ItemHeader.svelte @@ -62,6 +62,9 @@ } return '—' } + + // Special characters have different star counts (SR characters, etc.) + const special = $derived(type === 'character' && (itemData?.rarity ?? 3) < 3)
@@ -74,6 +77,7 @@ flb={itemData?.uncap?.flb} ulb={itemData?.uncap?.ulb} transcendence={itemData?.uncap?.transcendence} + {special} editable={false} />
diff --git a/src/lib/components/sidebar/details/StatsSection.svelte b/src/lib/components/sidebar/details/StatsSection.svelte index 75c9d152..e3f151e2 100644 --- a/src/lib/components/sidebar/details/StatsSection.svelte +++ b/src/lib/components/sidebar/details/StatsSection.svelte @@ -1,4 +1,7 @@ -
- {#if itemData?.hp && itemData?.atk} -
-
-
HP
-
ATK
+{#if itemData?.hp} + + + + {#if itemData.uncap?.flb && itemData.hp.maxHpFlb} + + {/if} + {#if itemData.uncap?.ulb && itemData.hp.maxHpUlb} + + {/if} + {#if gridTranscendence && gridTranscendence > 0} + + {/if} + +{/if} -
Base
-
{itemData.hp.minHp ?? '—'}
-
{itemData.atk.minAtk ?? '—'}
- -
MLB
-
{itemData.hp.maxHp ?? '—'}
-
{itemData.atk.maxAtk ?? '—'}
- - {#if itemData.uncap?.flb && (itemData.hp.maxHpFlb || itemData.atk.maxAtkFlb)} -
FLB
-
{itemData.hp.maxHpFlb ?? '—'}
-
{itemData.atk.maxAtkFlb ?? '—'}
- {/if} - - {#if itemData.uncap?.ulb && (itemData.hp.maxHpUlb || itemData.atk.maxAtkUlb)} -
ULB
-
{itemData.hp.maxHpUlb ?? '—'}
-
{itemData.atk.maxAtkUlb ?? '—'}
- {/if} - - {#if gridTranscendence && gridTranscendence > 0} -
T5
-
{itemData.hp.maxHpXlb ?? '—'}
-
{itemData.atk.maxAtkXlb ?? '—'}
- {/if} -
- {/if} -
- - +{#if itemData?.atk} + + + + {#if itemData.uncap?.flb && itemData.atk.maxAtkFlb} + + {/if} + {#if itemData.uncap?.ulb && itemData.atk.maxAtkUlb} + + {/if} + {#if gridTranscendence && gridTranscendence > 0} + + {/if} + +{/if} diff --git a/src/lib/components/sidebar/details/TeamView.svelte b/src/lib/components/sidebar/details/TeamView.svelte index fd7797d8..56149e5f 100644 --- a/src/lib/components/sidebar/details/TeamView.svelte +++ b/src/lib/components/sidebar/details/TeamView.svelte @@ -1,21 +1,13 @@
- - - + + + + + {#if type === 'character'} {@const char = item as GridCharacter} {#if modificationStatus.hasAwakening} - + - + {/if} {#if modificationStatus.hasRings || modificationStatus.hasEarring} - + - + {/if} {#if modificationStatus.hasPerpetuity} - - - + + + {/if} {:else if type === 'weapon'} {@const weapon = item as GridWeapon} {#if modificationStatus.hasAwakening && weapon.awakening} - + - + {/if} {#if modificationStatus.hasWeaponKeys} - + - + {/if} {#if modificationStatus.hasAxSkills && weapon.ax} - + {#each weapon.ax as axSkill} - {/each} - + {/if} {#if modificationStatus.hasElement && weapon.element} - - - + + + + + {/if} {:else if type === 'summon'} {@const summon = item as GridSummon} {#if modificationStatus.hasQuickSummon || modificationStatus.hasFriendSummon} - + {#if summon.quickSummon} - + {/if} {#if summon.friend} - + {/if} - + {/if} {/if}
diff --git a/src/lib/components/sidebar/modifications/WeaponKeysList.svelte b/src/lib/components/sidebar/modifications/WeaponKeysList.svelte index 37c7aec6..dde647f0 100644 --- a/src/lib/components/sidebar/modifications/WeaponKeysList.svelte +++ b/src/lib/components/sidebar/modifications/WeaponKeysList.svelte @@ -1,157 +1,137 @@ {#if weaponKeys && weaponKeys.length > 0} -
- {#each weaponKeys as key, index} - {@const imageData = keyImages[index]} -
- {#if imageData} - {imageData.alt} - {/if} -
- - {getSlotLabel(key.slot, weaponData?.series)} - - - {getKeyDescription(key)} - -
-
- {/each} -
+
+ {#each weaponKeys as key, index} + {@const imageData = keyImages[index]} +
+ {#if imageData} + {imageData.alt} + {/if} +
+ + {getSlotLabel(key.slot, weaponData?.series)} + + + {getKeyDescription(key)} + +
+
+ {/each} +
{/if} \ No newline at end of file + .weapon-key-info { + align-items: center; + } + } + } +