diff --git a/src/routes/characters/_characterGridItem.svelte b/src/routes/characters/_characterGridItem.svelte new file mode 100644 index 00000000..b305c691 --- /dev/null +++ b/src/routes/characters/_characterGridItem.svelte @@ -0,0 +1,74 @@ + + + +
+ {char.name} +
+
+ {#if constellation} + + C{Math.max(0, constellation.default + constellation.wish + constellation.manual - 1)} + + {/if} + {char.element.name} +
+
+
+

+ {name} +

+
+
+
+ + diff --git a/src/routes/characters/index.svelte b/src/routes/characters/index.svelte index 35eeb547..3940e286 100644 --- a/src/routes/characters/index.svelte +++ b/src/routes/characters/index.svelte @@ -13,6 +13,8 @@ import Button from '../../components/Button.svelte'; import Ad from '../../components/Ad.svelte'; + import CharacterGridItem from './_characterGridItem.svelte'; + const sortOptions = [ { label: $t('characters.name'), value: 'name' }, { label: $t('characters.element'), value: 'element' }, @@ -57,9 +59,9 @@ switch (sortBy) { case 'name': if (sortOrder) { - return a[1].name.localeCompare(b[1].name); + return $t(a[1].name).localeCompare($t(b[1].name)); } else { - return b[1].name.localeCompare(a[1].name); + return $t(b[1].name).localeCompare($t(a[1].name)); } case 'element': if (sortOrder) { @@ -258,13 +260,6 @@ } catch (error) {} } - function getNameStyle(name) { - if (name.length > 11) { - return 'font-size: 12px; line-height: 1; word-spacing: 200px; padding-bottom: 3px;'; - } - return ''; - } - onMount(async () => { await getConstellation(); }); @@ -433,46 +428,7 @@
{#each chars as [id, char] (id)} - -
- {char.name} -
-
- {#if constellation[id]} - - C{Math.max(0, constellation[id].default + constellation[id].wish + constellation[id].manual - 1)} - - {/if} - {char.element.name} -
-
-
-

- {$t(char.name)} -

-
-
-
+ {/each}
{#if showConstellation}