use detail/base images in sidebar

This commit is contained in:
Justin Edmund 2025-09-24 03:28:49 -07:00
parent 91524ed064
commit f8e9c411f7

View file

@ -5,6 +5,7 @@
import { getProficiencyLabel } from '$lib/utils/proficiency' import { getProficiencyLabel } from '$lib/utils/proficiency'
import { getRaceLabel } from '$lib/utils/race' import { getRaceLabel } from '$lib/utils/race'
import { getGenderLabel } from '$lib/utils/gender' import { getGenderLabel } from '$lib/utils/gender'
import { getCharacterDetailImage, getWeaponBaseImage, getSummonDetailImage, getCharacterPose } from '$lib/utils/images'
import UncapIndicator from '$lib/components/uncap/UncapIndicator.svelte' import UncapIndicator from '$lib/components/uncap/UncapIndicator.svelte'
interface Props { interface Props {
@ -52,26 +53,17 @@
(item as GridSummon).transcendenceStep (item as GridSummon).transcendenceStep
) )
// Get image URL based on type // Get image URL based on type using detail/base variants
function getImageUrl(): string { function getImageUrl(): string {
if (!itemData?.granblueId) { const id = itemData?.granblueId
return type === 'character' ? '/images/placeholders/placeholder-character-main.png' :
type === 'weapon' ? '/images/placeholders/placeholder-weapon-main.png' :
'/images/placeholders/placeholder-summon-main.png'
}
const id = itemData.granblueId
if (type === 'character') { if (type === 'character') {
let pose = '01' const pose = getCharacterPose(gridUncapLevel, gridTranscendence)
if (gridTranscendence && gridTranscendence > 0) pose = '04' return getCharacterDetailImage(id, pose)
else if (gridUncapLevel && gridUncapLevel >= 5) pose = '03'
else if (gridUncapLevel && gridUncapLevel > 2) pose = '02'
return `/images/character-main/${id}_${pose}.jpg`
} else if (type === 'weapon') { } else if (type === 'weapon') {
return `/images/weapon-main/${id}.jpg` return getWeaponBaseImage(id)
} else { } else {
return `/images/summon-main/${id}.jpg` return getSummonDetailImage(id)
} }
} }
</script> </script>