|
87 | 87 | {#if catacombs} |
88 | 88 | <ScrollItems> |
89 | 89 | {#each catacombs as catacomb, index (index)} |
90 | | - <div class="bg-background/30 flex min-w-80 basis-[calc((100%/3)-1.25rem)] flex-col gap-1 rounded-lg"> |
91 | | - <div class="border-icon flex w-full items-center justify-center gap-1.5 border-b-2 py-2 text-center font-semibold uppercase"> |
92 | | - <Avatar.Root> |
93 | | - <Avatar.Image loading="lazy" src={catacomb.texture} class="size-8 object-contain" /> |
94 | | - <Avatar.Fallback> |
95 | | - <Image class="size-8" /> |
96 | | - </Avatar.Fallback> |
97 | | - </Avatar.Root> |
98 | | - {catacomb.name} |
99 | | - </div> |
100 | | - |
101 | | - <Collapsible.Root class="p-5"> |
102 | | - <Collapsible.Trigger class="group flex items-center gap-0.5"> |
103 | | - <ChevronDown class="size-5 transition-all duration-300 group-data-[state=open]:-rotate-180" /> |
104 | | - <SectionSubtitle class="my-0">Floor Stats</SectionSubtitle> |
105 | | - </Collapsible.Trigger> |
106 | | - <Collapsible.Content> |
107 | | - {#each Object.entries(catacomb.stats) as [key, value], index (index)} |
108 | | - {#if typeof value === "object"} |
109 | | - <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={formatNumber(value.damage)} subData="({value.type})" /> |
110 | | - {:else if key.includes("time") && key !== "times_played"} |
111 | | - <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={formatDuration(value)} /> |
112 | | - {:else} |
113 | | - <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={formatNumber(value)} /> |
114 | | - {/if} |
115 | | - {/each} |
116 | | - </Collapsible.Content> |
117 | | - </Collapsible.Root> |
| 90 | + {#if catacomb.stats.tier_completions > 0} |
| 91 | + <div class="bg-background/30 flex min-w-80 basis-[calc((100%/3)-1.25rem)] flex-col gap-1 rounded-lg"> |
| 92 | + <div class="border-icon flex w-full items-center justify-center gap-1.5 border-b-2 py-2 text-center font-semibold uppercase"> |
| 93 | + <Avatar.Root> |
| 94 | + <Avatar.Image loading="lazy" src={catacomb.texture} class="size-8 object-contain" /> |
| 95 | + <Avatar.Fallback> |
| 96 | + <Image class="size-8" /> |
| 97 | + </Avatar.Fallback> |
| 98 | + </Avatar.Root> |
| 99 | + {catacomb.name} |
| 100 | + </div> |
118 | 101 |
|
119 | | - {#if catacomb.best_run} |
120 | | - <Collapsible.Root class="px-5 pb-[2.5rem]"> |
| 102 | + <Collapsible.Root class="p-5"> |
121 | 103 | <Collapsible.Trigger class="group flex items-center gap-0.5"> |
122 | 104 | <ChevronDown class="size-5 transition-all duration-300 group-data-[state=open]:-rotate-180" /> |
123 | | - <SectionSubtitle class="my-0">Best run</SectionSubtitle> |
| 105 | + <SectionSubtitle class="my-0">Floor Stats</SectionSubtitle> |
124 | 106 | </Collapsible.Trigger> |
125 | 107 | <Collapsible.Content> |
126 | | - {#each Object.entries(catacomb.best_run) as [key, value], index (index)} |
127 | | - {#if typeof value === "number"} |
128 | | - {#if key === "timestamp"} |
129 | | - <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={formatDistanceToNowStrict(value, { addSuffix: true })} asterisk={true}> |
130 | | - {formatDate(value, "dd MMMM yyyy 'at' HH:mm")} |
131 | | - </AdditionStat> |
132 | | - {:else if key.includes("time")} |
133 | | - <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={formatDuration(value)} /> |
134 | | - {:else} |
135 | | - <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={formatNumber(value)} /> |
136 | | - {/if} |
| 108 | + {#each Object.entries(catacomb.stats) as [key, value], index (index)} |
| 109 | + {#if typeof value === "object"} |
| 110 | + <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={formatNumber(value.damage)} subData="({value.type})" /> |
| 111 | + {:else if key.includes("time") && key !== "times_played"} |
| 112 | + <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={formatDuration(value)} /> |
137 | 113 | {:else} |
138 | | - <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={value} /> |
| 114 | + <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={formatNumber(value)} /> |
139 | 115 | {/if} |
140 | 116 | {/each} |
141 | 117 | </Collapsible.Content> |
142 | 118 | </Collapsible.Root> |
143 | | - {:else} |
144 | | - <div class="p-5 text-center">This player has not completed this floor.</div> |
145 | | - {/if} |
146 | | - </div> |
| 119 | + |
| 120 | + {#if catacomb.best_run} |
| 121 | + <Collapsible.Root class="px-5 pb-[2.5rem]"> |
| 122 | + <Collapsible.Trigger class="group flex items-center gap-0.5"> |
| 123 | + <ChevronDown class="size-5 transition-all duration-300 group-data-[state=open]:-rotate-180" /> |
| 124 | + <SectionSubtitle class="my-0">Best run</SectionSubtitle> |
| 125 | + </Collapsible.Trigger> |
| 126 | + <Collapsible.Content> |
| 127 | + {#each Object.entries(catacomb.best_run) as [key, value], index (index)} |
| 128 | + {#if typeof value === "number"} |
| 129 | + {#if key === "timestamp"} |
| 130 | + <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={formatDistanceToNowStrict(value, { addSuffix: true })} asterisk={true}> |
| 131 | + {formatDate(value, "dd MMMM yyyy 'at' HH:mm")} |
| 132 | + </AdditionStat> |
| 133 | + {:else if key.includes("time")} |
| 134 | + <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={formatDuration(value)} /> |
| 135 | + {:else} |
| 136 | + <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={formatNumber(value)} /> |
| 137 | + {/if} |
| 138 | + {:else} |
| 139 | + <AdditionStat class="capitalize" text={key.toLowerCase().replaceAll("_", " ")} data={value} /> |
| 140 | + {/if} |
| 141 | + {/each} |
| 142 | + </Collapsible.Content> |
| 143 | + </Collapsible.Root> |
| 144 | + {:else} |
| 145 | + <div class="p-5 text-center">This player has not completed this floor.</div> |
| 146 | + {/if} |
| 147 | + </div> |
| 148 | + {/if} |
147 | 149 | {/each} |
148 | 150 | </ScrollItems> |
149 | 151 | {:else} |
|
0 commit comments