diff --git a/src/lib/utils/element.ts b/src/lib/utils/element.ts index c18221a1..da980d33 100644 --- a/src/lib/utils/element.ts +++ b/src/lib/utils/element.ts @@ -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` } \ No newline at end of file diff --git a/src/lib/utils/proficiency.ts b/src/lib/utils/proficiency.ts index 529f6579..21cf2637 100644 --- a/src/lib/utils/proficiency.ts +++ b/src/lib/utils/proficiency.ts @@ -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` } diff --git a/src/lib/utils/rarity.ts b/src/lib/utils/rarity.ts index 841bb711..d5f29f36 100644 --- a/src/lib/utils/rarity.ts +++ b/src/lib/utils/rarity.ts @@ -1,3 +1,5 @@ +import { getBasePath } from '$lib/utils/images' + export const RARITY_LABELS: Record = { 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` } \ No newline at end of file