use aws cdn for picker images

This commit is contained in:
Justin Edmund 2026-01-06 00:24:36 -08:00
parent 505f209fae
commit 77949edd9d
3 changed files with 5 additions and 3 deletions

View file

@ -73,5 +73,5 @@ export function getOppositeElement(element?: number): number | undefined {
export function getElementImage(element?: number): string {
if (element === undefined || element === null) return ''
const label = ELEMENT_LABELS[element]?.toLowerCase() ?? 'null'
return `/images/elements/${label}.png`
return `${getBasePath()}/elements/${label}.png`
}

View file

@ -36,5 +36,5 @@ export function getProficiencyOptions() {
export function getProficiencyImage(proficiency: number): string {
const label = PROFICIENCY_LABELS[proficiency]
if (!label || label === 'None') return ''
return `/images/proficiencies/${label.toLowerCase()}.png`
return `${getBasePath()}/proficiencies/${label.toLowerCase()}.png`
}

View file

@ -1,3 +1,5 @@
import { getBasePath } from '$lib/utils/images'
export const RARITY_LABELS: Record<number, string> = {
1: 'R',
2: 'SR',
@ -39,5 +41,5 @@ export function getRarityClass(rarity: number): string {
export function getRarityImage(rarity: number): string {
const label = RARITY_LABELS[rarity]
if (!label) return ''
return `/images/rarity/${label.toLowerCase()}.png`
return `${getBasePath()}/rarity/${label.toLowerCase()}.png`
}