Skip to content

Commit

Permalink
Table improvements (#33)
Browse files Browse the repository at this point in the history
* Hide alignment until xl

* Move monster type above sources, hide (difficulty) label until xl

* Reorder columns to make more sense
  • Loading branch information
V13Axel authored Oct 22, 2023
1 parent 667c67d commit dc931af
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
20 changes: 10 additions & 10 deletions src/components/MonsterTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ onBeforeMount(() => {
class="table-cell w-64"
@sort="setSortBy($event)"
/>
<MonsterTableHeading
label="Alignment"
class="hidden xl:table-cell w-32 text-right pr-4"
/>
<MonsterTableHeading
label="Size"
sorts-column="size"
Expand All @@ -153,14 +157,6 @@ onBeforeMount(() => {
class="table-cell w-32"
@sort="setSortBy($event)"
/>
<MonsterTableHeading
label="CR"
sorts-column="cr.numeric"
:sort-by="sortBy"
:sort-by-desc="sortByDesc"
@sort="setSortBy($event)"
class="hidden sm:table-cell w-32"
/>
<MonsterTableHeading
label="Type"
sorts-column="type"
Expand All @@ -170,8 +166,12 @@ onBeforeMount(() => {
@sort="setSortBy($event)"
/>
<MonsterTableHeading
label="Alignment"
class="hidden lg:table-cell w-32 text-right pr-4"
label="CR"
sorts-column="cr.numeric"
:sort-by="sortBy"
:sort-by-desc="sortByDesc"
@sort="setSortBy($event)"
class="hidden sm:table-cell w-32"
/>
</tr>
</thead>
Expand Down
28 changes: 14 additions & 14 deletions src/components/MonsterTableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ const encounter = useEncounter();
{{ tag.toLowerCase() }}
</Badge>
</span>
<dt class="sr-only sm:hidden">Type</dt>
<dd
class="mt-1 truncate text-gray-500 dark:text-gray-400 lg:hidden"
v-text="monster.type"
></dd>
<dl class="font-normal">
<dt class="sr-only">Sources</dt>
<dd class="mt-1 truncate text-gray-500 dark:text-gray-400">
Expand All @@ -48,13 +53,12 @@ const encounter = useEncounter();
"
></span>
</dd>
<dt class="sr-only sm:hidden">Type</dt>
<dd
class="mt-1 truncate text-gray-500 dark:text-gray-400 lg:hidden"
v-text="monster.type"
></dd>
</dl>
</td>
<td
class="hidden px-3 pl-2 pr-4 text-sm text-gray-500 dark:text-gray-300 xl:table-cell w-32 text-right"
v-text="monster.alignment.string"
></td>
<td
class="px-3 py-2 text-sm text-gray-500 dark:text-gray-300 table-cell w-32 max-w-32 truncate"
>
Expand Down Expand Up @@ -92,6 +96,10 @@ const encounter = useEncounter();
></dd>
</dl>
</td>
<td
class="hidden px-3 py-2 text-sm text-gray-500 dark:text-gray-300 lg:table-cell w-32"
v-text="monster.type"
></td>
<td
class="hidden px-3 py-2 text-sm text-gray-500 dark:text-gray-300 sm:table-cell w-32"
>
Expand All @@ -114,17 +122,9 @@ const encounter = useEncounter();
v-text="
' (' + encounter.getDifficultyFromExperience(monster.cr.exp) + ')'
"
class="text-xs"
class="text-xs hidden xl:inline"
></span>
</span>
</td>
<td
class="hidden px-3 py-2 text-sm text-gray-500 dark:text-gray-300 lg:table-cell w-32"
v-text="monster.type"
></td>
<td
class="hidden px-3 pl-2 pr-4 text-sm text-gray-500 dark:text-gray-300 lg:table-cell w-32 text-right"
v-text="monster.alignment.string"
></td>
</tr>
</template>

0 comments on commit dc931af

Please sign in to comment.