collection page card styling + contained filters

This commit is contained in:
Justin Edmund 2025-12-13 20:58:20 -08:00
parent c54c959522
commit 20dabc5aa1
2 changed files with 61 additions and 43 deletions

View file

@ -289,6 +289,7 @@
bind:value={elementFilters} bind:value={elementFilters}
onValueChange={handleElementChange} onValueChange={handleElementChange}
placeholder="Element" placeholder="Element"
contained
/> />
{/if} {/if}
@ -298,6 +299,7 @@
bind:value={rarityFilters} bind:value={rarityFilters}
onValueChange={handleRarityChange} onValueChange={handleRarityChange}
placeholder="Rarity" placeholder="Rarity"
contained
/> />
{/if} {/if}
@ -307,6 +309,7 @@
bind:value={seasonFilters} bind:value={seasonFilters}
onValueChange={handleSeasonChange} onValueChange={handleSeasonChange}
placeholder="Season" placeholder="Season"
contained
/> />
{/if} {/if}
@ -316,6 +319,7 @@
bind:value={seriesFilters} bind:value={seriesFilters}
onValueChange={handleSeriesChange} onValueChange={handleSeriesChange}
placeholder={entityType === 'weapon' ? 'Weapon Series' : 'Series'} placeholder={entityType === 'weapon' ? 'Weapon Series' : 'Series'}
contained
/> />
{/if} {/if}
@ -325,6 +329,7 @@
bind:value={raceFilters} bind:value={raceFilters}
onValueChange={handleRaceChange} onValueChange={handleRaceChange}
placeholder="Race" placeholder="Race"
contained
/> />
{/if} {/if}
@ -334,6 +339,7 @@
bind:value={proficiencyFilters} bind:value={proficiencyFilters}
onValueChange={handleProficiencyChange} onValueChange={handleProficiencyChange}
placeholder={entityType === 'weapon' ? 'Weapon Type' : 'Proficiency'} placeholder={entityType === 'weapon' ? 'Weapon Type' : 'Proficiency'}
contained
/> />
{/if} {/if}
@ -343,6 +349,7 @@
bind:value={genderFilters} bind:value={genderFilters}
onValueChange={handleGenderChange} onValueChange={handleGenderChange}
placeholder="Gender" placeholder="Gender"
contained
/> />
{/if} {/if}
@ -384,6 +391,7 @@
bind:value={sortBy} bind:value={sortBy}
onValueChange={handleSortChange} onValueChange={handleSortChange}
size="small" size="small"
contained
/> />
</div> </div>
{/if} {/if}

View file

@ -57,52 +57,58 @@
<section class="collection"> <section class="collection">
<ProfileHeader <ProfileHeader
{username} username={username ?? ''}
avatarPicture={data.user?.avatar?.picture} avatarPicture={data.user?.avatar?.picture}
title={username} element={data.user?.avatar?.element}
granblueId={data.user?.granblueId}
showCrewGamertag={data.user?.showCrewGamertag}
crewGamertag={data.user?.crewGamertag}
title={username ?? ''}
activeTab="collection" activeTab="collection"
isOwner={data.isOwner} isOwner={data.isOwner}
/> />
<!-- Entity type segmented control --> <div class="card-container">
<nav class="entity-nav" aria-label="Collection type"> <!-- Entity type segmented control -->
<SegmentedControl <nav class="entity-nav" aria-label="Collection type">
value={activeEntityType} <SegmentedControl
onValueChange={handleTabChange} value={activeEntityType}
variant="blended" onValueChange={handleTabChange}
size="small" variant="blended"
>
<Segment value="characters">Characters</Segment>
<Segment value="weapons">Weapons</Segment>
<Segment value="summons">Summons</Segment>
<Segment value="artifacts">Artifacts</Segment>
</SegmentedControl>
{#if data.isOwner && supportsAddModal}
<Button
variant="primary"
size="small" size="small"
onclick={() => (addModalOpen = true)}
icon="plus"
iconPosition="left"
> >
{addButtonText} <Segment value="characters">Characters</Segment>
</Button> <Segment value="weapons">Weapons</Segment>
{:else if data.isOwner && isArtifacts} <Segment value="summons">Summons</Segment>
<Button <Segment value="artifacts">Artifacts</Segment>
variant="primary" </SegmentedControl>
size="small"
onclick={handleAddArtifact}
icon="plus"
iconPosition="left"
>
Add artifact
</Button>
{/if}
</nav>
<div class="content"> {#if data.isOwner && supportsAddModal}
{@render children()} <Button
variant="primary"
size="small"
onclick={() => (addModalOpen = true)}
icon="plus"
iconPosition="left"
>
{addButtonText}
</Button>
{:else if data.isOwner && isArtifacts}
<Button
variant="primary"
size="small"
onclick={handleAddArtifact}
icon="plus"
iconPosition="left"
>
Add artifact
</Button>
{/if}
</nav>
<div class="content">
{@render children()}
</div>
</div> </div>
</section> </section>
@ -116,24 +122,28 @@
<style lang="scss"> <style lang="scss">
@use '$src/themes/spacing' as *; @use '$src/themes/spacing' as *;
@use '$src/themes/layout' as *;
.collection { .collection {
padding: $unit-2x 0; padding: $unit-2x 0;
} }
.card-container {
background: var(--card-bg);
border-radius: $card-corner;
}
.entity-nav { .entity-nav {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: $unit-2x; gap: $unit-2x;
margin-bottom: $unit-2x; padding: $unit-2x;
border-bottom: 1px solid var(--border-subtle);
:global(.button) {
align-self: stretch;
}
} }
.content { .content {
padding: $unit-2x;
min-height: 400px; min-height: 400px;
} }
</style> </style>