-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/bugfixes' of https://github.com/SkyCryptWebsite/Sk…
…yCryptv2 into feat/bugfixes
- Loading branch information
Showing
4 changed files
with
44 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
<script lang="ts"> | ||
import Item from "$lib/components/Item.svelte"; | ||
import type { ProcessedItem } from "$lib/types/global"; | ||
import { Collapsible } from "bits-ui"; | ||
import { Avatar, Collapsible } from "bits-ui"; | ||
import { writable } from "svelte/store"; | ||
import { slide } from "svelte/transition"; | ||
export let firstWardrobeItem: ProcessedItem | undefined; | ||
export let wardrobeItems: ProcessedItem[]; | ||
const highestItem = wardrobeItems.find((piece) => piece); | ||
const pieces = ["helmet", "chestplate", "leggings", "boots"]; | ||
const expanded = writable<boolean>(false); | ||
</script> | ||
|
||
<Collapsible.Root bind:open={$expanded}> | ||
<Collapsible.Trigger> | ||
{#if firstWardrobeItem} | ||
<Item piece={firstWardrobeItem} /> | ||
<Collapsible.Trigger class="mt-2 flex flex-col gap-2"> | ||
{#if !$expanded} | ||
{#if highestItem} | ||
<Item piece={highestItem} /> | ||
{/if} | ||
{:else} | ||
<Collapsible.Content transition={slide} class="flex flex-col gap-2"> | ||
{#each wardrobeItems as piece, index} | ||
{#if piece} | ||
<Item {piece} /> | ||
{:else} | ||
<Avatar.Root class="rounded-lg bg-background-lore p-2"> | ||
<Avatar.Image class="size-14" loading="eager" src={`/img/textures/item/empty_armor_slot_${pieces[index]}.png`} /> | ||
</Avatar.Root> | ||
{/if} | ||
{/each} | ||
</Collapsible.Content> | ||
{/if} | ||
</Collapsible.Trigger> | ||
<Collapsible.Content transition={slide} class="mt-2 flex flex-col gap-2"> | ||
{#each wardrobeItems as piece} | ||
{#if piece} | ||
{#if piece !== firstWardrobeItem} | ||
<Item {piece} /> | ||
{/if} | ||
{:else} | ||
<!-- TODO: Add placeholders --> | ||
<div class="flex size-24 items-center justify-center rounded-lg bg-background-lore"> | ||
<p class="text-text/60">TODO: <br /> Add placeholders</p> | ||
</div> | ||
{/if} | ||
{/each} | ||
</Collapsible.Content> | ||
</Collapsible.Root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters