Add database cell components for icons and images
This commit is contained in:
parent
d262eba8b2
commit
30ab61fbc9
5 changed files with 58 additions and 4 deletions
|
|
@ -26,10 +26,10 @@
|
|||
|
||||
.database-image {
|
||||
max-width: 100%;
|
||||
max-height: 40px;
|
||||
max-height: 60px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
|||
27
src/lib/components/database/cells/ElementCell.svelte
Normal file
27
src/lib/components/database/cells/ElementCell.svelte
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<svelte:options runes={true} />
|
||||
|
||||
<script lang="ts">
|
||||
import type { IRow } from 'wx-svelte-grid'
|
||||
import ElementLabel from '$lib/components/labels/ElementLabel.svelte'
|
||||
|
||||
interface Props {
|
||||
row: IRow
|
||||
}
|
||||
|
||||
const { row }: Props = $props()
|
||||
|
||||
const element = $derived(row.element)
|
||||
</script>
|
||||
|
||||
<div class="element-cell">
|
||||
<ElementLabel {element} size="small" />
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.element-cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
27
src/lib/components/database/cells/ProficiencyCell.svelte
Normal file
27
src/lib/components/database/cells/ProficiencyCell.svelte
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<svelte:options runes={true} />
|
||||
|
||||
<script lang="ts">
|
||||
import type { IRow } from 'wx-svelte-grid'
|
||||
import ProficiencyLabel from '$lib/components/labels/ProficiencyLabel.svelte'
|
||||
|
||||
interface Props {
|
||||
row: IRow
|
||||
}
|
||||
|
||||
const { row }: Props = $props()
|
||||
|
||||
const proficiency = $derived(row.proficiency)
|
||||
</script>
|
||||
|
||||
<div class="proficiency-cell">
|
||||
<ProficiencyLabel {proficiency} size="large" />
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.proficiency-cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
.database-image {
|
||||
max-width: 100%;
|
||||
max-height: 40px;
|
||||
max-height: 60px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
.database-image {
|
||||
max-width: 100%;
|
||||
max-height: 40px;
|
||||
max-height: 60px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
|
|
|
|||
Loading…
Reference in a new issue