fix placeholder images to use CDN url
This commit is contained in:
parent
42f7722e50
commit
b2f4cf5246
4 changed files with 10 additions and 18 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
<script lang="ts">
|
||||
import Icon from '$lib/components/Icon.svelte'
|
||||
import { getPlaceholderImage } from '$lib/utils/images'
|
||||
|
||||
export interface EntityTab {
|
||||
wikiPage: string
|
||||
|
|
@ -22,16 +23,7 @@
|
|||
let { entities, selectedWikiPage, onSelect, entityType }: Props = $props()
|
||||
|
||||
// Get placeholder image based on entity type
|
||||
const placeholderImage = $derived(() => {
|
||||
switch (entityType) {
|
||||
case 'character':
|
||||
return '/images/placeholders/placeholder-character-square.png'
|
||||
case 'weapon':
|
||||
return '/images/placeholders/placeholder-weapon-square.png'
|
||||
case 'summon':
|
||||
return '/images/placeholders/placeholder-summon-square.png'
|
||||
}
|
||||
})
|
||||
const placeholderImage = $derived(getPlaceholderImage(entityType, 'square'))
|
||||
</script>
|
||||
|
||||
<div class="entity-selector">
|
||||
|
|
@ -48,7 +40,7 @@
|
|||
disabled={entity.saved}
|
||||
>
|
||||
<img
|
||||
src={entity.granblueId ? entity.imageUrl : placeholderImage()}
|
||||
src={entity.granblueId ? entity.imageUrl : placeholderImage}
|
||||
alt={entity.wikiPage}
|
||||
class="entity-image"
|
||||
class:placeholder={!entity.granblueId}
|
||||
|
|
@ -60,7 +52,7 @@
|
|||
</span>
|
||||
{:else if entity.status === 'error'}
|
||||
<span class="status-overlay error">
|
||||
<Icon name="alert-circle" size={20} />
|
||||
<Icon name="close" size={20} />
|
||||
</span>
|
||||
{:else if entity.saved}
|
||||
<span class="status-overlay saved">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<script lang="ts">
|
||||
import { goto } from '$app/navigation'
|
||||
import { entityAdapter, type CharacterSuggestions } from '$lib/api/adapters/entity.adapter'
|
||||
import { getCharacterImage } from '$lib/utils/images'
|
||||
import { getCharacterImage, getPlaceholderImage } from '$lib/utils/images'
|
||||
|
||||
// Components
|
||||
import CharacterUncapSection from '$lib/features/database/characters/sections/CharacterUncapSection.svelte'
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
status: entity.status,
|
||||
imageUrl: entity.granblueId
|
||||
? getCharacterImage(entity.granblueId, 'square')
|
||||
: '/images/placeholders/placeholder-character-square.png',
|
||||
: getPlaceholderImage('character', 'square'),
|
||||
error: entity.error,
|
||||
saved: savedEntities.has(wikiPage)
|
||||
}))
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<script lang="ts">
|
||||
import { goto } from '$app/navigation'
|
||||
import { entityAdapter, type SummonSuggestions } from '$lib/api/adapters/entity.adapter'
|
||||
import { getSummonImage } from '$lib/utils/images'
|
||||
import { getSummonImage, getPlaceholderImage } from '$lib/utils/images'
|
||||
|
||||
// Components
|
||||
import SummonUncapSection from '$lib/features/database/summons/sections/SummonUncapSection.svelte'
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
status: entity.status,
|
||||
imageUrl: entity.granblueId
|
||||
? getSummonImage(entity.granblueId, 'square')
|
||||
: '/images/placeholders/placeholder-summon-square.png',
|
||||
: getPlaceholderImage('summon', 'square'),
|
||||
error: entity.error,
|
||||
saved: savedEntities.has(wikiPage)
|
||||
}))
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<script lang="ts">
|
||||
import { goto } from '$app/navigation'
|
||||
import { entityAdapter, type WeaponSuggestions } from '$lib/api/adapters/entity.adapter'
|
||||
import { getWeaponImage } from '$lib/utils/images'
|
||||
import { getWeaponImage, getPlaceholderImage } from '$lib/utils/images'
|
||||
|
||||
// Components
|
||||
import WeaponUncapSection from '$lib/features/database/weapons/sections/WeaponUncapSection.svelte'
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
status: entity.status,
|
||||
imageUrl: entity.granblueId
|
||||
? getWeaponImage(entity.granblueId, 'square')
|
||||
: '/images/placeholders/placeholder-weapon-square.png',
|
||||
: getPlaceholderImage('weapon', 'square'),
|
||||
error: entity.error,
|
||||
saved: savedEntities.has(wikiPage)
|
||||
}))
|
||||
|
|
|
|||
Loading…
Reference in a new issue